예제 #1
0
<input type="submit" value="<?= $sholbl ?>">
</th>
</tr></table></form><p>
<?php
}
if( $add ){
	if( $isadmin ){
		$dvst = AddRecord('devices',"device='$add'",'device,devip,serial,type,firstdis,lastdis,services,description,location,contact,devgroup,devmode,icon,sysobjid,devopts,size',"'$add','".ip2long($ip)."','$sn','$typ','".time()."','".time()."',0,'$des','$loc','$con','$grp',9,'$ico','NoSNMP-User','NNNI',$siz");
		$ifst = AddRecord('interfaces',"device='$add'",'device,ifname,ifidx,ifmac,iftype,ifstat,speed',"'$add','$ina',1,'$mac',53,3,$spd");
		echo "<h3><a href=\"?dev=".urlencode($add)."\">$add</a> $addlbl Device $dvst Interface $ifst</h3>\n";
	}else{
		echo $nokmsg;
	}
}elseif( $dld ){
	if( $isadmin ){
		DevDelete($dld,$dtx);
?>
<script language="JavaScript"><!--
setTimeout("history.go(-2)",1000);
//--></script>
<?php
	}else{
		echo $nokmsg;
	}
}elseif ($shd){
if ($cactiuser and $cactihost and $cactidb){
	$clink  = DbConnect($cactihost,$cactiuser,$cactipass,$cactidb);
	$cquery = GenQuery('host','s','id','','',array('description','hostname'),array('=','='),array($shd,$shd),array('OR') );
	$cres   = DbQuery($cquery,$clink);
	if ( DbNumRows($cres) == 1) {
	        $caho = DbFetchRow($cres);
예제 #2
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{
				if($isadmin and $mon and $dev[1]){
					if($dev[14] & 3){
						$myma = ($dev[21] > 100)?$mma[0]:$mma[1];
						$most = AddRecord('monitoring',"name='$dev[0]'","name,monip,test,device,memalert","'$dev[0]','$dev[1]','uptime','$dev[0]','$myma'");
					}else{
						$most = AddRecord('monitoring',"name='$dev[0]'","name,monip,test,device","'$dev[0]','$dev[1]','ping','$dev[0]'");
					}
				}
				$oi  = long2ip($dev[19]);
				$ud  = urlencode($dev[0]);
				$stk = ($dev[29] > 1)?"<img src=\"img/$dev[29].png\" title=\"Stack\">":"";
				list($fc,$lc) = Agecol($dev[4],$dev[5],$row % 2);