示例#1
0
</th>
</tr></table></form><p>
<?php 
}
$link = DbConnect($dbhost, $dbuser, $dbpass, $dbname);
if ($del) {
    $query = GenQuery('nodetrack', 'd', '', '', '', array($ina), array($opa), array($sta));
    if (!DbQuery($query, $link)) {
        echo "<h4>" . DbError($link) . "</h4>";
    } else {
        echo "<h5>{$dellbl} {$ina} {$opa} {$sta} OK</h5>";
    }
}
if (count($in)) {
    Condition($in, $op, $st, $co);
    TblHead("{$modgroup[$self]}2", 1);
    $query = GenQuery('nodetrack', 's', 'nodetrack.device as device,nodetrack.ifname as ifname,value,source,alias,comment,name,nodes.mac as mac,oui,nodes.vlanid as vlanid,usrname,time', $ord, $lim, $in, $op, $st, $co, 'JOIN interfaces USING (device,ifname) LEFT JOIN nodes USING (device,ifname)');
    $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++;
示例#2
0
		}
	}else{
		$ina	='config';
		$opa	= '~';
		if($shl == 'i'){
			$opa	= '!~';
		}elseif($shl == 'c'){
			$ina	='changes';
		}elseif($shl == 't'){
			$ina	='type';
		}elseif($shl == 'd'){
			$opa	= '=';
			$ina	='device';
		}
		echo "<h3>$cols[$ina] $opa '$sta'</h3>";
		TblHead("$modgroup[$self]2",2);

		$query	= GenQuery('configs','s','configs.*,length(config) as cfgl,length(changes) as chgl,inet_ntoa(devip),type,devos,icon,cliport',$ord,$lid,array($ina),array($opa),array($sta),array(),'LEFT JOIN devices USING (device)');

		$res	= DbQuery($query,$link);
		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]);
示例#3
0
	}else{
		$query	= GenQuery('devices','s','*',$ord,$lim,$in,$op,$st,$co);
	}

	Condition($in,$op,$st,$co);
	if( $del ){
		if($isadmin){
			echo "<table class=\"content\"><th class=\"$modgroup[$self]2\"><img src=\"img/16/dev.png\"><br>Device</th>\n";
			echo "<th class=\"$modgroup[$self]2\"><img src=\"img/16/bcnl.png\"><br>$dellbl $stalbl</th>\n";
			$mon = 0;
		}else{
			echo $nokmsg;
			$del = 0;
		}
	}
	if( !$del ) TblHead("$modgroup[$self]2",1);

	$res	= DbQuery($query,$link);
	if($res){
		$row   = 0;
		$most = '';
		while( ($dev = DbFetchRow($res)) ){
			if ($row % 2){$bg = "txta"; $bi = "imga";}else{$bg = "txtb"; $bi = "imgb";}
			$row++;
			TblRow($bg);
			$ip  = long2ip($dev[1]);
			if( $del ){
				echo "<th class=\"$bi\"><img src=\"img/dev/$dev[18].png\" title=\"$dev[3]\"><br>$dev[0]</th><td>";
				DevDelete($dev[0]," with IP $ip and SN $dev[2]");
				echo "</td>";
			}else{