mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update network.php
This commit is contained in:
@@ -130,6 +130,9 @@ echo $_REQUEST['device_id'];
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
// #####################################
|
||||||
|
// Create functions
|
||||||
|
// #####################################
|
||||||
function createnetworktab($pia_func_netdevid, $pia_func_netdevname, $pia_func_netdevtyp, $activetab) {
|
function createnetworktab($pia_func_netdevid, $pia_func_netdevname, $pia_func_netdevtyp, $activetab) {
|
||||||
echo '<li class="'.$activetab.'"><a href="#'.$pia_func_netdevid.'" data-toggle="tab">'.$pia_func_netdevname.' / '.$pia_func_netdevtyp.'</a></li>';
|
echo '<li class="'.$activetab.'"><a href="#'.$pia_func_netdevid.'" data-toggle="tab">'.$pia_func_netdevname.' / '.$pia_func_netdevtyp.'</a></li>';
|
||||||
}
|
}
|
||||||
@@ -147,39 +150,41 @@ function createnetworktabcontent($pia_func_netdevid, $pia_func_netdevname, $pia_
|
|||||||
}
|
}
|
||||||
echo '</div> ';
|
echo '</div> ';
|
||||||
}
|
}
|
||||||
|
// #####################################
|
||||||
|
// Build Tab Box
|
||||||
|
// #####################################
|
||||||
|
|
||||||
$sql = 'SELECT "device_id", "net_device_name", "net_device_typ" FROM "network_infrastructure"';
|
$sql = 'SELECT "device_id", "net_device_name", "net_device_typ" FROM "network_infrastructure"';
|
||||||
$result = $db->query($sql);//->fetchArray(SQLITE3_ASSOC);
|
$result = $db->query($sql);//->fetchArray(SQLITE3_ASSOC);
|
||||||
?>
|
?>
|
||||||
|
<div class="nav-tabs-custom">
|
||||||
<div class="nav-tabs-custom">
|
<ul class="nav nav-tabs">
|
||||||
<ul class="nav nav-tabs">
|
<?php
|
||||||
|
$i = 0;
|
||||||
<?php
|
while($res = $result->fetchArray(SQLITE3_ASSOC)){
|
||||||
$i = 0;
|
if(!isset($res['device_id'])) continue;
|
||||||
while($res = $result->fetchArray(SQLITE3_ASSOC)){
|
if ($i == 0) {$active = 'active';} else {$active = '';}
|
||||||
if(!isset($res['device_id'])) continue;
|
createnetworktab($res['device_id'], $res['net_device_name'], $res['net_device_typ'], $active);
|
||||||
if ($i == 0) {$active = 'active';} else {$active = '';}
|
$i++;
|
||||||
createnetworktab($res['device_id'], $res['net_device_name'], $res['net_device_typ'], $active);
|
}
|
||||||
$i++;
|
?>
|
||||||
}
|
</ul>
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<?php
|
<?php
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while($res = $result->fetchArray(SQLITE3_ASSOC)){
|
while($res = $result->fetchArray(SQLITE3_ASSOC)){
|
||||||
if(!isset($res['device_id'])) continue;
|
if(!isset($res['device_id'])) continue;
|
||||||
if ($i == 0) {$active = 'active';} else {$active = '';}
|
if ($i == 0) {$active = 'active';} else {$active = '';}
|
||||||
createnetworktabcontent($res['device_id'], $res['net_device_name'], $res['net_device_typ'], $active);
|
createnetworktabcontent($res['device_id'], $res['net_device_name'], $res['net_device_typ'], $active);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
unset($i);
|
unset($i);
|
||||||
?>
|
?>
|
||||||
<!-- /.tab-pane -->
|
<!-- /.tab-pane -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.tab-content -->
|
<!-- /.tab-content -->
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user