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:
@@ -38,8 +38,8 @@ else {
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//get variables used to control the order
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
// $order_by = $_GET["order_by"];
|
||||
// $order = $_GET["order"];
|
||||
|
||||
//show the content
|
||||
|
||||
@@ -51,36 +51,37 @@ require_once "resources/paging.php";
|
||||
echo "</table>\n";
|
||||
|
||||
//prepare to page the results
|
||||
$sql = " select count(*) as num_rows from v_contact_addresses ";
|
||||
$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_addresses ";
|
||||
// $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_addresses ";
|
||||
$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 ";
|
||||
$sql = "select * from v_contact_addresses ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and contact_uuid = '$contact_uuid' ";
|
||||
$sql .= "order by address_primary desc, address_label asc ";
|
||||
// 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));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
@@ -95,17 +96,12 @@ require_once "resources/paging.php";
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('address_type', $text['label-address_type'], $order_by, $order);
|
||||
//echo th_order_by('address_street', $text['label-address_street'], $order_by, $order);
|
||||
//echo th_order_by('address_extended', $text['label-address_extended'], $order_by, $order);
|
||||
echo th_order_by('address_locality', $text['label-address_locality'], $order_by, $order);
|
||||
echo th_order_by('address_region', $text['label-address_region'], $order_by, $order);
|
||||
//echo th_order_by('address_postal_code', $text['label-address_postal_code'], $order_by, $order);
|
||||
echo th_order_by('address_country', $text['label-address_country'], $order_by, $order);
|
||||
//echo th_order_by('address_latitude', $text['label-address_latitude'], $order_by, $order);
|
||||
//echo th_order_by('address_longitude', $text['label-address_longitude'], $order_by, $order);
|
||||
echo "<th>".$text['label-address_tools']."</th>\n";
|
||||
echo th_order_by('address_description', $text['label-address_description'], $order_by, $order);
|
||||
echo "<th>".$text['label-address_label']."</th>\n";
|
||||
echo "<th>".$text['label-address_address']."</th>\n";
|
||||
echo "<th>".$text['label-address_locality'].", ".$text['label-address_region']."</th>\n";
|
||||
echo "<th style='text-align: center;'>".$text['label-address_country']."</th>\n";
|
||||
echo "<th> </th>\n";
|
||||
echo "<th>".$text['label-address_description']."</th>\n";
|
||||
echo "<td class='list_control_icons'>";
|
||||
echo "<a href='contact_address_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
echo "</td>\n";
|
||||
@@ -115,19 +111,13 @@ require_once "resources/paging.php";
|
||||
foreach($result as $row) {
|
||||
$map_query = $row['address_street']." ".$row['address_extended'].", ".$row['address_locality'].", ".$row['address_region'].", ".$row['address_region'].", ".$row['address_postal_code'];
|
||||
$tr_link = "href='contact_address_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_address_uuid']."'";
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_name']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".ucwords($row['address_type'])." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_street']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_extended']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_locality']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_region']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_postal_code']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_country']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_latitude']." </td>\n";
|
||||
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_longitude']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]." tr_link_void'>\n";
|
||||
echo " <a href=\"http://maps.google.com/maps?q=".urlencode($map_query)."&hl=en\" target=\"_blank\">Map</a> \n";
|
||||
echo "<tr ".$tr_link." ".(($row['address_primary']) ? "style='font-weight: bold;'" : null).">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['address_label']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='width: 25%; max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;'>".$row['address_street']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='white-space: nowrap;'>".$row['address_locality'].(($row['address_region'] != '') ? ", ".$row['address_region'] : null)." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".$row['address_country']." </td>\n";
|
||||
echo " <td valign='middle' class='".$row_style[$c]." tr_link_void' style='padding: 0px;'>\n";
|
||||
echo " <a href=\"http://maps.google.com/maps?q=".urlencode($map_query)."&hl=en\" target=\"_blank\"><img src='icon_gmaps.png' style='width: 21px; height: 21px; alt='".$text['label-google_map']."' title='".$text['label-google_map']."'></a>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".$row['address_description']." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
@@ -141,11 +131,11 @@ require_once "resources/paging.php";
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='11' align='left'>\n";
|
||||
echo "<td colspan='7' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
// echo " <td width='33.3%' nowrap> </td>\n";
|
||||
// echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
echo "<a href='contact_address_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
echo " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user