Add contacts array to provisioning.

This commit is contained in:
Mark Crane 2015-05-18 22:45:31 +00:00
parent c140141ac7
commit 3cba7737bc
1 changed files with 24 additions and 8 deletions

View File

@ -382,6 +382,22 @@ include "root.php";
//create a mac address with back slashes for backwards compatability
$mac_dash = substr($mac, 0,2).'-'.substr($mac, 2,2).'-'.substr($mac, 4,2).'-'.substr($mac, 6,2).'-'.substr($mac, 8,2).'-'.substr($mac, 10,2);
//get the contacts array and add to the template engine
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0) {
//get contacts from the database
$sql = "select * ";
$sql .= "from v_contacts ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "order by contact_organization desc, contact_name_given asc, contact_name_family asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$contacts = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
//assign the contacts array
$view->assign("contacts", $contacts);
}
//get the provisioning information from device lines table
if (strlen($device_uuid) > 0) {
//get the device lines array