|
@@ -57,6 +57,8 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|
if (count($_POST)>0) {
|
|
if (count($_POST)>0) {
|
|
//$address_name = check_str($_POST["address_name"]);
|
|
//$address_name = check_str($_POST["address_name"]);
|
|
$address_type = check_str($_POST["address_type"]);
|
|
$address_type = check_str($_POST["address_type"]);
|
|
|
|
+ $address_label = check_str($_POST["address_label"]);
|
|
|
|
+ $address_label_custom = check_str($_POST["address_label_custom"]);
|
|
$address_street = check_str($_POST["address_street"]);
|
|
$address_street = check_str($_POST["address_street"]);
|
|
$address_extended = check_str($_POST["address_extended"]);
|
|
$address_extended = check_str($_POST["address_extended"]);
|
|
$address_locality = check_str($_POST["address_locality"]);
|
|
$address_locality = check_str($_POST["address_locality"]);
|
|
@@ -65,7 +67,11 @@ if (strlen($_GET["contact_uuid"]) > 0) {
|
|
$address_country = check_str($_POST["address_country"]);
|
|
$address_country = check_str($_POST["address_country"]);
|
|
$address_latitude = check_str($_POST["address_latitude"]);
|
|
$address_latitude = check_str($_POST["address_latitude"]);
|
|
$address_longitude = check_str($_POST["address_longitude"]);
|
|
$address_longitude = check_str($_POST["address_longitude"]);
|
|
|
|
+ $address_primary = check_str($_POST["address_primary"]);
|
|
$address_description = check_str($_POST["address_description"]);
|
|
$address_description = check_str($_POST["address_description"]);
|
|
|
|
+
|
|
|
|
+ //use custom label if set
|
|
|
|
+ $address_label = ($address_label_custom != '') ? $address_label_custom : $address_label;
|
|
}
|
|
}
|
|
|
|
|
|
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
@@ -76,15 +82,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
}
|
|
}
|
|
|
|
|
|
//check for all required data
|
|
//check for all required data
|
|
- //if (strlen($address_type) == 0) { $msg .= $text['message-required'].$text['label-address_type']."<br>\n"; }
|
|
|
|
- //if (strlen($address_street) == 0) { $msg .= $text['message-required'].$text['label-address_street']."<br>\n"; }
|
|
|
|
- //if (strlen($address_extended) == 0) { $msg .= $text['message-required'].$text['label-address_extended']."<br>\n"; }
|
|
|
|
- //if (strlen($address_locality) == 0) { $msg .= $text['message-required'].$text['label-address_locality']."<br>\n"; }
|
|
|
|
- //if (strlen($address_region) == 0) { $msg .= $text['message-required'].$text['label-address_region']."<br>\n"; }
|
|
|
|
- //if (strlen($address_postal_code) == 0) { $msg .= $text['message-required'].$text['label-address_postal_code']."<br>\n"; }
|
|
|
|
- //if (strlen($address_country) == 0) { $msg .= $text['message-required'].$text['label-address_country']."<br>\n"; }
|
|
|
|
- //if (strlen($address_latitude) == 0) { $msg .= $text['message-required'].$text['label-address_latitude']."<br>\n"; }
|
|
|
|
- //if (strlen($address_longitude) == 0) { $msg .= $text['message-required'].$text['label-address_longitude']."<br>\n"; }
|
|
|
|
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|
require_once "resources/header.php";
|
|
require_once "resources/header.php";
|
|
require_once "resources/persist_form_var.php";
|
|
require_once "resources/persist_form_var.php";
|
|
@@ -100,6 +97,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
//add or update the database
|
|
//add or update the database
|
|
if ($_POST["persistformvar"] != "true") {
|
|
if ($_POST["persistformvar"] != "true") {
|
|
|
|
+
|
|
|
|
+ //if primary, unmark other primary numbers
|
|
|
|
+ if ($address_primary) {
|
|
|
|
+ $sql = "update v_contact_addresses set address_primary = 0 ";
|
|
|
|
+ $sql .= "where domain_uuid = '".$domain_uuid."' ";
|
|
|
|
+ $sql .= "and contact_uuid = '".$contact_uuid."' ";
|
|
|
|
+ $db->exec(check_sql($sql));
|
|
|
|
+ unset($sql);
|
|
|
|
+ }
|
|
|
|
+
|
|
if ($action == "add") {
|
|
if ($action == "add") {
|
|
$contact_address_uuid = uuid();
|
|
$contact_address_uuid = uuid();
|
|
$sql = "insert into v_contact_addresses ";
|
|
$sql = "insert into v_contact_addresses ";
|
|
@@ -107,8 +114,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
$sql .= "domain_uuid, ";
|
|
$sql .= "domain_uuid, ";
|
|
$sql .= "contact_uuid, ";
|
|
$sql .= "contact_uuid, ";
|
|
$sql .= "contact_address_uuid, ";
|
|
$sql .= "contact_address_uuid, ";
|
|
- //$sql .= "address_name, ";
|
|
|
|
$sql .= "address_type, ";
|
|
$sql .= "address_type, ";
|
|
|
|
+ $sql .= "address_label, ";
|
|
$sql .= "address_street, ";
|
|
$sql .= "address_street, ";
|
|
$sql .= "address_extended, ";
|
|
$sql .= "address_extended, ";
|
|
$sql .= "address_locality, ";
|
|
$sql .= "address_locality, ";
|
|
@@ -117,24 +124,26 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
$sql .= "address_country, ";
|
|
$sql .= "address_country, ";
|
|
$sql .= "address_latitude, ";
|
|
$sql .= "address_latitude, ";
|
|
$sql .= "address_longitude, ";
|
|
$sql .= "address_longitude, ";
|
|
|
|
+ $sql .= "address_primary, ";
|
|
$sql .= "address_description ";
|
|
$sql .= "address_description ";
|
|
$sql .= ")";
|
|
$sql .= ")";
|
|
$sql .= "values ";
|
|
$sql .= "values ";
|
|
$sql .= "(";
|
|
$sql .= "(";
|
|
$sql .= "'".$_SESSION['domain_uuid']."', ";
|
|
$sql .= "'".$_SESSION['domain_uuid']."', ";
|
|
- $sql .= "'$contact_uuid', ";
|
|
|
|
- $sql .= "'$contact_address_uuid', ";
|
|
|
|
- //$sql .= "'$address_name', ";
|
|
|
|
- $sql .= "'$address_type', ";
|
|
|
|
- $sql .= "'$address_street', ";
|
|
|
|
- $sql .= "'$address_extended', ";
|
|
|
|
- $sql .= "'$address_locality', ";
|
|
|
|
- $sql .= "'$address_region', ";
|
|
|
|
- $sql .= "'$address_postal_code', ";
|
|
|
|
- $sql .= "'$address_country', ";
|
|
|
|
- $sql .= "'$address_latitude', ";
|
|
|
|
- $sql .= "'$address_longitude', ";
|
|
|
|
- $sql .= "'$address_description' ";
|
|
|
|
|
|
+ $sql .= "'".$contact_uuid."', ";
|
|
|
|
+ $sql .= "'".$contact_address_uuid."', ";
|
|
|
|
+ $sql .= "'".$address_type."', ";
|
|
|
|
+ $sql .= "'".$address_label."', ";
|
|
|
|
+ $sql .= "'".$address_street."', ";
|
|
|
|
+ $sql .= "'".$address_extended."', ";
|
|
|
|
+ $sql .= "'".$address_locality."', ";
|
|
|
|
+ $sql .= "'".$address_region."', ";
|
|
|
|
+ $sql .= "'".$address_postal_code."', ";
|
|
|
|
+ $sql .= "'".$address_country."', ";
|
|
|
|
+ $sql .= "'".$address_latitude."', ";
|
|
|
|
+ $sql .= "'".$address_longitude."', ";
|
|
|
|
+ $sql .= (($address_primary) ? 1 : 0).", ";
|
|
|
|
+ $sql .= "'".$address_description."' ";
|
|
$sql .= ")";
|
|
$sql .= ")";
|
|
$db->exec(check_sql($sql));
|
|
$db->exec(check_sql($sql));
|
|
unset($sql);
|
|
unset($sql);
|
|
@@ -146,20 +155,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
if ($action == "update") {
|
|
if ($action == "update") {
|
|
$sql = "update v_contact_addresses set ";
|
|
$sql = "update v_contact_addresses set ";
|
|
- $sql .= "contact_uuid = '$contact_uuid', ";
|
|
|
|
- //$sql .= "address_name = '$address_name', ";
|
|
|
|
- $sql .= "address_type = '$address_type', ";
|
|
|
|
- $sql .= "address_street = '$address_street', ";
|
|
|
|
- $sql .= "address_extended = '$address_extended', ";
|
|
|
|
- $sql .= "address_locality = '$address_locality', ";
|
|
|
|
- $sql .= "address_region = '$address_region', ";
|
|
|
|
- $sql .= "address_postal_code = '$address_postal_code', ";
|
|
|
|
- $sql .= "address_country = '$address_country', ";
|
|
|
|
- $sql .= "address_latitude = '$address_latitude', ";
|
|
|
|
- $sql .= "address_longitude = '$address_longitude', ";
|
|
|
|
- $sql .= "address_description = '$address_description' ";
|
|
|
|
|
|
+ $sql .= "contact_uuid = '".$contact_uuid."', ";
|
|
|
|
+ $sql .= "address_type = '".$address_type."', ";
|
|
|
|
+ $sql .= "address_label = '".$address_label."', ";
|
|
|
|
+ $sql .= "address_street = '".$address_street."', ";
|
|
|
|
+ $sql .= "address_extended = '".$address_extended."', ";
|
|
|
|
+ $sql .= "address_locality = '".$address_locality."', ";
|
|
|
|
+ $sql .= "address_region = '".$address_region."', ";
|
|
|
|
+ $sql .= "address_postal_code = '".$address_postal_code."', ";
|
|
|
|
+ $sql .= "address_country = '".$address_country."', ";
|
|
|
|
+ $sql .= "address_latitude = '".$address_latitude."', ";
|
|
|
|
+ $sql .= "address_longitude = '".$address_longitude."', ";
|
|
|
|
+ $sql .= "address_primary = ".(($address_primary) ? 1 : 0).", ";
|
|
|
|
+ $sql .= "address_description = '".$address_description."' ";
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
- $sql .= "and contact_address_uuid = '$contact_address_uuid'";
|
|
|
|
|
|
+ $sql .= "and contact_address_uuid = '".$contact_address_uuid."'";
|
|
$db->exec(check_sql($sql));
|
|
$db->exec(check_sql($sql));
|
|
unset($sql);
|
|
unset($sql);
|
|
|
|
|
|
@@ -182,6 +192,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
foreach ($result as &$row) {
|
|
foreach ($result as &$row) {
|
|
//$address_name = $row["address_name"];
|
|
//$address_name = $row["address_name"];
|
|
$address_type = $row["address_type"];
|
|
$address_type = $row["address_type"];
|
|
|
|
+ $address_label = $row["address_label"];
|
|
$address_street = $row["address_street"];
|
|
$address_street = $row["address_street"];
|
|
$address_extended = $row["address_extended"];
|
|
$address_extended = $row["address_extended"];
|
|
$address_locality = $row["address_locality"];
|
|
$address_locality = $row["address_locality"];
|
|
@@ -190,6 +201,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
$address_country = $row["address_country"];
|
|
$address_country = $row["address_country"];
|
|
$address_latitude = $row["address_latitude"];
|
|
$address_latitude = $row["address_latitude"];
|
|
$address_longitude = $row["address_longitude"];
|
|
$address_longitude = $row["address_longitude"];
|
|
|
|
+ $address_primary = $row["address_primary"];
|
|
$address_description = $row["address_description"];
|
|
$address_description = $row["address_description"];
|
|
break; //limit to 1 row
|
|
break; //limit to 1 row
|
|
}
|
|
}
|
|
@@ -205,18 +217,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
$document['title'] = $text['title-contact_addresses-add'];
|
|
$document['title'] = $text['title-contact_addresses-add'];
|
|
}
|
|
}
|
|
|
|
|
|
-//show the content
|
|
|
|
- echo "<div align='center'>";
|
|
|
|
- echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
|
|
|
|
- echo "<tr class='border'>\n";
|
|
|
|
- echo " <td align=\"left\">\n";
|
|
|
|
- echo " <br>";
|
|
|
|
|
|
+//javascript to toggle input/select boxes
|
|
|
|
+ echo "<script type='text/javascript'>";
|
|
|
|
+ echo " function toggle_custom(field) {";
|
|
|
|
+ echo " $('#'+field).toggle();";
|
|
|
|
+ echo " document.getElementById(field).selectedIndex = 0;";
|
|
|
|
+ echo " document.getElementById(field+'_custom').value = '';";
|
|
|
|
+ echo " $('#'+field+'_custom').toggle();";
|
|
|
|
+ echo " if ($('#'+field+'_custom').is(':visible')) { $('#'+field+'_custom').focus(); } else { $('#'+field).focus(); }";
|
|
|
|
+ echo " }";
|
|
|
|
+ echo "</script>";
|
|
|
|
|
|
|
|
+//show the content
|
|
echo "<form method='post' name='frm' action=''>\n";
|
|
echo "<form method='post' name='frm' action=''>\n";
|
|
- echo "<div align='center'>\n";
|
|
|
|
- echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
|
|
|
|
|
+ echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
- echo "<td align='left' width='30%' nowrap='nowrap'><b>";
|
|
|
|
|
|
+ echo "<td align='left' valign='top' nowrap='nowrap'><b>";
|
|
if ($action == "update") {
|
|
if ($action == "update") {
|
|
echo $text['header-contact_addresses-edit'];
|
|
echo $text['header-contact_addresses-edit'];
|
|
}
|
|
}
|
|
@@ -224,13 +240,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
echo $text['header-contact_addresses-add'];
|
|
echo $text['header-contact_addresses-add'];
|
|
}
|
|
}
|
|
echo "</b></td>\n";
|
|
echo "</b></td>\n";
|
|
- echo "<td width='70%' align='right'>";
|
|
|
|
|
|
+ echo "<td align='right' valign='top'>";
|
|
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contact_edit.php?id=$contact_uuid'\" value='".$text['button-back']."'>";
|
|
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contact_edit.php?id=$contact_uuid'\" value='".$text['button-back']."'>";
|
|
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "</tr>\n";
|
|
echo "</tr>\n";
|
|
- echo "<tr>\n";
|
|
|
|
- echo "<td align='left' colspan='2'>\n";
|
|
|
|
|
|
+ echo "</table>\n";
|
|
|
|
+
|
|
if ($action == "update") {
|
|
if ($action == "update") {
|
|
echo $text['description-contact_addresses-edit'];
|
|
echo $text['description-contact_addresses-edit'];
|
|
}
|
|
}
|
|
@@ -238,75 +254,85 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
echo $text['description-contact_addresses-add'];
|
|
echo $text['description-contact_addresses-add'];
|
|
}
|
|
}
|
|
echo "<br /><br />\n";
|
|
echo "<br /><br />\n";
|
|
- echo "</td>\n";
|
|
|
|
- echo "</tr>\n";
|
|
|
|
|
|
|
|
|
|
+ echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
- echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
- echo " ".$text['label-address_type'].":\n";
|
|
|
|
|
|
+ echo "<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
+ echo " ".$text['label-address_label']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
- echo "<td class='vtable' align='left'>\n";
|
|
|
|
- if (is_array($_SESSION["contact"]["address_type"])) {
|
|
|
|
- sort($_SESSION["contact"]["address_type"]);
|
|
|
|
- echo " <select class='formfld' style='width:85%;' name='address_type'>\n";
|
|
|
|
- echo " <option value=''></option>\n";
|
|
|
|
- foreach($_SESSION["contact"]["address_type"] as $row) {
|
|
|
|
- if ($row == $address_type) {
|
|
|
|
- echo " <option value='".$row."' selected='selected'>".$row."</option>\n";
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- echo " <option value='".$row."'>".$row."</option>\n";
|
|
|
|
- }
|
|
|
|
|
|
+ echo "<td width='70%' class='vtable' align='left'>\n";
|
|
|
|
+ if (is_array($_SESSION["contact"]["address_label"])) {
|
|
|
|
+ sort($_SESSION["contact"]["address_label"]);
|
|
|
|
+ foreach($_SESSION["contact"]["address_label"] as $row) {
|
|
|
|
+ $address_label_options[] = "<option value='".$row."' ".(($row == $address_label) ? "selected='selected'" : null).">".$row."</option>";
|
|
}
|
|
}
|
|
- echo " </select>\n";
|
|
|
|
|
|
+ $address_label_found = (in_array($address_label, $_SESSION["contact"]["address_label"])) ? true : false;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- echo " <select class='formfld' name='address_type'>\n";
|
|
|
|
- echo " <option value=''></option>\n";
|
|
|
|
- if (strtolower($address_type) == "home") {
|
|
|
|
- echo " <option value='home' selected='selected'>".$text['option-home']."</option>\n";
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- echo " <option value='home'>".$text['option-home']."</option>\n";
|
|
|
|
- }
|
|
|
|
- if (strtolower($address_type) == "work") {
|
|
|
|
- echo " <option value='work' selected='selected'>".$text['option-work']."</option>\n";
|
|
|
|
|
|
+ $selected[$address_label] = "selected";
|
|
|
|
+ $default_labels[] = $text['option-work'];
|
|
|
|
+ $default_labels[] = $text['option-home'];
|
|
|
|
+ $default_labels[] = $text['option-mailing'];
|
|
|
|
+ $default_labels[] = $text['option-physical'];
|
|
|
|
+ $default_labels[] = $text['option-shipping'];
|
|
|
|
+ $default_labels[] = $text['option-billing'];
|
|
|
|
+ $default_labels[] = $text['option-other'];
|
|
|
|
+ foreach ($default_labels as $default_label) {
|
|
|
|
+ $address_label_options[] = "<option value='".$default_label."' ".$selected[$default_label].">".$default_label."</option>";
|
|
}
|
|
}
|
|
- else {
|
|
|
|
- echo " <option value='work'>".$text['option-work']."</option>\n";
|
|
|
|
- }
|
|
|
|
- echo " </select>\n";
|
|
|
|
|
|
+ $address_label_found = (in_array($address_label, $default_labels)) ? true : false;
|
|
}
|
|
}
|
|
|
|
+ echo " <select class='formfld' ".((!$address_label_found && $address_label != '') ? "style='display: none;'" : null)." name='address_label' id='address_label' onchange=\"getElementById('address_label_custom').value='';\">\n";
|
|
|
|
+ echo " <option value=''></option>\n";
|
|
|
|
+ echo (is_array($address_label_options)) ? implode("\n", $address_label_options) : null;
|
|
|
|
+ echo " </select>\n";
|
|
|
|
+ echo " <input type='text' class='formfld' ".(($address_label_found || $address_label == '') ? "style='display: none;'" : null)." name='address_label_custom' id='address_label_custom' value=\"".((!$address_label_found) ? htmlentities($address_label) : null)."\">\n";
|
|
|
|
+ echo " <input type='button' id='btn_toggle_label' class='btn' alt='".$text['button-back']."' value='◁' onclick=\"toggle_custom('address_label');\">\n";
|
|
echo "<br />\n";
|
|
echo "<br />\n";
|
|
- echo $text['description-address_type']."\n";
|
|
|
|
|
|
+ echo $text['description-address_label']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "</tr>\n";
|
|
echo "</tr>\n";
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_street'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_type']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
- echo " <input class='formfld' type='text' name='address_street' maxlength='255' value=\"$address_street\">\n";
|
|
|
|
|
|
+ echo " <select class='formfld' name='address_type' id='address_type'>\n";
|
|
|
|
+ echo " <option value=''></option>\n";
|
|
|
|
+ $vcard_address_types = array(
|
|
|
|
+ 'work' => $text['option-work'],
|
|
|
|
+ 'home' => $text['option-home'],
|
|
|
|
+ 'dom' => $text['option-dom'],
|
|
|
|
+ 'intl' => $text['option-intl'],
|
|
|
|
+ 'postal' => $text['option-postal'],
|
|
|
|
+ 'parcel' => $text['option-parcel'],
|
|
|
|
+ 'pref' => $text['option-pref']
|
|
|
|
+ );
|
|
|
|
+ foreach ($vcard_address_types as $vcard_address_type_value => $vcard_address_type_label) {
|
|
|
|
+ echo " <option value='".$vcard_address_type_value."' ".(($address_type == $vcard_address_type_value) ? "selected" : null).">".$vcard_address_type_label."</option>\n";
|
|
|
|
+ }
|
|
|
|
+ echo " </select>\n";
|
|
echo "<br />\n";
|
|
echo "<br />\n";
|
|
- echo $text['description-address_street']."\n";
|
|
|
|
|
|
+ echo $text['description-address_type']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "</tr>\n";
|
|
echo "</tr>\n";
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_extended'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_address']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
|
|
+ echo " <input class='formfld' type='text' name='address_street' maxlength='255' value=\"$address_street\" style='margin-bottom: 3px;'><br>\n";
|
|
echo " <input class='formfld' type='text' name='address_extended' maxlength='255' value=\"$address_extended\">\n";
|
|
echo " <input class='formfld' type='text' name='address_extended' maxlength='255' value=\"$address_extended\">\n";
|
|
echo "<br />\n";
|
|
echo "<br />\n";
|
|
- echo $text['description-address_extended']."\n";
|
|
|
|
|
|
+ echo $text['description-address_address']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "</tr>\n";
|
|
echo "</tr>\n";
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_locality'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_locality']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_locality' maxlength='255' value=\"$address_locality\">\n";
|
|
echo " <input class='formfld' type='text' name='address_locality' maxlength='255' value=\"$address_locality\">\n";
|
|
@@ -317,7 +343,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_region'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_region']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_region' maxlength='255' value=\"$address_region\">\n";
|
|
echo " <input class='formfld' type='text' name='address_region' maxlength='255' value=\"$address_region\">\n";
|
|
@@ -328,7 +354,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_postal_code'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_postal_code']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_postal_code' maxlength='255' value=\"$address_postal_code\">\n";
|
|
echo " <input class='formfld' type='text' name='address_postal_code' maxlength='255' value=\"$address_postal_code\">\n";
|
|
@@ -339,7 +365,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_country'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_country']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_country' maxlength='255' value=\"$address_country\">\n";
|
|
echo " <input class='formfld' type='text' name='address_country' maxlength='255' value=\"$address_country\">\n";
|
|
@@ -350,7 +376,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_latitude'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_latitude']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_latitude' maxlength='255' value=\"$address_latitude\">\n";
|
|
echo " <input class='formfld' type='text' name='address_latitude' maxlength='255' value=\"$address_latitude\">\n";
|
|
@@ -361,7 +387,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_longitude'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-address_longitude']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_longitude' maxlength='255' value=\"$address_longitude\">\n";
|
|
echo " <input class='formfld' type='text' name='address_longitude' maxlength='255' value=\"$address_longitude\">\n";
|
|
@@ -372,7 +398,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo "<tr>\n";
|
|
echo "<tr>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
- echo " ".$text['label-address_description'].":\n";
|
|
|
|
|
|
+ echo " ".$text['label-primary']."\n";
|
|
|
|
+ echo "</td>\n";
|
|
|
|
+ echo "<td class='vtable' align='left'>\n";
|
|
|
|
+ echo " <select class='formfld' name='address_primary' id='address_primary'>\n";
|
|
|
|
+ echo " <option value='0'>".$text['option-false']."</option>\n";
|
|
|
|
+ echo " <option value='1' ".(($address_primary) ? "selected" : null).">".$text['option-true']."</option>\n";
|
|
|
|
+ echo " </select>\n";
|
|
|
|
+ echo "<br />\n";
|
|
|
|
+ echo $text['description-address_primary']."\n";
|
|
|
|
+ echo "</td>\n";
|
|
|
|
+ echo "</tr>\n";
|
|
|
|
+
|
|
|
|
+ echo "<tr>\n";
|
|
|
|
+ echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
|
|
|
+ echo " ".$text['label-address_description']."\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo "<td class='vtable' align='left'>\n";
|
|
echo " <input class='formfld' type='text' name='address_description' maxlength='255' value=\"$address_description\">\n";
|
|
echo " <input class='formfld' type='text' name='address_description' maxlength='255' value=\"$address_description\">\n";
|
|
@@ -383,21 +423,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|
|
|
|
|
echo " <tr>\n";
|
|
echo " <tr>\n";
|
|
echo " <td colspan='2' align='right'>\n";
|
|
echo " <td colspan='2' align='right'>\n";
|
|
- echo " <input type='hidden' name='contact_uuid' value='$contact_uuid'>\n";
|
|
|
|
|
|
+ echo " <br>\n";
|
|
|
|
+ echo " <input type='hidden' name='contact_uuid' value='$contact_uuid'>\n";
|
|
if ($action == "update") {
|
|
if ($action == "update") {
|
|
- echo " <input type='hidden' name='contact_address_uuid' value='$contact_address_uuid'>\n";
|
|
|
|
|
|
+ echo " <input type='hidden' name='contact_address_uuid' value='$contact_address_uuid'>\n";
|
|
}
|
|
}
|
|
- echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
|
|
|
|
+ echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
|
echo " </td>\n";
|
|
echo " </td>\n";
|
|
echo " </tr>";
|
|
echo " </tr>";
|
|
echo "</table>";
|
|
echo "</table>";
|
|
echo "</form>";
|
|
echo "</form>";
|
|
|
|
|
|
- echo " </td>";
|
|
|
|
- echo " </tr>";
|
|
|
|
- echo "</table>";
|
|
|
|
- echo "</div>";
|
|
|
|
-
|
|
|
|
//include the footer
|
|
//include the footer
|
|
require_once "resources/footer.php";
|
|
require_once "resources/footer.php";
|
|
?>
|
|
?>
|