diff --git a/app/contacts/app_config.php b/app/contacts/app_config.php index 5bee8cf65f..273eb2706f 100644 --- a/app/contacts/app_config.php +++ b/app/contacts/app_config.php @@ -116,6 +116,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the role.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'contact_category'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the category.'; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'contact_email'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the email address.'; @@ -132,6 +136,13 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the notes.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'created'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Date when the contact was created.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'created_by'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'The user that created the contact.'; $y = 1; //table array index $apps[$x]['db'][$y]['table'] = 'v_contact_addresses'; @@ -160,6 +171,10 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'contact_uuid'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $z++; + //$apps[$x]['db'][$y]['fields'][$z]['name'] = 'address_name'; + //$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + //$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the address name.'; + //$z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'address_type'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the address type.'; @@ -190,11 +205,15 @@ $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'address_latitude'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the latitude'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the latitude.'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'address_longitude'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the longitude'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the longitude.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'address_description'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.'; $z++; $y = 2; //table array index @@ -236,6 +255,10 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the extension.'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'phone_description'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the description.'; + $z++; $y = 3; //table array index $apps[$x]['db'][$y]['table'] = 'v_contact_notes'; diff --git a/app/contacts/contact_addresses.php b/app/contacts/contact_addresses.php index bd9d5cc610..7fb2d9bd1c 100644 --- a/app/contacts/contact_addresses.php +++ b/app/contacts/contact_addresses.php @@ -104,6 +104,7 @@ require_once "includes/paging.php"; echo "\n"; echo "\n"; + //echo th_order_by('address_name', 'Name', $order_by, $order); echo th_order_by('address_type', 'Type', $order_by, $order); //echo th_order_by('address_street', 'Street Address', $order_by, $order); //echo th_order_by('address_extended', 'Extended Address', $order_by, $order); @@ -114,6 +115,7 @@ require_once "includes/paging.php"; //echo th_order_by('address_latitude', 'Latitude', $order_by, $order); //echo th_order_by('address_longitude', 'Longitude', $order_by, $order); echo "\n"; + echo th_order_by('address_description', 'Description', $order_by, $order); echo "\n"; @@ -123,6 +125,7 @@ require_once "includes/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']; echo "\n"; + //echo " \n"; echo " \n"; //echo " \n"; //echo " \n"; @@ -135,6 +138,7 @@ require_once "includes/paging.php"; echo " \n"; + echo " \n"; echo "
Tools\n"; echo " $v_link_label_add\n"; echo "
".$row['address_name']." ".$row['address_type']." ".$row['address_street']." ".$row['address_extended']." \n"; echo " Map \n"; echo " ".$row['address_description']." \n"; echo " $v_link_label_edit\n"; echo " $v_link_label_delete\n"; diff --git a/app/contacts/contact_addresses_edit.php b/app/contacts/contact_addresses_edit.php index c4ada5025c..8a91cca1d5 100644 --- a/app/contacts/contact_addresses_edit.php +++ b/app/contacts/contact_addresses_edit.php @@ -49,6 +49,7 @@ if (strlen($_GET["contact_uuid"]) > 0) { //get http post variables and set them to php variables if (count($_POST)>0) { + //$address_name = check_str($_POST["address_name"]); $address_type = check_str($_POST["address_type"]); $address_street = check_str($_POST["address_street"]); $address_extended = check_str($_POST["address_extended"]); @@ -58,6 +59,7 @@ if (strlen($_GET["contact_uuid"]) > 0) { $address_country = check_str($_POST["address_country"]); $address_latitude = check_str($_POST["address_latitude"]); $address_longitude = check_str($_POST["address_longitude"]); + $address_description = check_str($_POST["address_description"]); } if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { @@ -100,6 +102,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "domain_uuid, "; $sql .= "contact_uuid, "; $sql .= "contact_address_uuid, "; + //$sql .= "address_name, "; $sql .= "address_type, "; $sql .= "address_street, "; $sql .= "address_extended, "; @@ -108,13 +111,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "address_postal_code, "; $sql .= "address_country, "; $sql .= "address_latitude, "; - $sql .= "address_longitude "; + $sql .= "address_longitude, "; + $sql .= "address_description "; $sql .= ")"; $sql .= "values "; $sql .= "("; $sql .= "'".$_SESSION['domain_uuid']."', "; $sql .= "'$contact_uuid', "; $sql .= "'$contact_address_uuid', "; + //$sql .= "'$address_name', "; $sql .= "'$address_type', "; $sql .= "'$address_street', "; $sql .= "'$address_extended', "; @@ -123,7 +128,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$address_postal_code', "; $sql .= "'$address_country', "; $sql .= "'$address_latitude', "; - $sql .= "'$address_longitude' "; + $sql .= "'$address_longitude', "; + $sql .= "'$address_description' "; $sql .= ")"; $db->exec(check_sql($sql)); unset($sql); @@ -140,6 +146,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update") { $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', "; @@ -148,8 +155,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "address_postal_code = '$address_postal_code', "; $sql .= "address_country = '$address_country', "; $sql .= "address_latitude = '$address_latitude', "; - $sql .= "address_longitude = '$address_longitude' "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."'"; + $sql .= "address_longitude = '$address_longitude', "; + $sql .= "address_description = '$address_description' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and contact_address_uuid = '$contact_address_uuid'"; $db->exec(check_sql($sql)); unset($sql); @@ -168,14 +176,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { $contact_address_uuid = $_GET["id"]; - $sql = ""; - $sql .= "select * from v_contact_addresses "; + $sql = "select * from v_contact_addresses "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and contact_address_uuid = '$contact_address_uuid' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); foreach ($result as &$row) { + //$address_name = $row["address_name"]; $address_type = $row["address_type"]; $address_street = $row["address_street"]; $address_extended = $row["address_extended"]; @@ -185,6 +193,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $address_country = $row["address_country"]; $address_latitude = $row["address_latitude"]; $address_longitude = $row["address_longitude"]; + $address_description = $row["address_description"]; break; //limit to 1 row } unset ($prep_statement); @@ -198,18 +207,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo "
\n"; - echo "
"; + echo "
"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; - if ($action == "add") { - echo "\n"; - } - if ($action == "update") { - echo "\n"; - } + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -220,24 +224,40 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo "\n"; @@ -330,6 +350,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "Enter the longitude\n"; echo "\n"; echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo " \n"; echo " \n"; + echo th_order_by('phone_description', 'Description', $order_by, $order); echo "\n"; @@ -139,6 +140,7 @@ require_once "includes/paging.php"; echo " CDR\n"; echo "  \n"; echo " \n"; + echo " \n"; echo " \n"; - echo "
Contacts Address AddContacts Address EditContact Address
\n"; - echo " Address Type:\n"; + echo " Type:\n"; echo "\n"; - echo " \n"; + echo " \n"; + foreach($_SESSION["contact"]["address_type"] as $row) { + if ($row == $address_type) { + echo " \n"; + } + else { + echo " \n"; + } + } + echo " \n"; } else { - echo " \n"; + echo " \n"; } - if (strtolower($address_type) == "work") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; echo "
\n"; echo "Enter the address type.\n"; echo "
\n"; + echo " Description:\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo "Enter the description.\n"; + echo "
\n"; echo " \n"; diff --git a/app/contacts/contact_phones.php b/app/contacts/contact_phones.php index f4136e8037..0f6c5c16d8 100644 --- a/app/contacts/contact_phones.php +++ b/app/contacts/contact_phones.php @@ -121,6 +121,7 @@ require_once "includes/paging.php"; echo th_order_by('phone_type', 'Type', $order_by, $order); echo th_order_by('phone_number', 'Numbers', $order_by, $order); echo "Tools\n"; echo " $v_link_label_add\n"; echo "".$row['phone_description']." \n"; echo " $v_link_label_edit\n"; echo " $v_link_label_delete\n"; @@ -150,7 +152,7 @@ require_once "includes/paging.php"; } //end if results echo "
\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; diff --git a/app/contacts/contact_phones_edit.php b/app/contacts/contact_phones_edit.php index 6cacc7d1fe..bcf6540aa4 100644 --- a/app/contacts/contact_phones_edit.php +++ b/app/contacts/contact_phones_edit.php @@ -52,6 +52,7 @@ if (strlen($_GET["contact_uuid"]) > 0) { $phone_type = check_str($_POST["phone_type"]); $phone_number = check_str($_POST["phone_number"]); $phone_extension = check_str($_POST["phone_extension"]); + $phone_description = check_str($_POST["phone_description"]); //remove any phone number formatting $phone_number = preg_replace('{\D}', '', $phone_number); @@ -92,7 +93,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "contact_phone_uuid, "; $sql .= "phone_type, "; $sql .= "phone_number, "; - $sql .= "phone_extension "; + $sql .= "phone_extension, "; + $sql .= "phone_description "; $sql .= ")"; $sql .= "values "; $sql .= "("; @@ -101,7 +103,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$contact_phone_uuid', "; $sql .= "'$phone_type', "; $sql .= "'$phone_number', "; - $sql .= "'$phone_extension' "; + $sql .= "'$phone_extension', "; + $sql .= "'$phone_description' "; $sql .= ")"; $db->exec(check_sql($sql)); unset($sql); @@ -120,7 +123,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "contact_uuid = '$contact_uuid', "; $sql .= "phone_type = '$phone_type', "; $sql .= "phone_number = '$phone_number', "; - $sql .= "phone_extension = '$phone_extension' "; + $sql .= "phone_extension = '$phone_extension', "; + $sql .= "phone_description = '$phone_description' "; $sql .= "where domain_uuid = '$domain_uuid'"; $sql .= "and contact_phone_uuid = '$contact_phone_uuid'"; $db->exec(check_sql($sql)); @@ -150,6 +154,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $phone_type = $row["phone_type"]; $phone_number = $row["phone_number"]; $phone_extension = $row["phone_extension"]; + $phone_description = $row["phone_description"]; } unset ($prep_statement); } @@ -168,7 +173,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "
 
\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -179,108 +184,124 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo "\n"; @@ -308,6 +329,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; + //echo " \n"; echo " \n"; //echo " \n"; //echo " \n"; diff --git a/app/contacts/contacts_edit.php b/app/contacts/contacts_edit.php index d32789a58b..2668bbc09b 100644 --- a/app/contacts/contacts_edit.php +++ b/app/contacts/contacts_edit.php @@ -51,6 +51,7 @@ else { $contact_name_family = check_str($_POST["contact_name_family"]); $contact_nickname = check_str($_POST["contact_nickname"]); $contact_title = check_str($_POST["contact_title"]); + $contact_category = check_str($_POST["contact_category"]); $contact_role = check_str($_POST["contact_role"]); $contact_email = check_str($_POST["contact_email"]); $contact_url = check_str($_POST["contact_url"]); @@ -74,10 +75,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //if (strlen($contact_nickname) == 0) { $msg .= "Please provide: Nickname
\n"; } //if (strlen($contact_title) == 0) { $msg .= "Please provide: Title
\n"; } //if (strlen($contact_role) == 0) { $msg .= "Please provide: Role
\n"; } - //if (strlen($) == 0) { $msg .= "Please provide: Contact Information
\n"; } //if (strlen($contact_email) == 0) { $msg .= "Please provide: Email
\n"; } //if (strlen($contact_url) == 0) { $msg .= "Please provide: URL
\n"; } - //if (strlen($) == 0) { $msg .= "Please provide: Additional Information
\n"; } //if (strlen($contact_time_zone) == 0) { $msg .= "Please provide: Time Zone
\n"; } //if (strlen($contact_note) == 0) { $msg .= "Please provide: Notes
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { @@ -107,6 +106,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "contact_name_family, "; $sql .= "contact_nickname, "; $sql .= "contact_title, "; + $sql .= "contact_category, "; $sql .= "contact_role, "; $sql .= "contact_email, "; $sql .= "contact_url, "; @@ -123,6 +123,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$contact_name_family', "; $sql .= "'$contact_nickname', "; $sql .= "'$contact_title', "; + $sql .= "'$contact_category', "; $sql .= "'$contact_role', "; $sql .= "'$contact_email', "; $sql .= "'$contact_url', "; @@ -149,6 +150,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "contact_name_family = '$contact_name_family', "; $sql .= "contact_nickname = '$contact_nickname', "; $sql .= "contact_title = '$contact_title', "; + $sql .= "contact_category = '$contact_category', "; $sql .= "contact_role = '$contact_role', "; $sql .= "contact_email = '$contact_email', "; $sql .= "contact_url = '$contact_url', "; @@ -173,8 +175,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //pre-populate the form if (count($_GET)>0 && $_POST["persistformvar"] != "true") { $contact_uuid = $_GET["id"]; - $sql = ""; - $sql .= "select * from v_contacts "; + $sql = "select * from v_contacts "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and contact_uuid = '$contact_uuid' "; $prep_statement = $db->prepare(check_sql($sql)); @@ -187,6 +188,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $contact_name_family = $row["contact_name_family"]; $contact_nickname = $row["contact_nickname"]; $contact_title = $row["contact_title"]; + $contact_category = $row["contact_category"]; $contact_role = $row["contact_role"]; $contact_email = $row["contact_email"]; $contact_url = $row["contact_url"]; @@ -210,12 +212,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
\n"; echo "
Contacts PhoneContact Phone
\n"; - echo " Type.:\n"; + echo " Type:\n"; echo "\n"; - echo " \n"; + echo " \n"; + foreach($_SESSION["contact"]["phone_type"] as $row) { + if ($row == $phone_type) { + echo " \n"; + } + else { + echo " \n"; + } + } + echo " \n"; } else { - echo " \n"; + echo " \n"; } - if ($phone_type == "work") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "pref") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "voice") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "fax") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "msg") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "cell") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "pager") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "bbs") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "modem") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "car") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "isdn") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "video") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "pcs") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "iana-token") { - echo " \n"; - } - else { - echo " \n"; - } - if ($phone_type == "x-name") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; echo "
\n"; echo "Enter the phone type.\n"; echo "
\n"; + echo " Description:\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo "Enter the description.\n"; + echo "
\n"; echo " \n"; diff --git a/app/contacts/contacts.php b/app/contacts/contacts.php index dc6ee69ad5..74308b3a63 100644 --- a/app/contacts/contacts.php +++ b/app/contacts/contacts.php @@ -87,6 +87,7 @@ require_once "includes/paging.php"; $sql .= " contact_name_family like '%".$search_all."%' or \n"; $sql .= " contact_nickname like '%".$search_all."%' or \n"; $sql .= " contact_title like '%".$search_all."%' or \n"; + $sql .= " contact_category like '%".$search_all."%' or \n"; $sql .= " contact_role like '%".$search_all."%' or \n"; $sql .= " contact_email like '%".$search_all."%' or \n"; $sql .= " contact_url like '%".$search_all."%' or \n"; @@ -111,7 +112,7 @@ require_once "includes/paging.php"; } //prepare to page the results - $rows_per_page = 30; + $rows_per_page = 150; $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } @@ -134,6 +135,7 @@ require_once "includes/paging.php"; $sql .= " contact_name_family like '%".$search_all."%' or \n"; $sql .= " contact_nickname like '%".$search_all."%' or \n"; $sql .= " contact_title like '%".$search_all."%' or \n"; + $sql .= " contact_category like '%".$search_all."%' or \n"; $sql .= " contact_role like '%".$search_all."%' or \n"; $sql .= " contact_email like '%".$search_all."%' or \n"; $sql .= " contact_url like '%".$search_all."%' or \n"; @@ -165,6 +167,7 @@ require_once "includes/paging.php"; echo th_order_by('contact_name_family', 'Last Name', $order_by, $order); echo th_order_by('contact_nickname', 'Nickname', $order_by, $order); echo th_order_by('contact_title', 'Title', $order_by, $order); + //echo th_order_by('contact_category', 'Category', $order_by, $order); echo th_order_by('contact_role', 'Role', $order_by, $order); //echo th_order_by('contact_email', 'Email', $order_by, $order); //echo th_order_by('contact_url', 'URL', $order_by, $order); @@ -184,6 +187,7 @@ require_once "includes/paging.php"; echo " ".$row['contact_name_family']." ".$row['contact_nickname']." ".$row['contact_title']." ".$row['contact_category']." ".$row['contact_role']." ".$row['contact_email']." ".$row['contact_url']." 
\n"; echo "\n"; - if ($action == "add") { - echo "\n"; - } - if ($action == "update") { - echo "\n"; - } + echo "\n"; echo "\n"; echo "\n"; @@ -371,18 +385,77 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " Title:\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -459,7 +532,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { require "contact_phones.php"; require "contact_addresses.php"; require "contact_notes.php"; - //echo "

\n"; } echo "\n";
Contact AddContact EditContact\n"; echo " \n"; echo " \n"; @@ -248,75 +245,92 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " Type:\n"; echo "\n"; - echo " \n"; + echo " \n"; + foreach($_SESSION["contact"]["type"] as $row) { + if ($row == $contact_type) { + echo " \n"; + } + else { + echo " \n"; + } + } + echo " \n"; } else { - echo " \n"; + echo " \n"; } - if ($contact_type == "contractor") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "friend") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "lead") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "member") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "family") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "subscriber") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "supplier") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "provider") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "user") { - echo " \n"; - } - else { - echo " \n"; - } - if ($contact_type == "volunteer") { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; echo "
\n"; echo "Select the contact type.\n"; echo "
\n"; - echo " \n"; + if (is_array($_SESSION["contact"]["title"])) { + sort($_SESSION["contact"]["title"]); + echo " \n"; + } + else { + echo " \n"; + } echo "
\n"; echo "Enter the title.\n"; echo "
\n"; + echo " Category:\n"; + echo "\n"; + if (is_array($_SESSION["contact"]["category"])) { + sort($_SESSION["contact"]["category"]); + echo " \n"; + } + else { + echo " \n"; + } + echo "
\n"; + echo "Enter the category.\n"; + echo "
\n"; echo " Role:\n"; echo "\n"; - echo " \n"; + if (is_array($_SESSION["contact"]["role"])) { + sort($_SESSION["contact"]["role"]); + echo " \n"; + } + else { + echo " \n"; + } echo "
\n"; echo "Enter the role.\n"; echo "