Location: PHPKode > projects > Network Asset Management Archive > nama/this2.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
//phpinfo();
$REMOTE_ADDR = $_SERVER["REMOTE_ADDR"];
$SERIAL = $_GET["SERIAL"];
$now = date("j/m/y h:i:s",time());
if ($SERIAL=="") {
    $stmt = "Select O3.DISPLAY_NAME AS LIASO, o3.phone as liaso_phone,  L.DESCRIPTION, l.LAB,  A.* FROM  ARP_TABLE a, SUBNETS s7, LAB l, OWNER o3 WHERE  (L.LIASO = O3.SERIAL) AND (S7.LAB = L.SERIAL) AND (S7.SUBNET = A.SUBNET) and (IP_ADDRESS = '$REMOTE_ADDR') and (last_seen in (select max(last_seen) from arp_table where ip_address='$REMOTE_ADDR'))";
} else {
    $stmt = "Select O3.DISPLAY_NAME AS LIASO, o3.phone as liaso_phone, L.DESCRIPTION, l.LAB, A.* FROM  ARP_TABLE a, SUBNETS s7, LAB l, OWNER o3 WHERE  (L.LIASO = O3.SERIAL) AND (S7.LAB = L.SERIAL) AND (S7.SUBNET = A.SUBNET) and (a.MD5 = '$SERIAL')";
}
$sth = ibase_query($dbh, $stmt);
//echo $stmt . "<br>";
$i = 0;
$row = ibase_fetch_object($sth);
if ($row->SERIAL=='') {
echo 'Machine Not Found';
exit;
}
$LIASO=$row->LIASO;
$LIASO_PHONE=$row->LIASO_PHONE;
?>
<body bgcolor="#F9F3E0" text="#000000">
<form name="form1" method="post" action="postthis.php">
<?
print '<input type="hidden" name="serial[]" value="' . $row->MD5 . '">';
#if ($COMP=='YES') {
#    print '      <td nowrap bgcolor="#ffffff" background="../compliant.gif"> ';
#}
#else {
#    print '      <td nowrap bgcolor="#ffffff" background="../noncompliant.gif"> ';
#}
$i = $i + 1;
if ($row->IASO!=0)
{$stmtiaso="select O3.DISPLAY_NAME, O3.PHONE from IASO I, LAB L, OWNER O3 where (I.USER_NO = '$row->IASO') and (I.LIASO_NO=L.SERIAL) and (L.LIASO=O3.SERIAL) order by I.serial ;";
//echo $stmtiaso . '<br>';
$sthiaso = ibase_query($dbh, $stmtiaso);
$rowiaso = ibase_fetch_object($sthiaso);
$LIASO=$rowiaso->DISPLAY_NAME;
$LIASO_PHONE=$rowiaso->PHONE;
}

?>
        <PRE>IP Address: 	<b><?print $row->IP_ADDRESS;?></b>		MAC Address:	<b><?print strtoupper($row->MAC_ADDRESS);?></b> 
