Contacts: Ability to add unlimited Emails and URLs. Ability to specify a primary Email, Address, URL, and Number. Ability to select or define a custom label for Emails, Addresses, URLs, and Numbers (similar to Google Contacts).
This commit is contained in:
@@ -57,36 +57,36 @@ require_once "resources/paging.php";
|
||||
echo "</table>\n";
|
||||
|
||||
//prepare to page the results
|
||||
$sql = "select count(*) as num_rows from v_contact_notes ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and contact_uuid = '$contact_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
if ($row['num_rows'] > 0) {
|
||||
$num_rows = $row['num_rows'];
|
||||
}
|
||||
else {
|
||||
$num_rows = '0';
|
||||
}
|
||||
}
|
||||
// $sql = "select count(*) as num_rows from v_contact_notes ";
|
||||
// $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
// $sql .= "and contact_uuid = '$contact_uuid' ";
|
||||
// if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
// $prep_statement = $db->prepare($sql);
|
||||
// if ($prep_statement) {
|
||||
// $prep_statement->execute();
|
||||
// $row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
// if ($row['num_rows'] > 0) {
|
||||
// $num_rows = $row['num_rows'];
|
||||
// }
|
||||
// else {
|
||||
// $num_rows = '0';
|
||||
// }
|
||||
// }
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = 10;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
// $rows_per_page = 10;
|
||||
// $param = "";
|
||||
// $page = $_GET['page'];
|
||||
// if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
// list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
// $offset = $rows_per_page * $page;
|
||||
|
||||
//get the contact list
|
||||
$sql = "select * from v_contact_notes ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and contact_uuid = '$contact_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$sql .= " limit $rows_per_page offset $offset ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by ".$order_by." ".$order." "; }
|
||||
// $sql .= " limit ".$rows_per_page." offset ".$offset." ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
@@ -99,38 +99,25 @@ require_once "resources/paging.php";
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
if ($result_count == 0) {
|
||||
echo "<tr>\n";
|
||||
echo "<th> </th>\n";
|
||||
echo "<td class='list_control_icon'>";
|
||||
echo "<a href='contact_note_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
else {
|
||||
echo "<tr>\n";
|
||||
echo "<th>".$text['label-note_content']."</th>\n";
|
||||
echo "<th style='text-align: right;'>".$text['label-note_user']."</th>\n";
|
||||
echo "<td class='list_control_icons'>";
|
||||
echo "<a href='contact_note_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($result_count != 0) {
|
||||
foreach($result as $row) {
|
||||
$contact_note = $row['contact_note'];
|
||||
$contact_note = str_replace("\n","<br />",$contact_note);
|
||||
|
||||
echo "<tr >\n";
|
||||
echo "<th>\n";
|
||||
echo " ".$row['last_mod_date']." \n";
|
||||
echo " ".$row['last_mod_user']." \n";
|
||||
echo "</th>\n";
|
||||
//echo "<th>Modified Date ".$row['last_mod_date']."</th>\n";
|
||||
//echo "<th>Modified By ".$row['last_mod_user']."</th>\n";
|
||||
echo "<td align='right' width='42'>\n";
|
||||
echo " <a href='contact_note_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
$tr_link = "href='contact_note_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."'";
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$contact_note." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['last_mod_date']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['last_mod_user']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' colspan='2'>";
|
||||
echo " <div style='display: inline-block; float: right; margin: -5px -7px 5px 5px; padding: 3px 4px; font-size: 10px; background-color: #f0f2f6;'><span style='color: #000; font-weight: bold;'>".$row['last_mod_user']."</span>: ".date("j M Y @ H:i:s", strtotime($row['last_mod_date']))."</div>";
|
||||
echo $contact_note." ";
|
||||
echo " </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
echo "<a href='contact_note_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
echo "<a href='contact_note_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_note_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
@@ -143,7 +130,7 @@ require_once "resources/paging.php";
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='4' align='left'>\n";
|
||||
echo "<td colspan='3' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
@@ -157,6 +144,5 @@ require_once "resources/paging.php";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user