From 1581626ebbbb9117249ac426f40e4a4573304a94 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 6 Jun 2018 12:04:14 -0600 Subject: [PATCH] Update contact_phones.php --- app/contacts/contact_phones.php | 84 +++++++++++++++++---------------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/app/contacts/contact_phones.php b/app/contacts/contact_phones.php index 9a2d072445..899f45aaee 100644 --- a/app/contacts/contact_phones.php +++ b/app/contacts/contact_phones.php @@ -17,22 +17,41 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2018 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ -require_once "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -if (permission_exists('contact_phone_view')) { - //access granted -} -else { - echo "access denied"; - exit; -} + +//includes + require_once "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (permission_exists('contact_phone_view')) { + //access granted + } + else { + echo "access denied"; + exit; + } + +//get the contact list + $sql = "select * from v_contact_phones "; + $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "and contact_uuid = '$contact_uuid' "; + $sql .= "order by phone_primary desc, phone_label asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $contact_phones = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset ($prep_statement, $sql); + +//set the row style + $c = 0; + $row_style["0"] = "row_style0"; + $row_style["1"] = "row_style1"; //javascript function: send_cmd echo "