Switch: 	<b><?print $row->SWITCH;?></b>		Switch Port:	<b><?print strtoupper($row->SWITCH_PORT);?></b> 
NAV SERVER: 	<b><?print $row->AV_SERVER;?></b>		Virus Defs:	<b><?print strtoupper($row->ANTIVIRUS);?></b>
UPDATE SERVER: 	<b><?print $row->UPDATE_SERVER;?></b>			LAST UPDATE:	<b><?print strtoupper($row->UPDATE_TIME);?></b>
DNS Name: 	<input type="text" name="DNS_NAME[]" value="<?print $row->DNS_NAME;?>" size="25" maxlength="25">	Netbios Name:	<input type="text" name="NETBIOS_NAME[]" value="<?print $row->NETBIOS_NAME;?>" size="25" maxlength="25">
First Seen:	<b><?print $row->FIRST_SEEN;?></b>	Last Seen:	<b><?print $row->LAST_SEEN;?></b>
LAB:		<B><?print $row->DESCRIPTION;?></b>	
LIASO:		<b><?print $LIASO;?></b>		     Phone:  <B><?print $LIASO_PHONE;?></b>
<?
if (($row->PRIMARY_POC != '') && ($row->IASO == '')) {
    print "POC:		<B>" . $row->PRIMARY_POC . "</B><br>";
}
?>
IASO:		<Select name="IASO[]">
<?
//$stmt2 = "SELECT  O3.DISPLAY_NAME , O3.SERIAL, o3.phone FROM  OWNER o3, IASO i, LAB l WHERE (I.LIASO_NO = L.SERIAL) AND (I.USER_NO = O3.SERIAL) and (l.LAB = '$row->LAB') order by display_name";
$stmt2 = "SELECT  O3.DISPLAY_NAME , O3.SERIAL, o3.phone FROM  OWNER o3, IASO i, LAB l WHERE (I.LIASO_NO = L.SERIAL) AND (I.USER_NO = O3.SERIAL) order by display_name";
$sth2 = ibase_query($dbh, $stmt2);
echo '<option value="">Not Assigned</option>';
while ($row2 = ibase_fetch_object($sth2)) {
   print '<option value="' . $row2->SERIAL . '"';
   if ($row2->SERIAL==$row->IASO) {
           print " selected "; }
   print '>' . $row2->DISPLAY_NAME . ' (' . $row2->PHONE . ')' . '</option>';
}
?> </select></b>	
SA:		<Select name="OWNER[]">
<?  
$stmt2 = "select SERIAL, DISPLAY_NAME, PHONE from OWNER WHERE (PERSON is null) and (DELETED='N') and (serial<>14122) order by DISPLAY_NAME";
$sth2 = ibase_query($dbh, $stmt2);
echo '<option value="">Not Assigned</option>';
while ($row2 = ibase_fetch_object($sth2)) {
   print '<option value="' . $row2->SERIAL . '"';
   if ($row2->SERIAL==$row->OWNER) {
           print " selected "; }
   print '>' . $row2->DISPLAY_NAME . ' (' . $row2->PHONE . ')' . '</option>';
}
?> 
</select>
End User:	<Select name="ENDUSER[]">
<?  
$stmt4 = "select SERIAL, DISPLAY_NAME, PHONE from OWNER WHERE (PERSON is null) and (DELETED='N') and (serial<>14122) order by DISPLAY_NAME";
$sth4 = ibase_query($dbh, $stmt4);
echo '<option value="">Not Assigned</option>';
while ($row4 = ibase_fetch_object($sth4)) {
   print '<option value="' . $row4->SERIAL . '"';
   if ($row4->SERIAL==$row->SYSTEM_USER) {
           print " selected "; }
   print '>' . $row4->DISPLAY_NAME . ' (' . $row4->PHONE . ')' . '</option>';
}
?> 
</select>
System Description: <input type="text" name="SYS_DESC[]" value="<? print $row->SYS_DESC;?>" size="50" maxlength="50">
Building:           <input type="text" name="BUILDING[]" value="<? print $row->BUILDING;?>" size="10" maxlength="10"> Room:               <input type="text" name="ROOM[]" value="<? print $row->ROOM;?>" size="10" maxlength="10"> 
Barcode Number:     <input type="text" name="BARCODE[]" value="<? print $row->BARCODE;?>" size="10" maxlength="10"> Monitor Barcode:    <input type="text" name="MBARCODE[]" value="<? print $row->MONITOR_BARCODE;?>" size="15" maxlength="15"> 
OS:	            <?  print '<select name="NOSlist[]">';
      $stmt2 = "Select o.OS, v.osversion FROM os o, osversion v where (o.serial=v.os) order by o.os, v.osversion;";
      $sth2 = ibase_query($dbh, $stmt2);
echo '<option value="">Not Assigned</option>';
      while ($row2 = ibase_fetch_object($sth2)) {
        if ($row2->OS != '') {
           $current_os = $row2->OS . ' - ' . $row2->OSVERSION;
           echo '<option value="' . $row2->OS . ' - ' . $row2->OSVERSION  . '"';  
	   if ($row->OS==$current_os) { 
              print " selected "; }
           print '>' . $row2->OS . ' - ' . $row2->OSVERSION . '</option>';
        }
      }
      print "</select>";?>

<input type="checkbox" name="webserver" value="webserver" <?if ($row->WEB_SERVER=='1') {print "checked";} ?>> WEBSERVER 
<input type="checkbox" name="pdc" value="pdc" <?if ($row->DOMAIN_CONTROLLER=='1') {print "checked";} ?>>DOMAIN CONTROLLER 
<input type="checkbox" name="laptop" value="laptop" <?if ($row->LAPTOP=='1') {print "checked";} ?>>LAPTOP 
<input type="checkbox" name="multinick" value="multinick" <?if ($row->MULTINICK=='1') {print "checked";} ?>>Multiple interface NIC 
<?
print '</pre>';
?>
Return current item: Network Asset Management Archive