|
@@ -32,20 +32,20 @@ require_once 'functions.php';
|
|
|
$dsn = "$db_driver:host=$db_host;dbname=$db_name";
|
|
|
|
|
|
$options = [
|
|
|
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
|
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
|
- PDO::ATTR_EMULATE_PREPARES => false,
|
|
|
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
|
+ PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
|
+ PDO::ATTR_EMULATE_PREPARES => false,
|
|
|
];
|
|
|
|
|
|
try {
|
|
|
- $dbh = new PDO($dsn, $db_user, $db_pass, $options);
|
|
|
+ $dbh = new PDO($dsn, $db_user, $db_pass, $options);
|
|
|
} catch (PDOException $e) {
|
|
|
- die($e->getMessage());
|
|
|
+ die($e->getMessage());
|
|
|
}
|
|
|
|
|
|
-$logger = Log::singleton('file', LOGFILE, TOOL_NAME.' : Physical Switches');
|
|
|
+$logger = Log::singleton('file', LOGFILE, TOOL_NAME . ' : Physical Switches');
|
|
|
if ($logger === false) {
|
|
|
- die("Failed to open logfile.\n");
|
|
|
+ die("Failed to open logfile.\n");
|
|
|
}
|
|
|
$mask = Log::UPTO(LOG_LEVEL);
|
|
|
$logger->setMask($mask);
|
|
@@ -53,207 +53,208 @@ $logger->setMask($mask);
|
|
|
$base = get_base($_SERVER['SCRIPT_NAME']);
|
|
|
$ruser = '<AUTHENTICATION NOT ENABLED>';
|
|
|
if (isset($_SERVER['REMOTE_USER'])) {
|
|
|
- $ruser = $_SERVER['REMOTE_USER'];
|
|
|
+ $ruser = $_SERVER['REMOTE_USER'];
|
|
|
}
|
|
|
|
|
|
$errors = array();
|
|
|
if (isset($_REQUEST['prev_checked'])) {
|
|
|
- $pc = $_REQUEST['prev_checked'];
|
|
|
- $pas = $_REQUEST['prev_assigned_switch'];
|
|
|
- $c = (isset($_REQUEST['checked'])) ? $_REQUEST['checked'] : array();
|
|
|
- $as = $_REQUEST['assigned_switch'];
|
|
|
- $d = (isset($_REQUEST['delete'])) ? $_REQUEST['delete'] : array();
|
|
|
- $rz = (isset($_REQUEST['reztp'])) ? $_REQUEST['reztp'] : array();
|
|
|
- foreach ($pc as $swsn => $value) {
|
|
|
- $curr_del = (isset($d[$swsn])) ? $d[$swsn] : 0;
|
|
|
- $curr_rz = (isset($rz[$swsn])) ? $rz[$swsn] : 0;
|
|
|
- if ($curr_del == 1) {
|
|
|
- $sql = "DELETE FROM DEVICE_MAP WHERE serial_number=:sn";
|
|
|
- try {
|
|
|
- $sth = $dbh->prepare($sql);
|
|
|
- $sth->execute(['sn' => $swsn]);
|
|
|
- $sth->closeCursor();
|
|
|
- $logger->info("User {$ruser} deleted physical switch {$swsn}");
|
|
|
- } catch (PDOException $e) {
|
|
|
- array_push($errors, "Failed to delete switch {$swsn}: {$e->getMessage()}");
|
|
|
- }
|
|
|
- continue;
|
|
|
- }
|
|
|
- if ($curr_rz == 1) {
|
|
|
- $sql = "UPDATE DEVICE_MAP SET should_re_ztp=:rz WHERE serial_number=:sn";
|
|
|
- try {
|
|
|
- $sth = $dbh->prepare($sql);
|
|
|
- $sth->execute(['sn' => $swsn, 'rz' => 2]);
|
|
|
- $sth->closeCursor();
|
|
|
- $logger->info("User {$ruser} set physical switch {$swsn} to re-ZTP");
|
|
|
- } catch (PDOException $e) {
|
|
|
- array_push($errors, "Failed to set switch {$swsn} to re-ZTP: {$e->getMessage()}");
|
|
|
- }
|
|
|
+ $pc = $_REQUEST['prev_checked'];
|
|
|
+ $pas = $_REQUEST['prev_assigned_switch'];
|
|
|
+ $c = (isset($_REQUEST['checked'])) ? $_REQUEST['checked'] : array();
|
|
|
+ $as = $_REQUEST['assigned_switch'];
|
|
|
+ $d = (isset($_REQUEST['delete'])) ? $_REQUEST['delete'] : array();
|
|
|
+ $rz = (isset($_REQUEST['reztp'])) ? $_REQUEST['reztp'] : array();
|
|
|
+ foreach ($pc as $swsn => $value) {
|
|
|
+ $curr_del = (isset($d[$swsn])) ? $d[$swsn] : 0;
|
|
|
+ $curr_rz = (isset($rz[$swsn])) ? $rz[$swsn] : 0;
|
|
|
+ if ($curr_del == 1) {
|
|
|
+ $sql = "DELETE FROM DEVICE_MAP WHERE serial_number=:sn";
|
|
|
+ try {
|
|
|
+ $sth = $dbh->prepare($sql);
|
|
|
+ $sth->execute(['sn' => $swsn]);
|
|
|
+ $sth->closeCursor();
|
|
|
+ $logger->info("User {$ruser} deleted physical switch {$swsn}");
|
|
|
+ } catch (PDOException $e) {
|
|
|
+ array_push($errors, "Failed to delete switch {$swsn}: {$e->getMessage()}");
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if ($curr_rz == 1) {
|
|
|
+ $sql = "UPDATE DEVICE_MAP SET should_re_ztp=:rz WHERE serial_number=:sn";
|
|
|
+ try {
|
|
|
+ $sth = $dbh->prepare($sql);
|
|
|
+ $sth->execute(['sn' => $swsn, 'rz' => 2]);
|
|
|
+ $sth->closeCursor();
|
|
|
+ $logger->info("User {$ruser} set physical switch {$swsn} to re-ZTP");
|
|
|
+ } catch (PDOException $e) {
|
|
|
+ array_push($errors, "Failed to set switch {$swsn} to re-ZTP: {$e->getMessage()}");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $curr_checked = (isset($c[$swsn])) ? $c[$swsn] : 0;
|
|
|
+ if ($value != $curr_checked || $pas[$swsn] != $as[$swsn]) {
|
|
|
+ $nc = $curr_checked;
|
|
|
+ $additional = '';
|
|
|
+ if ($nc == 1 && $as == '__BOGUS__') {
|
|
|
+ array_push($errors, "You must select a logical switch assignment for $swsn");
|
|
|
+ } else {
|
|
|
+ if ($nc == 0 || $as == '__BOGUS__') {
|
|
|
+ $nas = 'NULL';
|
|
|
+ $additional = ", provisioned_status = '" . PROVISION_UNKNOWN . "', device_status = '" . REACHABILITY_NEVER_REACHABLE . "'";
|
|
|
+ } else {
|
|
|
+ $nas = "'{$as[$swsn]}'";
|
|
|
}
|
|
|
- $curr_checked = (isset($c[$swsn])) ? $c[$swsn] : 0;
|
|
|
- if ($value != $curr_checked || $pas[$swsn] != $as[$swsn]) {
|
|
|
- $nc = $curr_checked;
|
|
|
- $additional = '';
|
|
|
- if ($nc == 1 && $as == '__BOGUS__') {
|
|
|
- array_push($errors, "You must select a logical switch assignment for $swsn");
|
|
|
- } else {
|
|
|
- if ($nc == 0 || $as == '__BOGUS__') {
|
|
|
- $nas = 'NULL';
|
|
|
- $additional = ", provisioned_status = '".PROVISION_UNKNOWN."', device_status = '".REACHABILITY_NEVER_REACHABLE."'";
|
|
|
- } else {
|
|
|
- $nas = "'{$as[$swsn]}'";
|
|
|
- }
|
|
|
- $sql = "UPDATE DEVICE_MAP SET checked_out='{$nc}', assigned_switch = {$nas} {$additional} WHERE serial_number='{$swsn}'";
|
|
|
- try {
|
|
|
- $dbh->query($sql);
|
|
|
- $logger->info("User {$ruser} updated physical switches, checked_out={$nc}, assigned_switch={$nas} for serial_number={$swsn}");
|
|
|
- } catch (PDOException $e) {
|
|
|
- array_push($errors, "Failed to update $swsn: '{$e->getMessage()}'");
|
|
|
- }
|
|
|
- }
|
|
|
+ $sql = "UPDATE DEVICE_MAP SET checked_out='{$nc}', assigned_switch = {$nas} {$additional} WHERE serial_number='{$swsn}'";
|
|
|
+ try {
|
|
|
+ $dbh->query($sql);
|
|
|
+ $logger->info("User {$ruser} updated physical switches, checked_out={$nc}, assigned_switch={$nas} for serial_number={$swsn}");
|
|
|
+ } catch (PDOException $e) {
|
|
|
+ array_push($errors, "Failed to update $swsn: '{$e->getMessage()}'");
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$wc = '';
|
|
|
if (isset($_REQUEST['filter'])) {
|
|
|
- switch ($_REQUEST['filter']) {
|
|
|
+ switch ($_REQUEST['filter']) {
|
|
|
case 'a':
|
|
|
- $wc = '';
|
|
|
- break;
|
|
|
+ $wc = '';
|
|
|
+ break;
|
|
|
case 'p':
|
|
|
- $wc = 'WHERE assigned_switch IS NOT NULL';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE assigned_switch IS NOT NULL';
|
|
|
+ break;
|
|
|
case 'up':
|
|
|
- $wc = 'WHERE assigned_switch IS NULL';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE assigned_switch IS NULL';
|
|
|
+ break;
|
|
|
case 'vu':
|
|
|
- $wc = 'WHERE provisioned_status=\''.PROVISION_UNKNOWN.'\'';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE provisioned_status=\'' . PROVISION_UNKNOWN . '\'';
|
|
|
+ break;
|
|
|
case 'vi':
|
|
|
- $wc = 'WHERE provisioned_status=\''.PROVISION_IN_PROGRESS.'\'';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE provisioned_status=\'' . PROVISION_IN_PROGRESS . '\'';
|
|
|
+ break;
|
|
|
case 'vf':
|
|
|
- $wc = 'WHERE provisioned_status=\''.PROVISION_FAIL.'\'';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE provisioned_status=\'' . PROVISION_FAIL . '\'';
|
|
|
+ break;
|
|
|
case 'vs':
|
|
|
- $wc = 'WHERE provisioned_status=\''.PROVISION_SUCCESS.'\'';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE provisioned_status=\'' . PROVISION_SUCCESS . '\'';
|
|
|
+ break;
|
|
|
case 'r':
|
|
|
- $wc = 'WHERE device_status=\''.REACHABILITY_REACHABLE.'\'';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE device_status=\'' . REACHABILITY_REACHABLE . '\'';
|
|
|
+ break;
|
|
|
case 'ur':
|
|
|
- $wc = 'WHERE provisioned_status=\''.PROVISION_SUCCESS.'\' AND (device_status=\''.REACHABILITY_NEVER_REACHABLE.'\' OR device_status=\''.REACHABILITY_NOW_UNREACHABLE.'\')';
|
|
|
- break;
|
|
|
+ $wc = 'WHERE provisioned_status=\'' . PROVISION_SUCCESS . '\' AND (device_status=\'' . REACHABILITY_NEVER_REACHABLE . '\' OR device_status=\'' . REACHABILITY_NOW_UNREACHABLE . '\')';
|
|
|
+ break;
|
|
|
default:
|
|
|
- if (preg_match("/^pid:([\w\d-]+)/", $_REQUEST['filter'], $match)) {
|
|
|
- $wc = "WHERE pid = '{$match[1]}'";
|
|
|
- } else {
|
|
|
- $wc = '';
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (preg_match("/^pid:([\w\d-]+)/", $_REQUEST['filter'], $match)) {
|
|
|
+ $wc = "WHERE pid = '{$match[1]}'";
|
|
|
+ } else {
|
|
|
+ $wc = '';
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$res = null;
|
|
|
if (isset($_REQUEST['switch_name'])) {
|
|
|
- $sql = "SELECT * FROM DEVICE_MAP WHERE serial_number LIKE :swname1 OR assigned_switch LIKE :swname2 ORDER BY LPAD(lower(serial_number), 10, 0)";
|
|
|
- try {
|
|
|
- $res = $dbh->prepare($sql);
|
|
|
- $res->execute(['swname1' => "%{$_REQUEST['switch_name']}%", 'swname2' => "%{$_REQUEST['switch_name']}%"]);
|
|
|
- } catch (PDOException $e) {
|
|
|
- echo "<p><font color=\"red\">Error querying for physical switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
- exit(1);
|
|
|
- }
|
|
|
+ $sql = "SELECT * FROM DEVICE_MAP WHERE serial_number LIKE :swname1 OR assigned_switch LIKE :swname2 ORDER BY LPAD(lower(serial_number), 10, 0)";
|
|
|
+ try {
|
|
|
+ $res = $dbh->prepare($sql);
|
|
|
+ $res->execute(['swname1' => "%{$_REQUEST['switch_name']}%", 'swname2' => "%{$_REQUEST['switch_name']}%"]);
|
|
|
+ } catch (PDOException $e) {
|
|
|
+ echo "<p><font color=\"red\">Error querying for physical switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
+ exit(1);
|
|
|
+ }
|
|
|
} else {
|
|
|
- $sql = 'SELECT * FROM DEVICE_MAP '.$wc.' ORDER BY LPAD(lower(serial_number), 10, 0)';
|
|
|
- try {
|
|
|
- $res = $dbh->query($sql);
|
|
|
- } catch (PDOException $e) {
|
|
|
- echo "<p><font color=\"red\">Error querying for physical switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
- exit(1);
|
|
|
- }
|
|
|
+ $sql = 'SELECT * FROM DEVICE_MAP ' . $wc . ' ORDER BY LPAD(lower(serial_number), 10, 0)';
|
|
|
+ try {
|
|
|
+ $res = $dbh->query($sql);
|
|
|
+ } catch (PDOException $e) {
|
|
|
+ echo "<p><font color=\"red\">Error querying for physical switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
+ exit(1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$sql = 'SELECT name, pid FROM SWITCHES WHERE ip_address IS NOT NULL ORDER BY name';
|
|
|
$ls_res = null;
|
|
|
try {
|
|
|
- $ls_res = $dbh->query($sql);
|
|
|
+ $ls_res = $dbh->query($sql);
|
|
|
} catch (PDOException $e) {
|
|
|
- echo "<p><font color=\"red\">Error querying for logical switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
- exit(1);
|
|
|
+ echo "<p><font color=\"red\">Error querying for logical switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
+ exit(1);
|
|
|
}
|
|
|
|
|
|
$lswitches = array();
|
|
|
while ($row = $ls_res->fetch()) {
|
|
|
- if (!isset($lswitches[$row['pid']])) {
|
|
|
- $lswitches[$row['pid']] = array('__BOGUS__', $row['name']);
|
|
|
- } else {
|
|
|
- array_push($lswitches[$row['pid']], $row['name']);
|
|
|
- }
|
|
|
+ if (!isset($lswitches[$row['pid']])) {
|
|
|
+ $lswitches[$row['pid']] = array('__BOGUS__', $row['name']);
|
|
|
+ } else {
|
|
|
+ array_push($lswitches[$row['pid']], $row['name']);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$switches = array();
|
|
|
while ($row = $res->fetch()) {
|
|
|
- array_push($switches, $row);
|
|
|
+ array_push($switches, $row);
|
|
|
}
|
|
|
|
|
|
$sql = 'SELECT DISTINCT(pid) AS pid FROM DEVICE_MAP';
|
|
|
try {
|
|
|
- $res = $dbh->query($sql);
|
|
|
+ $res = $dbh->query($sql);
|
|
|
} catch (PDOException $e) {
|
|
|
- echo "<p><font color=\"red\">Error querying for PIDs: {$e->getMessage()}</font></p>\r\n";
|
|
|
- exit(1);
|
|
|
+ echo "<p><font color=\"red\">Error querying for PIDs: {$e->getMessage()}</font></p>\r\n";
|
|
|
+ exit(1);
|
|
|
}
|
|
|
|
|
|
$pids = array();
|
|
|
while ($row = $res->fetch()) {
|
|
|
- $pids[$row['pid']] = true;
|
|
|
+ $pids[$row['pid']] = true;
|
|
|
}
|
|
|
|
|
|
$sql = 'SELECT assigned_switch FROM DEVICE_MAP WHERE assigned_switch IS NOT NULL';
|
|
|
try {
|
|
|
- $res = $dbh->query($sql);
|
|
|
+ $res = $dbh->query($sql);
|
|
|
} catch (PDOException $e) {
|
|
|
- echo "<p><font color=\"red\">Error querying for assigned switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
- exit(1);
|
|
|
+ echo "<p><font color=\"red\">Error querying for assigned switches: {$e->getMessage()}</font></p>\r\n";
|
|
|
+ exit(1);
|
|
|
}
|
|
|
|
|
|
$used = array();
|
|
|
while ($row = $res->fetch()) {
|
|
|
- $used[$row['assigned_switch']] = true;
|
|
|
+ $used[$row['assigned_switch']] = true;
|
|
|
}
|
|
|
|
|
|
$filt = null;
|
|
|
if (!isset($_REQUEST['filter'])) {
|
|
|
- $filt = '';
|
|
|
+ $filt = '';
|
|
|
} else {
|
|
|
- $filt = $_REQUEST['filter'];
|
|
|
+ $filt = $_REQUEST['filter'];
|
|
|
}
|
|
|
|
|
|
-print_header(TOOL_NAME.': Physical Switches');
|
|
|
+print_header(TOOL_NAME . ': Physical Switches');
|
|
|
?>
|
|
|
- <body class="flex">
|
|
|
- <script language="javascript">
|
|
|
+
|
|
|
+<body class="flex">
|
|
|
+ <script language="javascript">
|
|
|
var deletes = 0;
|
|
|
|
|
|
- var PROVISION_UNKNOWN = <?=PROVISION_UNKNOWN?>;
|
|
|
- var PROVISION_IN_PROGRESS = <?=PROVISION_IN_PROGRESS?>;
|
|
|
- var PROVISION_FAIL = <?=PROVISION_FAIL?>;
|
|
|
- var PROVISION_SUCCESS = <?=PROVISION_SUCCESS?>;
|
|
|
+ var PROVISION_UNKNOWN = <?= PROVISION_UNKNOWN ?>;
|
|
|
+ var PROVISION_IN_PROGRESS = <?= PROVISION_IN_PROGRESS ?>;
|
|
|
+ var PROVISION_FAIL = <?= PROVISION_FAIL ?>;
|
|
|
+ var PROVISION_SUCCESS = <?= PROVISION_SUCCESS ?>;
|
|
|
|
|
|
- var REACHABILITY_NEVER_REACHABLE = <?=REACHABILITY_NEVER_REACHABLE?>;
|
|
|
- var REACHABILITY_NOW_UNREACHABLE = <?=REACHABILITY_NOW_UNREACHABLE?>;
|
|
|
- var REACHABILITY_REACHABLE = <?=REACHABILITY_REACHABLE?>;
|
|
|
+ var REACHABILITY_NEVER_REACHABLE = <?= REACHABILITY_NEVER_REACHABLE ?>;
|
|
|
+ var REACHABILITY_NOW_UNREACHABLE = <?= REACHABILITY_NOW_UNREACHABLE ?>;
|
|
|
+ var REACHABILITY_REACHABLE = <?= REACHABILITY_REACHABLE ?>;
|
|
|
|
|
|
var row_intervals = {};
|
|
|
|
|
|
function refresh() {
|
|
|
$.ajax({
|
|
|
- url: '<?=$base?>/get_dev_stats.php',
|
|
|
+ url: '<?= $base ?>/get_dev_stats.php',
|
|
|
dataType: 'json',
|
|
|
- success: function(data) {
|
|
|
- $.each(data.response, function(k, v) {
|
|
|
+ success: function (data) {
|
|
|
+ $.each(data.response, function (k, v) {
|
|
|
var rtext = ' ';
|
|
|
var color = '#FFFFFF';
|
|
|
var rtitle = 'Not yet assigned';
|
|
@@ -295,7 +296,7 @@ print_header(TOOL_NAME.': Physical Switches');
|
|
|
clearInterval(row_intervals[k]);
|
|
|
$('#psr_' + k).stop(true, true);
|
|
|
}
|
|
|
- var pulseint = setInterval(function() {
|
|
|
+ var pulseint = setInterval(function () {
|
|
|
$('#psr_' + k).animate({
|
|
|
backgroundColor: '#919191',
|
|
|
}, 1000).animate({
|
|
@@ -330,58 +331,58 @@ print_header(TOOL_NAME.': Physical Switches');
|
|
|
$('#dsr_' + k).attr('title', rtitle);
|
|
|
});
|
|
|
},
|
|
|
- complete: function(xhr, message) {
|
|
|
+ complete: function (xhr, message) {
|
|
|
setTimeout(refresh, 30000);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function reztp_all() {
|
|
|
- if ($('#reztp_all_box').is(':checked')) {
|
|
|
- $('.reztp').each(function() {
|
|
|
- $(this).prop('checked', true);
|
|
|
- });
|
|
|
- } else {
|
|
|
- $('.reztp').each(function() {
|
|
|
- $(this).prop('checked', false);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ if ($('#reztp_all_box').is(':checked')) {
|
|
|
+ $('.reztp').each(function () {
|
|
|
+ $(this).prop('checked', true);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $('.reztp').each(function () {
|
|
|
+ $(this).prop('checked', false);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
function toggle_reztp_all(elem) {
|
|
|
- if (!$(elem).is(':checked')) {
|
|
|
- $('#reztp_all_box').prop('checked', false);
|
|
|
- }
|
|
|
+ if (!$(elem).is(':checked')) {
|
|
|
+ $('#reztp_all_box').prop('checked', false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function check_confirm() {
|
|
|
- var delete_conf = true;
|
|
|
- var reztp_conf = true;
|
|
|
- if (deletes > 0) {
|
|
|
- delete_conf = confirm("Are you sure you want to delete these " + deletes + " physical switch(es)?");
|
|
|
- }
|
|
|
-
|
|
|
- $('.reztp').each(function() {
|
|
|
- if ($(this).is(':checked')) {
|
|
|
- one_checked = true;
|
|
|
- return;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- if (one_checked) {
|
|
|
- reztp_conf = confirm("Are you sure you want to re-ZTP these switches?");
|
|
|
- }
|
|
|
-
|
|
|
- return reztp_conf && delete_conf;
|
|
|
+ var delete_conf = true;
|
|
|
+ var reztp_conf = true;
|
|
|
+ if (deletes > 0) {
|
|
|
+ delete_conf = confirm("Are you sure you want to delete these " + deletes + " physical switch(es)?");
|
|
|
+ }
|
|
|
+
|
|
|
+ $('.reztp').each(function () {
|
|
|
+ if ($(this).is(':checked')) {
|
|
|
+ one_checked = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (one_checked) {
|
|
|
+ reztp_conf = confirm("Are you sure you want to re-ZTP these switches?");
|
|
|
+ }
|
|
|
+
|
|
|
+ return reztp_conf && delete_conf;
|
|
|
}
|
|
|
|
|
|
- if ( window.history.replaceState ) {
|
|
|
- window.history.replaceState( null, null, window.location.href );
|
|
|
+ if (window.history.replaceState) {
|
|
|
+ window.history.replaceState(null, null, window.location.href);
|
|
|
}
|
|
|
|
|
|
- $(document).ready(function() {
|
|
|
+ $(document).ready(function () {
|
|
|
$('#devtable').DataTable({
|
|
|
"scrollY": "400px",
|
|
|
"scrollCollapse": true,
|
|
@@ -389,190 +390,235 @@ print_header(TOOL_NAME.': Physical Switches');
|
|
|
});
|
|
|
refresh();
|
|
|
});
|
|
|
- </script>
|
|
|
- <div id="headswreg">
|
|
|
- <div class="apage">
|
|
|
- <div id="header">
|
|
|
- <h1><?=TOOL_NAME?>: Physical Switches</h1>
|
|
|
- </div>
|
|
|
- <br/>
|
|
|
+ </script>
|
|
|
+ <div id="headswreg">
|
|
|
+ <div class="apage">
|
|
|
+ <div id="header">
|
|
|
+ <h1>
|
|
|
+ <?= TOOL_NAME ?>: Physical Switches
|
|
|
+ </h1>
|
|
|
</div>
|
|
|
+ <br />
|
|
|
</div>
|
|
|
- <div class="apage">
|
|
|
- <form method="POST" name="search_form" action="<?=$_SERVER['PHP_SELF']?>">
|
|
|
- <table class="noborder" summary="Filter Table">
|
|
|
- <tr>
|
|
|
- <td class="left_act">Show Only:
|
|
|
- <select name="filter" onChange="MM_jumpMenu('parent', this, 0)">
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=a" <?=($filt == 'a') ? 'selected' : ''?>>All</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=p" <?=($filt == 'p') ? 'selected' : ''?>>Assigned</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=up" <?=($filt == 'up') ? 'selected' : ''?>>Unassigned</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=vu" <?=($filt == 'vu') ? 'selected' : ''?>>Not Yet Bootstrapped</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=vi" <?=($filt == 'vi') ? 'selected' : ''?>>Bootstrapping In Progress</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=vf" <?=($filt == 'vf') ? 'selected' : ''?>>Verification Failed</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=vs" <?=($filt == 'vs') ? 'selected' : ''?>>Verification Succeeded</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=r" <?=($filt == 'r') ? 'selected' : ''?>>Reachable</option>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=ur" <?=($filt == 'ur') ? 'selected' : ''?>>Unreachable</option>
|
|
|
-<?php
|
|
|
-foreach ($pids as $lsp => $value) {
|
|
|
- $selected = ($filt == "pid:$lsp") ? 'selected' : ''; ?>
|
|
|
- <option value="<?=$_SERVER['PHP_SELF']?>?filter=pid:<?=$lsp?>" <?=$selected?>><?=$lsp?></option>
|
|
|
-<?php
|
|
|
-}
|
|
|
-?>
|
|
|
- </select></td>
|
|
|
- <td class="right">Switch Search:
|
|
|
- <input type="text" size="16" name="switch_name" value="<?=(isset($_REQUEST['switch_name'])) ? $_REQUEST['switch_name'] : ''?>">
|
|
|
- <input type="image" value="Submit" name="search" src="/images/submit_button.png">
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </form>
|
|
|
- <br/>
|
|
|
- <table class="noborder" summary="Control Table">
|
|
|
+ </div>
|
|
|
+ <div class="apage">
|
|
|
+ <form method="POST" name="search_form" action="<?= $_SERVER['PHP_SELF'] ?>">
|
|
|
+ <table class="noborder" summary="Filter Table">
|
|
|
<tr>
|
|
|
- <td class="left"><a href="<?=$base?>/add_phys.php">Add Physical Switch</a> |
|
|
|
- <?php
|
|
|
- if (EXPORT_PRIME === true) {
|
|
|
- ?>
|
|
|
- <a href="#" onClick="window.open('<?=$base?>/export.php')">Export to Prime / DNS</a> |
|
|
|
- <?php
|
|
|
- }
|
|
|
- if (EXPORT_DEADMAN === true) {
|
|
|
- ?>
|
|
|
- <a href="#" onClick="window.open('<?=$base?>/export_deadman.php')">Export To Ansible</a> |
|
|
|
- <?php
|
|
|
- } ?>
|
|
|
- <a href="<?=$base?>/logicsw.php">Logical Switches</a></td>
|
|
|
+ <td class="left_act">Show Only:
|
|
|
+ <select name="filter" onChange="MM_jumpMenu('parent', this, 0)">
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=a" <?= ($filt == 'a') ? 'selected' : '' ?>>All</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=p" <?= ($filt == 'p') ? 'selected' : '' ?>>Assigned</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=up" <?= ($filt == 'up') ? 'selected' : '' ?>>Unassigned
|
|
|
+ </option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=vu" <?= ($filt == 'vu') ? 'selected' : '' ?>>Not Yet
|
|
|
+ Bootstrapped</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=vi" <?= ($filt == 'vi') ? 'selected' : '' ?>>Bootstrapping In
|
|
|
+ Progress</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=vf" <?= ($filt == 'vf') ? 'selected' : '' ?>>Verification
|
|
|
+ Failed</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=vs" <?= ($filt == 'vs') ? 'selected' : '' ?>>Verification
|
|
|
+ Succeeded</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=r" <?= ($filt == 'r') ? 'selected' : '' ?>>Reachable</option>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=ur" <?= ($filt == 'ur') ? 'selected' : '' ?>>Unreachable
|
|
|
+ </option>
|
|
|
+ <?php
|
|
|
+ foreach ($pids as $lsp => $value) {
|
|
|
+ $selected = ($filt == "pid:$lsp") ? 'selected' : ''; ?>
|
|
|
+ <option value="<?= $_SERVER['PHP_SELF'] ?>?filter=pid:<?= $lsp ?>" <?= $selected ?>><?= $lsp ?></option>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <td class="right">Switch Search:
|
|
|
+ <input type="text" size="16" name="switch_name"
|
|
|
+ value="<?= (isset($_REQUEST['switch_name'])) ? $_REQUEST['switch_name'] : '' ?>">
|
|
|
+ <input type="image" value="Submit" name="search" src="/images/submit_button.png">
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- <form name="mod_phys_switch_form" method="POST" action="<?=$_SERVER['PHP_SELF']?>" onSubmit='return check_confirm();'>
|
|
|
-<?php
|
|
|
+ </form>
|
|
|
+ <br />
|
|
|
+ <table class="noborder" summary="Control Table">
|
|
|
+ <tr>
|
|
|
+ <td class="left"><a href="<?= $base ?>/add_phys.php">Add Physical Switch</a> |
|
|
|
+ <?php
|
|
|
+ if (EXPORT_PRIME === true) {
|
|
|
+ ?>
|
|
|
+ <a href="#" onClick="window.open('<?= $base ?>/export.php')">Export to Prime / DNS</a> |
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ if (EXPORT_DEADMAN === true) {
|
|
|
+ ?>
|
|
|
+ <a href="#" onClick="window.open('<?= $base ?>/export_deadman.php')">Export To Ansible</a> |
|
|
|
+ <?php
|
|
|
+ } ?>
|
|
|
+ <a href="<?= $base ?>/logicsw.php">Logical Switches</a>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <form name="mod_phys_switch_form" method="POST" action="<?= $_SERVER['PHP_SELF'] ?>"
|
|
|
+ onSubmit='return check_confirm();'>
|
|
|
+ <?php
|
|
|
|
|
|
- foreach (array_merge($_GET, $_POST) as $name => $value) {
|
|
|
+ foreach (array_merge($_GET, $_POST) as $name => $value) {
|
|
|
if (!is_array($value)) {
|
|
|
- ?>
|
|
|
- <input type="hidden" name="<?=$name?>" value="<?=$value?>">
|
|
|
-<?php
|
|
|
+ ?>
|
|
|
+ <input type="hidden" name="<?= $name ?>" value="<?= $value ?>">
|
|
|
+ <?php
|
|
|
}
|
|
|
- }
|
|
|
-?>
|
|
|
- <div class="btable">
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ <div class="btable">
|
|
|
<table summary="Button Table" width="100%" cellspacing="0">
|
|
|
<tr>
|
|
|
<td><input type="reset" value="Reset" name="reset">
|
|
|
- <input type="submit" value="Submit" name="submit"></td>
|
|
|
+ <input type="submit" value="Submit" name="submit">
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- </div>
|
|
|
- <br/>
|
|
|
- <div align="center">
|
|
|
-<?php
|
|
|
-foreach ($errors as $error) {
|
|
|
- ?>
|
|
|
- <p class="error"><?=$error?></p>
|
|
|
-<?php
|
|
|
-}
|
|
|
-?>
|
|
|
- </div>
|
|
|
- <div class="maintable">
|
|
|
+ </div>
|
|
|
+ <br />
|
|
|
+ <div align="center">
|
|
|
+ <?php
|
|
|
+ foreach ($errors as $error) {
|
|
|
+ ?>
|
|
|
+ <p class="error">
|
|
|
+ <?= $error ?>
|
|
|
+ </p>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
+ <div class="maintable">
|
|
|
<table id="devtable" class="cell-border compact" width="100%" cellspacing="0" summary="Physical Switch Table">
|
|
|
<thead>
|
|
|
- <tr>
|
|
|
- <th class="headlink">Row No.</th>
|
|
|
- <th class="headlink">Delete?</th>
|
|
|
- <th class="headlink">Assigned?</th>
|
|
|
- <th class="headlink">Re-ZTP? <input type="checkbox" id="reztp_all_box" onchange="return reztp_all();"></th>
|
|
|
- <th class="headlink">Serial Number</th>
|
|
|
- <th class="headlink">Product ID</th>
|
|
|
- <th class="headlink">Max Ports</th>
|
|
|
- <th class="headlink">Assigned Logical<br/>Switch</th>
|
|
|
- <th class="headlink">Provision<br/>Status</th>
|
|
|
- <th class="headlink">Reachability</th>
|
|
|
- </tr>
|
|
|
+ <tr>
|
|
|
+ <th class="headlink">Row No.</th>
|
|
|
+ <th class="headlink">Delete?</th>
|
|
|
+ <th class="headlink">Assigned?</th>
|
|
|
+ <th class="headlink">Re-ZTP? <input type="checkbox" id="reztp_all_box" onchange="return reztp_all();">
|
|
|
+ </th>
|
|
|
+ <th class="headlink">Serial Number</th>
|
|
|
+ <th class="headlink">Product ID</th>
|
|
|
+ <th class="headlink">Max Ports</th>
|
|
|
+ <th class="headlink">Assigned Logical<br />Switch</th>
|
|
|
+ <th class="headlink">Provision<br />Status</th>
|
|
|
+ <th class="headlink">Reachability</th>
|
|
|
+ </tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
-<?php
|
|
|
-$i = 0;
|
|
|
-foreach ($switches as $row) {
|
|
|
- $sn = $row['serial_number'];
|
|
|
- $checked = false;
|
|
|
- $will_rz = false;
|
|
|
- if ($row['checked_out'] == 1) {
|
|
|
- $checked = true;
|
|
|
- }
|
|
|
+ <?php
|
|
|
+ $i = 0;
|
|
|
+ foreach ($switches as $row) {
|
|
|
+ $sn = $row['serial_number'];
|
|
|
+ $checked = false;
|
|
|
+ $will_rz = false;
|
|
|
+ if ($row['checked_out'] == 1) {
|
|
|
+ $checked = true;
|
|
|
+ }
|
|
|
|
|
|
- if ($row['should_re_ztp'] > 0) {
|
|
|
- $will_rz = true;
|
|
|
- } ?>
|
|
|
- <tr>
|
|
|
- <td><?=$i + 1?>.</td>
|
|
|
- <td><input type="checkbox" name="delete[<?=$sn?>]" value="1" onClick="if (this.checked == true) { deletes++; } else { deletes--; }"></td>
|
|
|
- <td><input type="hidden" name="prev_checked[<?=$sn?>]" value="<?=$row['checked_out']?>">
|
|
|
- <input id="checked_<?=$i?>" type="checkbox" name="checked[<?=$sn?>]" value="1" <?=($checked) ? 'checked' : ''?>></td>
|
|
|
- <td><input id="reztp_<?=$i?>" class="reztp" type="checkbox" name="reztp[<?=$sn?>]" value="1" onchange="toggle_reztp_all(this);" <?=($will_rz) ? 'disabled' : ''?>></td>
|
|
|
- <td><?=$row['serial_number']?></td>
|
|
|
- <td><?=$row['pid']?></td>
|
|
|
- <td><?=$row['max_ports']?></td>
|
|
|
- <td><input type="hidden" name="prev_assigned_switch[<?=$sn?>]" value="<?=$row['assigned_switch']?>">
|
|
|
- <select id="asw<?=$i?>" name="assigned_switch[<?=$sn?>]" onChange='var elem = document.getElementById("checked_<?=$i?>"); if (this.value == "__BOGUS__") { elem.checked = false; } else { elem.checked = true; }'>
|
|
|
-<?php
|
|
|
- $has_avail = false;
|
|
|
- foreach ($lswitches[$row['pid']] as $lsw) {
|
|
|
- $selected = ($row['assigned_switch'] == $lsw) ? 'selected' : '';
|
|
|
- if ($selected == '' && isset($used[$lsw]) && $used[$lsw] === true) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if ($lsw == '__BOGUS__') {
|
|
|
+ if ($row['should_re_ztp'] > 0) {
|
|
|
+ $will_rz = true;
|
|
|
+ } ?>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <?= $i + 1 ?>.
|
|
|
+ </td>
|
|
|
+ <td><input type="checkbox" name="delete[<?= $sn ?>]" value="1"
|
|
|
+ onClick="if (this.checked == true) { deletes++; } else { deletes--; }"></td>
|
|
|
+ <td><input type="hidden" name="prev_checked[<?= $sn ?>]" value="<?= $row['checked_out'] ?>">
|
|
|
+ <input id="checked_<?= $i ?>" type="checkbox" name="checked[<?= $sn ?>]" value="1" <?= ($checked) ? 'checked' : '' ?>>
|
|
|
+ </td>
|
|
|
+ <td><input id="reztp_<?= $i ?>" class="reztp" type="checkbox" name="reztp[<?= $sn ?>]" value="1"
|
|
|
+ onchange="toggle_reztp_all(this);" <?= ($will_rz) ? 'disabled' : '' ?>></td>
|
|
|
+ <td>
|
|
|
+ <?= $row['serial_number'] ?>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <?= $row['pid'] ?>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <?= $row['max_ports'] ?>
|
|
|
+ </td>
|
|
|
+ <td><input type="hidden" name="prev_assigned_switch[<?= $sn ?>]" value="<?= $row['assigned_switch'] ?>">
|
|
|
+ <select id="asw<?= $i ?>" name="assigned_switch[<?= $sn ?>]"
|
|
|
+ onChange='var elem = document.getElementById("checked_<?= $i ?>"); if (this.value == "__BOGUS__") { elem.checked = false; } else { elem.checked = true; }'>
|
|
|
+ <?php
|
|
|
+ $has_avail = false;
|
|
|
+ foreach ($lswitches[$row['pid']] as $lsw) {
|
|
|
+ $selected = ($row['assigned_switch'] == $lsw) ? 'selected' : '';
|
|
|
+ if ($selected == '' && isset($used[$lsw]) && $used[$lsw] === true) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if ($lsw == '__BOGUS__') {
|
|
|
+ ?>
|
|
|
+ <option value="__BOGUS__" <?= $selected ?>>--Please Select--</option>
|
|
|
+ <?php
|
|
|
+ } else {
|
|
|
+ $has_avail = true; ?>
|
|
|
+ <option value="<?= $lsw ?>" <?= $selected ?>><?= $lsw ?></option>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!$has_avail) {
|
|
|
+ ?>
|
|
|
+ <option value="__BOGUS__" <?= $selected ?>>--Please Select--</option>
|
|
|
+ <?php
|
|
|
+ } ?>
|
|
|
+ </select>
|
|
|
+ <a href="#"
|
|
|
+ onClick='var lsw = document.getElementById("asw<?= $i ?>"); if (lsw.value == "__BOGUS__") { alert("There is no logical switch associated to this device."); return false; } else { window.open("<?= $base ?>/logicsw.php?switch_name=" + lsw.value, "Logical switch " + lsw.value, "height=480,width=1048"); return false; }'><img
|
|
|
+ src="/images/switch.gif" border="0" title="View logical switch"></a> <a href="#"
|
|
|
+ onClick='var pros = document.getElementById("pros<?= $row['serial_number'] ?>"); var lsw = document.getElementById("asw<?= $i ?>"); if (pros.value < PROVISION_FAIL) { alert("This switch config has not yet been generated."); return false; } else { window.open("<?= $base ?>/show_config.php?cfg=" + lsw.value + "-config.txt&dname=" + lsw.value, "Config for switch " + lsw.value, "height=650,width=980"); return false; }'><img
|
|
|
+ src="/images/mag.gif" border="0" title="View switch config"></a>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+ $color = '#FFFFFF';
|
|
|
+ $rtext = 'N/A';
|
|
|
+ $rtitle = 'Not yet assigned'; ?>
|
|
|
+ <td id="psr_<?= $row['serial_number'] ?>" style="background: <?= $color ?>;" title="<?= $rtitle ?>"><input
|
|
|
+ type="hidden" id="pros<?= $row['serial_number'] ?>" value="<?= $row['provisioned_status'] ?>"><span
|
|
|
+ style="display: none">
|
|
|
+ <?= $row['provisioned_status'] ?>
|
|
|
+ </span>
|
|
|
+ <?= $rtext ?>
|
|
|
+ </td>
|
|
|
+ <?php
|
|
|
+
|
|
|
+ $color = '#FFFFFF';
|
|
|
+ $rtext = 'N/A';
|
|
|
+ $rtitle = 'Not yet assigned'; ?>
|
|
|
+ <td id="dsr_<?= $row['serial_number'] ?>" style="background: <?= $color ?>;" title="<?= $rtitle ?>"><span
|
|
|
+ style="display: none">
|
|
|
+ <?= $row['device_status'] ?>
|
|
|
+ </span>
|
|
|
+ <?= $rtext ?>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <?php
|
|
|
+ ++$i;
|
|
|
+ }
|
|
|
?>
|
|
|
- <option value="__BOGUS__" <?=$selected?>>--Please Select--</option>
|
|
|
-<?php
|
|
|
- } else {
|
|
|
- $has_avail = true; ?>
|
|
|
- <option value="<?=$lsw?>" <?=$selected?>><?=$lsw?></option>
|
|
|
-<?php
|
|
|
- }
|
|
|
- }
|
|
|
- if (!$has_avail) {
|
|
|
- ?>
|
|
|
- <option value="__BOGUS__" <?=$selected?>>--Please Select--</option>
|
|
|
-<?php
|
|
|
- } ?>
|
|
|
- </select>
|
|
|
- <a href="#" onClick='var lsw = document.getElementById("asw<?=$i?>"); if (lsw.value == "__BOGUS__") { alert("There is no logical switch associated to this device."); return false; } else { window.open("<?=$base?>/logicsw.php?switch_name=" + lsw.value, "Logical switch " + lsw.value, "height=480,width=1048"); return false; }'><img src="/images/switch.gif" border="0" title="View logical switch"></a> <a href="#" onClick='var pros = document.getElementById("pros<?=$row['serial_number']?>"); var lsw = document.getElementById("asw<?=$i?>"); if (pros.value < PROVISION_FAIL) { alert("This switch config has not yet been generated."); return false; } else { window.open("<?=$base?>/show_config.php?cfg=" + lsw.value + "-config.txt&dname=" + lsw.value, "Config for switch " + lsw.value, "height=650,width=980"); return false; }'><img src="/images/mag.gif" border="0" title="View switch config"></a>
|
|
|
- </td>
|
|
|
-<?php
|
|
|
- $color = '#FFFFFF';
|
|
|
- $rtext = 'N/A';
|
|
|
- $rtitle = 'Not yet assigned'; ?>
|
|
|
- <td id="psr_<?=$row['serial_number']?>" style="background: <?=$color?>;" title="<?=$rtitle?>"><input type="hidden" id="pros<?=$row['serial_number']?>" value="<?=$row['provisioned_status']?>"><span style="display: none"><?=$row['provisioned_status']?></span><?=$rtext?></td>
|
|
|
-<?php
|
|
|
-
|
|
|
- $color = '#FFFFFF';
|
|
|
- $rtext = 'N/A';
|
|
|
- $rtitle = 'Not yet assigned'; ?>
|
|
|
- <td id="dsr_<?=$row['serial_number']?>" style="background: <?=$color?>;" title="<?=$rtitle?>"><span style="display: none"><?=$row['device_status']?></span><?=$rtext?></td>
|
|
|
- </tr>
|
|
|
-<?php
|
|
|
- ++$i;
|
|
|
-}
|
|
|
-?>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
- </div>
|
|
|
- <br/>
|
|
|
- <div class="btable">
|
|
|
+ </div>
|
|
|
+ <br />
|
|
|
+ <div class="btable">
|
|
|
<table summary="Button Table" width="100%" cellspacing="0">
|
|
|
<tr>
|
|
|
<td><input type="reset" value="Reset" name="reset">
|
|
|
- <input type="submit" value="Submit" name="submit"></td>
|
|
|
+ <input type="submit" value="Submit" name="submit">
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- </body>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+</body>
|
|
|
+
|
|
|
</html>
|
|
|
<?php
|
|
|
cleanup();
|
|
|
-?>
|
|
|
+?>
|