} $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"); } if (in_array("ifidx", $col)) { TblCell($if[2], "?in[]=ifidx&op[]==&st[]={$if['2']}", "align=\"right\""); } if (in_array("device", $col)) { TblCell($if[0], "?in[]=device&op[]==&st[]={$ud}&ord=ifname", "nowrap", "<a href=\"Devices-Status.php?dev={$ud}\"><img src=\"img/16/sys.png\"></a>"); } if (in_array("type", $col)) { TblCell($if[32], "?in[]=type&op[]==&st[]={$if['32']}"); }
if ($ifa[$i] & 1){ $cif = "0$i"; $actmsg = "Disable $ifn[$i], $cfmmsg"; }else{ $cif = "1$i"; $actmsg = "Enable $ifn[$i], $cfmmsg"; if($ifost[$i] == "1" or $ifost[$i] == "up"){ $ifstat = "noti"; # admin status down, but oper up? }elseif($ifost[$i] == "2" or $ifost[$i] == "down"){ $ifstat = "alrm"; }else{ $ifstat = "imgb"; } } }else{ list($ifstat,$ifdb) = Ifdbstat($ifa[$i]); $iftit .= " DB:$ifdb"; } $lcs = $upsec - Tic2Sec($iflac[$i]); if($lcs < 1){ $iflch = "-"; }else{ $iflch = sprintf("%d-%d:%02d",floor($lcs/86400),floor(($lcs%86400)/3600),floor(($lcs%3600)/60)); $redlc = 360000/($lcs + 1); $blc = "title=\"$chglbl ".date($_SESSION['date'],time() - $lcs)."\""; if($redlc > 5){ if($redlc > 55){$redlc = 55;} $blc .= "bgcolor=\"#".sprintf("%02x",$redlc + $off)."$bg3$bg3\""; } }
if(in_array("firstseen",$col)){ TblCell(date($datfmt,$n[4]),"?in[]=firstseen&op[]==&st[]=$n[4]","nowrap bgcolor=\"#$fc\""); } if(in_array("lastseen",$col)){ TblCell(date($datfmt,$n[5]),"?in[]=lastseen&op[]==&st[]=$n[5]","nowrap bgcolor=\"#$lc\""); } if( in_array("device",$col) ){ TblCell($n[6],"?in[]=device&op[]==&st[]=$ud&ord=ifname","nowrap","<a href=\"Devices-Status.php?dev=$ud&pop=on\"><img src=\"img/16/sys.png\"></a>"); } if(in_array("type",$col)){ TblCell( $n[23],"?in[]=type&op[]==&st[]=".urlencode($n[23]) );} if(in_array("location",$col)){ TblCell( $n[24],"?in[]=location&op[]==&st[]=".urlencode($n[24]) );} if(in_array("contact",$col)){ TblCell( $n[25],"?in[]=contact&op[]==&st[]=".urlencode($n[25]) );} if( in_array("ifname",$col) ){ list($ifimg,$iftit) = Iftype($n[26]); list($ifbg,$ifst) = Ifdbstat($n[29]); TblCell($n[7],"?in[]=device&op[]==&in[]=ifname&op[]==&st[]=$ud&co[]=AND&st[]=$ui","class=\"$ifbg\"","<img src=\"img/$ifimg\" title=\"$iftit, $ifst\">",'td-img'); } if(in_array("ifdesc",$col)){ TblCell($n[27]);} if(in_array("alias",$col)){ TblCell($n[28]);} if(in_array("speed",$col)){ TblCell( DecFix($n[30]),"","align=\"right\"" );} if(in_array("duplex",$col)) {TblCell($n[31]);} if(in_array("vlanid",$col)) {TblCell( ($n[9] < 255)?"SSID:$n[8]":$n[8],"?in[]=vlanid&op[]==&st[]=$n[8]","align=\"right\"");} if(in_array("pvid",$col)) {TblCell( ($n[9] < 255)?"CH:$n[32]":$n[32],"?in[]=vlanid&op[]==&st[]=$n[8]","align=\"right\"");} if(in_array("ifmetric",$col)){ TblCell( (($n[9] < 255)?Bar($n[9],-30,'mi')." $n[9]db":"$n[9]"),"?in[]=ifmetric&op[]==&st[]=$n[9]","nowrap" );} if(in_array("ifupdate",$col)){ list($i1c,$i2c) = Agecol($n[10],$n[10],$row % 2); TblCell( date($datfmt,$n[10]),"","nowrap bgcolor=\"#$i1c\""); } if(in_array("ifchanges",$col)){ TblCell($n[11],"?in[]=ifchanges&op[]==&st[]=$n[11]");} if(in_array("lastchg",$col)){