From 1eaf7d7aab6dc4c949c1fae6c92e6ff53c3829ea Mon Sep 17 00:00:00 2001 From: vitalisator Date: Sun, 17 Jan 2016 23:22:43 +0100 Subject: [PATCH] 1st try to make bootgrid table --- html/includes/print-stp-ports.inc.php | 74 ++++++++++++++------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/html/includes/print-stp-ports.inc.php b/html/includes/print-stp-ports.inc.php index 665b946fbd..83916b307b 100644 --- a/html/includes/print-stp-ports.inc.php +++ b/html/includes/print-stp-ports.inc.php @@ -1,31 +1,23 @@ "; +echo "
"; +echo "
"; +echo ''; echo ' - - - - - - - - - - + + + + + + + + + + '; +echo ''; +echo ''; -switch ($vars["sort"]) { - case 'transitions': - $sort = "ps.forwardTransitions DESC"; - break; - default: - $sort = "ps.port_id ASC"; - break; -} -$i='1'; - -// FIXME Table sorting don't working, why? -//echo "$sort"; -foreach (dbFetchRows("SELECT `ps`.*, `p`.* FROM `ports_stp` `ps` JOIN `ports` `p` ON `ps`.`port_id`=`p`.`port_id` WHERE `ps`.`device_id` = ? ORDER BY ?", array($device['device_id'], $sort)) as $stp_ports_db) { +foreach (dbFetchRows("SELECT `ps`.*, `p`.* FROM `ports_stp` `ps` JOIN `ports` `p` ON `ps`.`port_id`=`p`.`port_id` WHERE `ps`.`device_id` = ?", array($device['device_id'])) as $stp_ports_db) { $bridge_device = dbFetchRow("SELECT `devices`.*, `stp`.`device_id`, `stp`.`bridgeAddress` FROM `devices` JOIN `stp` ON `devices`.`device_id`=`stp`.`device_id` WHERE `stp`.`bridgeAddress` = ?", array($stp_ports_db['designatedBridge'])); $root_device = dbFetchRow("SELECT `devices`.*, `stp`.`device_id`, `stp`.`bridgeAddress` FROM `devices` JOIN `stp` ON `devices`.`device_id`=`stp`.`device_id` WHERE `stp`.`bridgeAddress` = ?", array($stp_ports_db['designatedRoot'])); @@ -36,25 +28,37 @@ foreach (dbFetchRows("SELECT `ps`.*, `p`.* FROM `ports_stp` `ps` JOIN `ports` `p $stp_ports_db['state'], $stp_ports_db['enable'], $stp_ports_db['pathCost'], - //$stp_ports_db['designatedRoot'], generate_device_link($root_device, $root_device['hostname'])."
".$stp_ports_db['designatedRoot'], $stp_ports_db['designatedCost'], generate_device_link($bridge_device, $bridge_device['hostname'])."
".$stp_ports_db['designatedBridge'], $stp_ports_db['designatedPort'], $stp_ports_db['forwardTransitions'] ]; - $i++; - if (!is_integer($i / 2)) { - $row_colour = $list_colour_b; - } - else { - $row_colour = $list_colour_a; - } - echo ""; - + + echo ""; foreach ($stp_ports as $value) { echo ""; } - echo ''; } +echo ''; +echo '
PortPriorityStateEnablePath costDesignated rootDesignated costDesignated bridgeDesignated portFwd trasitionsPortPriorityStateEnablePath costDesignated rootDesignated costDesignated bridgeDesignated portFwd trasitions
$value
'; +echo ''; +// FIXME make table with links and searcheable +// +?> + +