Copyright (C) 2008-2012 All Rights Reserved. Contributor(s): Mark J Crane */ require_once "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; if (permission_exists('device_view')) { //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 " "; echo ""; echo "
\n"; echo "
"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Devices 
\n"; echo "Devices in this list are added to the list when they contact the provisioning \n"; echo "server or added manually by an administrator. \n"; echo "Items in this list are assigned from the extensions page.

\n"; echo "
\n"; $sql = "select * from v_devices "; $sql .= "where domain_uuid = '$domain_uuid' "; if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } $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 = "select * from v_devices "; $sql .= "where domain_uuid = '$domain_uuid' "; if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } $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 th_order_by('device_mac_address', 'MAC Address', $order_by, $order); echo th_order_by('device_template', 'Template', $order_by, $order); echo th_order_by('device_vendor', 'Vendor', $order_by, $order); //echo th_order_by('device_model', 'Model', $order_by, $order); echo th_order_by('device_provision_enable', 'Enabled', $order_by, $order); echo th_order_by('device_description', 'Description', $order_by, $order); echo "\n"; echo "\n"; if ($result_count > 0) { //no results foreach($result as $row) { $device_mac_address = $row[device_mac_address]; $device_mac_address = substr($device_mac_address, 0,2).'-'.substr($device_mac_address, 2,2).'-'.substr($device_mac_address, 4,2).'-'.substr($device_mac_address, 6,2).'-'.substr($device_mac_address, 8,2).'-'.substr($device_mac_address, 10,2); echo "\n"; echo " \n"; echo " \n"; echo " \n"; //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 echo "\n"; echo "\n"; echo "\n"; echo "
\n"; if (permission_exists('device_add')) { echo " $v_link_label_add\n"; } echo "
".$device_mac_address." ".$row['device_template']." ".$row['device_vendor']." ".$row['device_mode'l]." ".$row['device_provision_enable']." ".$row['device_description']." \n"; if (permission_exists('device_edit')) { echo " $v_link_label_edit\n"; } if (permission_exists('device_delete')) { echo " $v_link_label_delete\n"; } echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $paging_controls\n"; if (permission_exists('device_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
"; echo "
"; echo "

"; echo "

"; echo "
"; echo "
"; echo "

"; require_once "includes/footer.php"; ?>