Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) { //access granted } else { echo "access denied"; exit; } require_once "includes/header.php"; require_once "includes/paging.php"; $order_by = $_GET["order_by"]; $order = $_GET["order"]; echo "
"; echo "\n"; echo "\n"; echo "
\n"; echo "
"; if ($is_included != "true") { echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
Calls
\n"; echo " Use the links to configure call forward follow me, or do no disturb.\n"; echo " The following list the extensions that have been assigned to this user account. \n"; echo "
\n"; echo "
"; } $sql = ""; $sql .= " select * from v_extensions "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and enabled = 'true' "; if (!(if_group("admin") || if_group("superadmin"))) { if (count($_SESSION['user']['extension']) > 0) { $sql .= "and ("; $x = 0; foreach($_SESSION['user']['extension'] as $row) { if ($x > 0) { $sql .= "or "; } $sql .= "extension = '".$row['user']."' "; $x++; } $sql .= ")"; } else { //used to hide any results when a user has not been assigned an extension $sql .= "and extension = 'disabled' "; } } if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } else { $sql .= "order by extension asc "; } $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $num_rows = count($result); unset ($prep_statement, $result, $sql); $rows_per_page = 150; $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; $sql = ""; $sql .= " select * from v_extensions "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and enabled = 'true' "; if (!(if_group("admin") || if_group("superadmin"))) { if (count($_SESSION['user']['extension']) > 0) { $sql .= "and ("; $x = 0; foreach($_SESSION['user']['extension'] as $row) { if ($x > 0) { $sql .= "or "; } $sql .= "extension = '".$row['user']."' "; $x++; } $sql .= ")"; } else { //hide any results when a user has not been assigned an extension $sql .= "and extension = 'disabled' "; } } if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } else { $sql .= "order by extension asc "; } $sql .= " limit $rows_per_page offset $offset "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result_count = count($result); unset ($prep_statement, $sql); $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($result_count == 0) { //no results } else { //received results foreach($result as $row) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } } //end foreach unset($sql, $result, $row_count); } //end if results if (strlen($paging_controls) > 0) { echo "\n"; echo "\n"; echo "\n"; } echo "
ExtensionToolsDescription
".$row[extension]."\n"; if (permission_exists('call_forward')) { echo " Call Forward \n"; echo "   \n"; } if (permission_exists('follow_me')) { echo " Follow Me \n"; echo "   \n"; } if (permission_exists('do_not_disturb')) { echo " Do Not Disturb \n"; } echo " ".$row[description]." 
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $paging_controls
\n"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; if ($is_included != "true") { require_once "includes/footer.php"; } ?>