some bugfixing

This commit is contained in:
vitalisator
2016-01-28 13:07:33 +01:00
parent 89f9e609b5
commit 0e66ddf088
5 changed files with 12 additions and 14 deletions

View File

@@ -2,7 +2,7 @@
$common_output[] = '
<div class="table-responsive">
<table id="stp-ports" class="table table-condensed table-hover table-striped">
<table id="stp-ports" class="table table-condensed table-hover">
<thead>
<tr>
<th data-column-id="port">Port</th>
@@ -14,16 +14,17 @@ $common_output[] = '
<th data-column-id="designatedCost">Designated cost</th>
<th data-column-id="designatedBridge">Designated bridge</th>
<th data-column-id="designatedPort">Designated port</th>
<th data-column-id="forwardTransitions">Fwd trasitions</th>
<th data-column-id="forwardTransitions">Forward transitions</th>
</tr>
</thead>
<table>
</table>
</div>
<script>
var grid = $("#stp-ports").bootgrid( {
ajax: true,
templates: {search: ""},
post: function ()
{
return {

View File

@@ -1,5 +1,6 @@
<?php
echo '<table class="table table-condensed table-striped table-hover">';
$stp_raw = dbFetchRow('SELECT * FROM `stp` WHERE `device_id` = ?', array($device['device_id']));
$stp = array (
'Root bridge' => ($stp_raw['rootBridge'] == 1) ? 'Yes' : 'No',
@@ -22,8 +23,9 @@ $stp = array (
foreach (array_keys($stp) as $key) {
echo "
<tr>
<td width=280 class=list-large>$key</td>
<td class=box-desc>$stp[$key]</td>
<td>$key</td>
<td>$stp[$key]</td>
</tr>
";
}
echo '</table>';

View File

@@ -6,7 +6,7 @@ $param[] = $device_id;
$sql = " FROM `ports_stp` `ps` JOIN `ports` `p` ON `ps`.`port_id`=`p`.`port_id` WHERE `ps`.`device_id` = ?";
$count_sql = "SELECT COUNT(ports_stp_id) $sql";
$count_sql = "SELECT COUNT(*) $sql";
$total = dbFetchCell($count_sql, $param);
if (empty($total)) {
$total = 0;