<?php $query = GenQuery('stock', 's', '*', 'type'); $res = @DbQuery($query, $link); if ($res) { $row = 0; while ($dev = @DbFetchRow($res)) { if ($row % 2) { $bg = $bgb; $bi = $bib; } else { $bg = $bga; $bi = $bia; } $row++; $img = "genh.png"; $ud = rawurlencode($dev[0]); $da = date("j.M (G:i)", $dev[3]); list($a1c, $a2c) = Agecol($dev[3], $dev[3], $row % 2); echo "<tr bgcolor=#{$bg}><th bgcolor=#{$bi}><img src=img/16/" . $cico[$dev[5]] . ".png title=" . $stco[$dev[5]] . "></th><td>{$dev['0']}</td>\n"; echo "<td>{$dev['1']}</td><td>{$dev['2']}</td><td bgcolor=#{$a1c}>{$da}</td><td>{$dev['4']}</td>\n"; echo "<td align=center><a href={$_SERVER['PHP_SELF']}?del={$ud}><img src=img/16/bcnl.png border=0 onclick=\"return confirm('Delete {$dev['0']} from stock?')\" title=\"Delete this device!\"></a></td>\n"; echo "</tr>\n"; } @DbFreeResult($res); } else { print @DbError($link); } echo "</table><table bgcolor=#666666 {$tabtag} >\n"; echo "<tr bgcolor=#{$bg2}><td>{$row} results using {$query}</td></tr></table>\n"; include_once "inc/footer.php";
} else { $query = GenQuery('user', 's', '*', $ord); } $res = @DbQuery($query, $link); if ($res) { $row = 0; while ($u = @DbFetchRow($res)) { if ($row % 2) { $bg = $bgb; $bi = $bib; } else { $bg = $bga; $bi = $bia; } $row++; list($cc, $lc) = Agecol($u[10], $u[11], $row % 2); echo "<tr bgcolor=#{$bg}>\n"; echo "<th bgcolor=#{$bi}><img src=" . Smilie($u[0]) . " title=\"Hello I'm {$u['0']}\"'><br>{$u['0']}</th>\n"; echo "<td>{$u['8']}</td><td align=center>{$u['9']}</td><td>{$u['12']}</td><td align=center>{$u['13']}</td>\n"; echo "<td bgcolor=#{$cc}>" . date("j. M Y", $u[10]) . "</td>\n"; echo "<td bgcolor=#{$lc}>" . date("j. M (G:i)", $u[11]) . "</td><th>\n"; if ($u[2]) { echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&grm={$u['0']}&mgp=adm><img hspace={$hs} src=img/16/cfg.png border=0 title=-admin></a>"; } else { echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&gad={$u['0']}&mgp=adm><img hspace={$hs} src=img/16/bcls.png border=0 title=+admin></a>"; } if ($u[3]) { echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&grm={$u['0']}&mgp=net><img hspace={$hs} src=img/16/net.png border=0 title=-net></a>"; } else { echo "<a href={$_SERVER['PHP_SELF']}?grp={$grp}&ord={$ord}&gad={$u['0']}&mgp=net><img hspace={$hs} src=img/16/bcls.png border=0 title=+net></a>"; }
2"> <th width="40"><img src="img/16/user.png"><br>User</th> <th width="120"><img src="img/16/clock.png"><br><?php echo $timlbl; ?> </th> <th><img src="img/16/say.png"><br><?php echo $cmtlbl; ?> </th> </tr> <?php while ($m = DbFetchRow($res)) { if ($_SESSION['user'] == $m[1]) { $bg = "txta"; $bi = "imga"; $me = 1; } else { $bg = "txtb"; $bi = "imgb"; $me = 0; } list($fc, $lc) = Agecol($m[0], $m[0], $me); $time = date($datfmt, $m[0]); echo "<tr class=\"{$bg}\"><th class=\"{$bi}\">" . Smilie($m[1], 1); echo "</th>\n"; echo "<td bgcolor=#{$fc}>{$time}</td><td>" . preg_replace('/(http[s]?:\\/\\/[^\\s]*)/', "<a href=\"\$1\" target=\"window\">\$1</a>", $m[2]) . "</td></tr>\n"; } echo "</table>\n"; } include_once "inc/footer.php";
if ($res) { $nli = 0; $row = 0; while ($l = DbFetchRow($res)) { $ud = rawurlencode($l[1]); $un = rawurlencode($l[3]); if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; TblRow($bg); list($tc, $tc) = Agecol($l[10], $l[10], $row % 2); TblCell($l[1], "?dv={$ud}", "nowrap", "<a href=\"Devices-Status.php?dev={$ud}\"><img src=\"img/16/sys.png\"></a>"); echo "<td>{$l['2']}</td>\n"; echo "<th>{$l['6']}</th>\n"; echo "<td align=right>" . DecFix($l[5]) . "</td>\n"; TblCell($l[3], "?dv={$un}", "nowrap", "<a href=\"Devices-Status.php?dev={$un}\"><img src=\"img/16/sys.png\"></a>"); echo "<td>{$l['4']} (Vl{$l['9']} {$l['8']})</td><td>{$l['7']}</td><td bgcolor=\"{$tc}\" width=\"100\" nowrap>" . date($datfmt, $l[10]) . "</td>\n"; echo "<th><a href=\"?del={$l['0']}&dv={$ud}\"><img src=\"img/16/bcnl.png\" onclick=\"return confirm('Link {$l['0']} {$dellbl}?');\" title=\"{$l['0']} {$dellbl}\"></a></th></tr>\n"; $nli++; } DbFreeResult($res); } else { print DbError($link); } ?> </table>
die; } $dev = @DbFetchRow($res); @DbFreeResult($res); $query = GenQuery('networks', 's', '*', '', '', array('device'), array('='), array($shd)); $res = @DbQuery($query, $link); while ($n = @DbFetchRow($res)) { $net[$n[1]][$n[2]] = ip2long(long2ip($n[3])); // thanks again PHP (for increased grey hair count to fix netmask)! } @DbFreeResult($res); $ud = rawurlencode($dev[0]); $ip = $dev[1] ? long2ip($dev[1]) : 0; $oi = $dev[19] ? long2ip($dev[19]) : 0; $img = $dev[18]; list($fc, $lc) = Agecol($dev[4], $dev[5], 0); $fs = date($datfmt, $dev[4]); $ls = date($datfmt, $dev[5]); $sv = Syssrv($dev[6]); $os = $dev[8]; $comm = $dev[15]; $ver = $dev[14] & 127; ?> <table cellspacing=10 width=100%> <tr><td width=50% valign=top> <h2>General Info</h2><p> <table bgcolor=#666666 <?php echo $tabtag; ?> > <tr>
if (in_array("oui", $col)) { echo "<td><a href=http://www.google.com/search?q=" . urlencode($n[3]) . "&btnI=1>{$n['3']}</a></td>"; } if (in_array("ifname", $col)) { echo "<td><a href=?ina=device&opa==&sta={$ud}&ord=ifname>{$n['6']}</a>"; echo " - <a href=?ina=device&opa==&inb=ifname&opb==&sta={$ud}&cop=AND&stb={$ui}>{$n['7']}</a></td>"; } if (in_array("vlanid", $col)) { echo "<td>{$n['8']}</td>"; } if (in_array("ifmetric", $col)) { echo "<td align=right>{$n['9']}</td>"; } if (in_array("ifupdate", $col)) { $iu = date("j.M G:i:s", $n[10]); list($i1c, $i2c) = Agecol($n[10], $n[10], $row % 2); echo "<td bgcolor=#{$i1c}>{$iu}</td>"; } if (in_array("ifchanges", $col)) { echo "<td align=right>{$n['11']}</td>"; } if (in_array("ifdet", $col)) { $link = @DbConnect($dbhost, $dbuser, $dbpass, $dbname); $iquery = GenQuery('interfaces', 's', '*', '', '', array('device', 'ifname'), array('=', '='), array($n[6], $n[7]), array('AND')); $ires = @DbQuery($iquery, $link); $nif = @DbNumRows($ires); if ($nif == 1) { $if = @DbFetchRow($ires); if ($if[8] == "2") { $ifimg = "<img src=img/bulbr.png title=\"Disabled!\">"; } else {
} if(in_array("ifchanges",$col)){ TblCell($n[11],"?in[]=ifchanges&op[]==&st[]=$n[11]");} if(in_array("lastchg",$col)){ list($i1l,$i2l) = Agecol($n[33],$n[33],$row % 2); TblCell(date($datfmt,$n[33]),"?in[]=lastchg&op[]==&st[]=$n[33]","nowrap bgcolor=\"#$i1l\""); } if(in_array("dinerr",$col)) {TblCell($n[34]);} if(in_array("douterr",$col)) {TblCell($n[35]);} if(in_array("dindis",$col)) {TblCell($n[36]);} if(in_array("doutdis",$col)) {TblCell($n[37]);} if(in_array("tcpports",$col)) {TblCell($n[17],"?in[]=tcpports&op[]==&st[]=$n[17]");} if(in_array("udpports",$col)) {TblCell($n[18],"?in[]=udpports&op[]==&st[]=$n[18]");} if(in_array("nodtype",$col)) {TblCell($n[19],"?in[]=nodtype&op[]==&st[]=$n[19]");} if(in_array("nodos",$col)) {TblCell($n[20],"?in[]=nodos&op[]==&st[]=$n[20]");} if(in_array("osupdate",$col)){ list($o1c,$o2c) = Agecol($n[21],$n[21],$row % 2); TblCell( date($datfmt,$n[21]),"?in[]=osupdate&op[]==&st[]=$n[21]","nowrap bgcolor=\"#$o1c\""); } if(in_array("noduser",$col)) {TblCell($n[22],"?in[]=noduser&op[]==&st[]=$n[22]");} if( !isset($_GET['xls']) ){ if(in_array("sshNS",$col)){ echo "<td><a href=ssh://$ip><img src=\"img/16/lokc.png\"></a>\n"; echo (($wasup)?CheckTCP($ip,'22',''):"-") ."</td>"; } if(in_array("telNS",$col)){ echo "<td><a href=telnet://$ip><img src=\"img/16/loko.png\"></a>\n"; echo (($wasup)?CheckTCP($ip,'23',''):"-") ."</td>"; } if(in_array("wwwNS",$col)){ echo "<td><a href=http://$ip target=window><img src=\"img/16/glob.png\"></a>\n";
if($res){ $row = 0; if (!$lic){$lic = 1000000;} # Yepp, not really oo... while( ($con = DbFetchRow($res)) ){ if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";} $row++; $ud = rawurlencode($con[0]); TblRow($bg); TblCell($con[0],"","class=\"$bi\" width=\"50px\"","<a href=\"Devices-Status.php?dev=$ud\"><img src=\"img/dev/$con[9].png\" title=\"$con[7]\"></a><br>","th-img"); TblCell( Devcli($con[6],$con[10]) ); TblCell($con[8]); TblCell( substr(implode("\n",preg_grep("/$sta/i",explode("\n",$con[1]) ) ),0,$lic),"?shc=$ud","class=\"code\"" ); TblCell($con[4]); TblCell( substr(implode("\n",preg_grep("/$sta/i",explode("\n",$con[2]) ) ),0,$lic),"","class=\"code\"" ); TblCell($con[5]); list($u1c,$u2c) = Agecol($con[3],$con[3],$row % 2); TblCell( date($_SESSION['date'],$con[3]),"","bgcolor=\"#$u1c\" nowrap" ); echo "</tr>\n"; } DbFreeResult($res); }else{ print DbError($link); } ?> </table> <table class="content"> <tr class="<?= $modgroup[$self] ?>2"><td><?= $row ?> Devices</td></tr> </table> <?php }
if ($nnod == 1) { $n = @DbFetchRow($nres); @DbFreeResult($nres); } else { $n = array($s[0], $s[1], $s[2], '-', 0, 0, 'Not in nodes', '-'); } $dbna = preg_replace("/^(.*?)\\.(.*)/", "\$1", $n[0]); $dbip = long2ip($n[1]); $img = Nimg("{$n['2']};{$n['3']}"); $ls = date("r", $n[5]); list($fc, $lc) = Agecol($n[4], $n[5], $row % 2); $na = preg_replace("/^(.*?)\\.(.*)/", "\$1", $s[0]); $ip = long2ip($s[1]); $sup = date("r", $s[6]); $simg = ""; list($s1c, $s2c) = Agecol($s[6], $s[6], $row % 2); if ($n[5] > $s[6]) { $simg = "<img src=img/16/lokc.png hspace=8 title=\"Reappeared!\">"; } echo "<tr bgcolor=#{$bg}>"; echo "<th bgcolor=#{$bia} width=120 rowspan=2><a href=Nodes-Status.php?mac={$n['2']}><img src=img/oui/{$img} title=\"{$n['3']}\" vspace=8 border=0></a><br>{$s['2']}\n"; echo "<td>{$dbna}</td><td>{$dbip}</td><td>{$n['6']}</td><td>{$n['7']}</td><td bgcolor=#{$lc}>{$ls}</td>\n"; echo "<th>{$simg} <a href={$_SERVER['PHP_SELF']}?del={$s['2']}><img src=img/16/bcnl.png border=0 hspace=8 onclick=\"return confirm('Delete node {$s['2']}?')\"></a></th>\n"; echo "</tr><tr bgcolor=#{$bg}><td>{$na}</td><td>{$ip}</td><td>{$s['3']}</td><td>{$s['4']}</td><td bgcolor=#{$s1c}>{$sup}</td><td align=center>{$s['5']}</td>\n"; echo ""; echo "</tr>\n"; } @DbFreeResult($res); } else { print @DbError($link); }
$res = DbQuery($query, $link); if ($res) { $usta = urlencode($sta); $uopa = urlencode($opa); $row = 0; while ($trk = DbFetchArray($res)) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; $cfgst = ''; list($cc, $lc) = Agecol($trk['time'], $trk['time'], $row % 2); if ($dev and $dev == $trk['device'] and $ifn and $ifn == $trk['ifname']) { $time = time(); if ($src) { if ($src == '-') { $setd = ''; } elseif ($src == 'comment') { $trk[$src] = preg_replace('/.+DP:(.+),.+/', '$1', $trk[$src]); $setd = "value='{$trk[$src]}',"; } else { $setd = "value='{$trk[$src]}',"; } if (!DbQuery("UPDATE nodetrack SET {$setd}source='{$src}',usrname='{$_SESSION['user']}',time={$time} WHERE device = '{$dev}' AND ifname = '{$ifn}';", $link)) { $cfgst = "<img src=\"img/16/bcnl.png\" title=\"" . DbError($link) . "\">"; } else { $cfgst = "<img src=\"img/16/bchk.png\" title=\"{$srclbl} = {$src} OK\">";
<?php TblHead("$modgroup[$self]2",2); if ($grp){ $query = GenQuery('users','s','*',$ord,'',array('groups'),array('&'),array($grp) ); }else{ $query = GenQuery('users','s','*',$ord ); } $res = DbQuery($query,$link); if($res){ $row = 0; while( ($usr = DbFetchRow($res)) ){ if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";} $row++; list($cc,$lc) = Agecol($usr[5],$usr[6],$row % 2); TblRow($bg); ?> <th class="<?= $bi ?>"> <?=Smilie($usr[0]) ?><br><?= $usr[0] ?></th> <td nowrap><?= $usr[3] ?></td> <td nowrap><?= $usr[4] ?></td> <td nowrap><?= $usr[7] ?></td> <td bgcolor="#<?= $cc ?>"><?= (date($datfmt,$usr[5])) ?></td> <td bgcolor="#<?= $lc ?>"><?= (date($datfmt,$usr[6])) ?></td> <td> <?php if( !($usr[2] & 1) ) { ?> <form method="get"> <input type="hidden" name="usr" value="<?= $usr[0] ?>"> <select size="1" name="inv"> <?php
<?php $query = GenQuery('stock', 's', '*', 'time desc', $_SESSION['lim']); $res = DbQuery($query, $link); if ($res) { $row = 0; while ($item = DbFetchRow($res)) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; list($a1c, $a2c) = Agecol($item[15], $item[15], $row % 2); echo "<tr class=\"{$bg}\"><th class=\"{$bi}\">\n"; echo "<img src=\"img/16/" . $cico[$item[0]] . ".png\" title=" . $stco[$item[0]] . "></th>\n"; echo "<td bgcolor=\"#{$a1c}\">" . date($datfmt, $item[15]) . "</td>\n"; echo "<td><a href=\"?lst=ty&val=" . urlencode($item[2]) . "\">{$item['2']}</a></td>\n"; echo "<td><a href=\"?lst=us&val=" . urlencode($item[14]) . "\">{$item['14']}</a></td>\n"; echo "<td><a href=\"?lst=lo&val=" . urlencode($item[4]) . "\">{$item['4']}</a></td><td>{$item['13']}</td>"; echo "</tr>\n"; } } ?> </table> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?>
$row = 0; $trkst = ''; $monst = ''; while ($if = DbFetchRow($res)) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; $ud = urlencode($if[0]); $ui = urlencode($if[1]); list($fc, $lc) = Agecol($if[33], $if[34], $row % 2); list($cc, $cc) = Agecol($if[26], $if[26], $row % 2); if ($isadmin and $_GET['trk']) { $trkst = AddRecord('nodetrack', "device='{$if['0']}' AND ifname='{$if['1']}'", "device,ifname,value,source,usrname,time", "'{$if['0']}','{$if['1']}','-','-','{$_SESSION['user']}','" . time() . "'"); } if ($isadmin and $_GET['upm']) { $query = GenQuery('interfaces', 'u', "CONCAT(device,ifname)", '=', "{$if['0']}{$if['1']}", array('trafalert', 'brcalert', 'macflood'), array(), array($tal, $bal, $maf)); $monst = DbQuery($query, $link) ? "<img src=\"img/16/bchk.png\" title=\" {$monlbl} {$updlbl} OK\" vspace=\"4\">" : "<img src=\"img/16/bcnl.png\" title=\"" . DbError($link) . "\" vspace=\"4\">"; } TblRow($bg); if (in_array("imBL", $col)) { list($ifbg, $ifst) = Ifdbstat($if[8]); list($ifimg, $iftyp) = Iftype($if[4]); TblCell("", "", "width=\"50\" class=\"" . ($ifbg ? $ifbg : $bi) . "\"", "<img src=\"img/{$ifimg}\" title=\"{$iftyp} - {$ifst}\">", "th-img"); } if (in_array("ifname", $col)) { TblCell("{$if['1']} {$trkst} {$monst}", "?in[]=ifname&op[]==&st[]={$ui}", "align=\"left\"", "", "th");
function DevConfigs($ina, $opa, $sta, $lim, $ord) { global $link, $modgroup, $self, $verb1, $cfglbl, $srtlbl, $mico, $loclbl, $locsep, $conlbl, $chglbl, $updlbl, $woulbl; ?> <table class="full fixed"><tr><td class="helper"> <h2>CLI Devices <?php echo $woulbl; ?> <?php echo $cfglbl; ?> </h2> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?> 2"> <th width="33%" colspan="2"><img src="img/16/dev.png"><br>Device</th> <th><img src="img/16/glob.png"><br>IP</th> <th><img src="img/16/cog.png"><br>OS</th> </tr> <?php if ($ord) { $ocol = "devip"; $srt = "{$srtlbl}: IP"; } else { $ocol = "device"; $srt = "{$srtlbl}: Device"; } $query = GenQuery('devices', 's', 'device,devip,cliport,devos,contact,location,icon', $ocol, $lim, array('config', 'cliport', $ina), array('COL IS', '>', $opa), array('NULL', '1', $sta), array('AND', 'AND'), 'LEFT JOIN configs USING (device)'); $res = DbQuery($query, $link); if ($res) { $row = 0; while ($r = DbFetchRow($res)) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; $l = explode($locsep, $r[5]); echo "<tr class=\"{$bg}\"><th class=\"{$bi}\"><a href=\"Devices-Status.php?dev=" . urlencode($r[0]) . "\"><img src=\"img/dev/{$r['6']}.png\" title=\"{$conlbl}: {$r['4']}, {$loclbl}: {$l['0']} {$l['1']} {$l['2']}\"></a></th>\n"; echo "<td><b>" . substr($r[0], 0, $_SESSION['lsiz']) . "</b></td>\n"; echo "<td>" . Devcli(long2ip($r[1]), $r[2]) . "</td><td>{$r['3']}</td></tr>\n"; } DbFreeResult($res); } else { print DbError($link); } ?> </table> <table class="content" > <tr class="<?php echo $modgroup[$self]; ?> 2"><td><?php echo $row; ?> Devices, <?php echo $srt; ?> </td></tr> </table> </td><td class="helper"> <h2><?php echo $cfglbl; ?> <?php echo $woulbl; ?> <?php echo $chglbl; ?> </h2> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?> 2"> <th width="33%" colspan="2"><img src="img/16/dev.png"><br>Device</th> <th><img src="img/16/glob.png"><br>IP</th> <th><img src="img/16/date.png"><br><?php echo $updlbl; ?> </th> </tr> <?php if ($ord) { $ocol = "devip"; $srt = "{$srtlbl}: IP"; } else { $ocol = "device"; $srt = "{$srtlbl}: Device"; } $query = GenQuery('configs', 's', 'device,devip,cliport,devos,time,contact,location,icon', $ocol, $lim, array('changes', $ina), array('~', $opa), array('^$', $sta), array('AND'), 'LEFT JOIN devices USING (device)'); $res = DbQuery($query, $link); if ($res) { $row = 0; while ($r = DbFetchRow($res)) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; $l = explode($locsep, $r[6]); list($u1c, $u2c) = Agecol($r[4], $r[4], $row % 2); echo "<tr class=\"{$bg}\"><th class=\"{$bi}\"><a href=\"Devices-Status.php?dev=" . urlencode($r[0]) . "\"><img src=\"img/dev/{$r['7']}.png\" title=\"{$conlbl}: {$r['5']}, {$loclbl}: {$l['0']} {$l['1']} {$l['2']}\"></a></th>\n"; echo "<td><b>" . substr($r[0], 0, $_SESSION['lsiz']) . "</b></td>\n"; echo "<td>" . Devcli(long2ip($r[1]), $r[2]) . "</td><td bgcolor=\"#{$u1c}\" nowrap>" . date($_SESSION['date'], $r[4]) . "</td></tr>\n"; } DbFreeResult($res); } else { print DbError($link); } ?> </table> <table class="content" > <tr class="<?php echo $modgroup[$self]; ?> 2"><td><?php echo $row; ?> Devices, <?php echo $srt; ?> </td></tr> </table> </td></tr></table> <p> <?php }
$row++; $fs = date("d.M H:i", $i[4]); if ($i[5]) { $dur = intval(($i[5] - $i[4]) / 3600); $ls = date("d.M H:i", $i[5]); # . " ($dur h)"; } else { $ls = "-"; } if ($i[7]) { $at = date("d.M H:i", $i[7]); } else { $at = "-"; } $ud = rawurlencode($i[2]); list($fc, $lc) = Agecol($i[4], $i[5], $row % 2); echo "<tr bgcolor=#{$bg}><th>{$i['0']}</th><th bgcolor={$bi}><img src=img/16/" . $mico[$i[1]] . ".png title=\"" . $mlvl[$i[1]] . "\"></th>\n"; echo "<th><a href=Monitoring-Messages.php?ina=source&opa==&sta={$ud}>{$i['2']}</th><td>{$i['3']} deps</td>\n"; echo "<td bgcolor=#{$fc}>{$fs}</td><td bgcolor=#{$fc}>{$ls}</td><th>{$i['6']}</th><td>{$at}</td>"; ?> <td> <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <img src=img/16/<?php echo Cimg($i[8]); ?> .png> <input type="hidden" name="uca" value="<?php echo $i[0];
$query = GenQuery('nodes','s','*',$ord); $res = @DbQuery($query,$link); while( ($n = @DbFetchRow($res)) ){ if($macs["$n[6];;$n[7]"] > 1 or $all){ $m = substr($n[2],0,8); if(in_array("$m", $wlap,1) ){ if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";} $row++; $name = preg_replace("/^(.*?)\.(.*)/","$1", $n[0]); $ip = long2ip($n[1]); $img = Nimg("$n[2];$n[3]"); $fs = date("j.M G:i",$n[4]); $ls = date("j.M G:i",$n[5]); $pbar = Bar($macs[$n[6]][$n[7]],5); $ud = rawurlencode($n[6]); list($fc,$lc) = Agecol($n[4],$n[5],$row); echo "<tr class=\"$bg\"><th class=\"$bi\">\n"; echo "<a href=Nodes-Status.php?mac=$n[2]><img src=\"img/oui/$img\" title=\"$n[3] ($n[2])\"></a></th>\n"; echo "<td>$name</td><td>$ip</td><td>$m</td><td>$n[6]</td><td><a href=Nodes-List.php?ina=device&opa==&sta=$ud&cop=AND&inb=ifname&opb==&stb=$n[7]&>$n[7]</a></td><td>$pbar".$macs["$n[6];;$n[7]"]."</td>\n"; echo "<td bgcolor=#$fc>$fs</td><td bgcolor=#$lc>$ls</td>"; echo "</tr>\n"; } } $nno++; } ?> </table> <table class="content"> <tr class="<?php echo $modgroup[$self]; ?>
$row = 0; foreach ($nonf as $m => $nf) { if ($row % 2) { $bg = $bga; $bi = $bia; } else { $bg = $bgb; $bi = $bib; } $row++; $nbar = Bar($nf, 100); $img = Nimg($noou[$m]); echo "<tr bgcolor=#{$bg}>\n"; echo "<th bgcolor=#{$bi}>{$row}</th><th bgcolor=#{$bi}><a href=Nodes-Status.php?mac={$m}><img src=img/oui/{$img} border=0></a></th><td>{$nona[$m]}</td>\n"; echo "<td> {$nodv[$m]}</td><td>{$noif[$m]}\n"; list($fc, $lc) = Agecol($nofs[$m], $nols[$m], $row % 2); $fs = date("j.M G:i:s", $nofs[$m]); echo "<td bgcolor=#{$fc}>{$fs}</td>"; $ls = date("j.M G:i:s", $nols[$m]); echo "<td bgcolor=#{$lc}>{$ls}</td>"; echo "<td>{$nbar} {$nf}</td></tr>\n"; if ($row == $lim) { break; } } echo "</table><table bgcolor=#666666 {$tabtag} >\n"; echo "<tr bgcolor=#{$bg2}><td>{$row} nomads out of {$tnod} nodes</td></tr></table>\n"; } if (in_array("ust", $rep)) { ?> <h2>Nodes Update Statistic</h2><p>
$res = @DbQuery($query, $link); if ($res) { $row = 0; while ($dev = @DbFetchRow($res)) { if ($row % 2) { $bg = $bgb; $bi = $bib; } else { $bg = $bga; $bi = $bia; } $row++; $ip = long2ip($dev[1]); $oi = long2ip($dev[19]); $ud = rawurlencode($dev[0]); list($fc, $lc) = Agecol($dev[4], $dev[5], $row % 2); echo "<tr bgcolor=#{$bg}><th bgcolor=#{$bi}>\n"; if (in_array("name", $col)) { echo "<a href=Devices-Status.php?dev={$ud}><img src=img/dev/{$dev['18']}.png title=\"{$dev['3']}\" border=0 vspace=4></a><br>\n"; } echo "<b>{$dev['0']}</b>\n"; if (in_array("ip", $col)) { echo "<td><a href=telnet://{$ip}>{$ip}</a></td>"; } if (in_array("origip", $col)) { echo "<td><a href=telnet://{$oi}>{$oi}</a></td>"; } if (in_array("serial", $col)) { echo "<td>{$dev['2']}</td>"; } if (in_array("type", $col)) {
$query = GenQuery('interfaces', 's', '*', '', '', array('device', 'ifname'), array('=', '='), array($n[6], $n[7]), array('AND')); $res = @DbQuery($query, $link); $nif = @DbNumRows($res); if ($nif != 1) { echo "<h4>{$query} {$n1rmsg}</h4>"; } else { $if = @DbFetchRow($res); if ($if[8] == "2") { $ifimg = "<img src=img/bulbr.png title=\"Disabled!\">"; } else { $ifimg = "<img src=img/bulbg.png title=\"Enabled\">"; } } @DbFreeResult($res); $iu = date($datfmt, $n[10]); list($i1c, $i2c) = Agecol($n[10], $n[10], 1); } $vl[2] = "-"; if ($n[8]) { $query = GenQuery('vlans', 's', '*', '', '', array('device', 'vlanid'), array('=', '='), array($n[6], $n[8]), array('AND')); $res = @DbQuery($query, $link); $nvl = @DbNumRows($res); if ($nvl == 1) { $vl = @DbFetchRow($res); } @DbFreeResult($res); } } ?> <table cellspacing=10 width=100%> <tr><td width=50% valign=top>
if ($res) { $row = 0; while ($m = DbFetchRow($res)) { if ($row % 2) { $bg = "txta"; $bi = "imga"; } else { $bg = "txtb"; $bi = "imgb"; } $row++; $ip = $m[2] ? long2ip($m[2]) : ""; $ip6 = DbIPv6($m[3]); list($ntimg, $ntit) = Nettype($ip, $ip6); $ud = urlencode($m[0]); list($fc, $lc) = Agecol($m[8], $m[9], $row % 2); TblRow($bg); if (in_array("imBL", $col)) { TblCell("", "", "class=\"{$bi}\" width=\"50\"", "<img src=\"img/{$ntimg}\" title=\"{$ntit}\">", "th-img"); } if (in_array("ifip", $col)) { TblCell($ip, "?in[]=ifip&op[]==&st[]={$ip}/{$m['4']}"); } if (in_array("ifip6", $col)) { TblCell($ip6, "", "class=\"prp\""); } if (in_array("prefix", $col)) { TblCell($m[4]); } if (in_array("device", $col)) { TblCell($m[0], "?in[]=device&op[]==&st[]={$ud}&ord=ifname", "nowrap", "<a href=\"Devices-Status.php?dev={$ud}\"><img src=\"img/16/sys.png\"></a>");