Location: PHPKode > projects > Network Asset Management Archive > nama/addmachine.php
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
print '<HTML>';
print '	<HEAD>';
print '	  <TITLE>ADD HOST</TITLE>';
print '	</HEAD>';

print '<body bgcolor="#FFFFCC">';
$now = date("j/m/y h:i:s",time());
if(getenv("HTTP_CLIENT_IP")) { 
$ip = getenv("HTTP_CLIENT_IP"); 
} elseif(getenv("HTTP_X_FORWARDED_FOR")) { 
$ip = getenv("HTTP_X_FORWARDED_FOR"); 
} else { 
$ip = getenv("REMOTE_ADDR"); 
}
$stmt = "Select * FROM arp_table where IP_ADDRESS = 'D'";
$sth = ibase_query($dbh, $stmt);
//echo $stmt . "<br>";
$i = 0;
$row = ibase_fetch_object($sth);
?>
<body bgcolor="#ffffff" text="#000000">
<form name="form1" method="post" action="postaddhost.php">
<?
print '<table width="620" bgcolor="#ff9900" border="2">';
print '<input type="hidden" name="serial[]" value="' . $row->SERIAL . '">';
print '    <tr> ';
$i = $i + 1;
?>
        <PRE>IP Address: 	<input type="text" name="IP_ADDR[]" value="<?print $row->IP_ADDRESS;?>" size="15" maxlength="15">		MAC Address:	<input type="text" name="MAC_ADDR[]" value="<?print strtoupper($row->MAC_ADDRESS);?>" size = "15" maxlength="15"> 
DNS Name:  <input type="text" name="DNS_NAME[]" value="<?print $row->DNS_NAME;?>" size="25" maxlength="25"></b>    Netbios Name:   <input type="text" name="NETBIOS_NAME[]" value="<?print $row->NETBIOS_NAME;?>" size="25" maxlength="25">	
First Seen:	<b><?print $now;?></b>	Last Seen:	<b><?print $now;?></b>
IASO:		<b>Dana Allen</b>		SA:   <Select name="OWNER[]">
<?  
$stmt2 = "select SERIAL, FIRST_NAME, LAST_NAME, LAB from OWNER where LAB='ITL' order by LAST_NAME";
$sth2 = ibase_query($dbh, $stmt2);
while ($row2 = ibase_fetch_object($sth2)) {
   print '<option value="' . $row2->SERIAL . '"';
   if ($row2->SERIAL==$row->OWNER) {
           print "selected "; }
   print '>' . $row2->LAST_NAME . ', ' . $row2->FIRST_NAME . '</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"> 

OS Version:	    <?  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);
      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
<?
print "</select><br><p>";
print '</pre>';
      print "</td></tr>";
print "</table>";
print '<input type="submit" name="Submit" value="Submit">';
print "</form>";


?>

Return current item: Network Asset Management Archive