Location: PHPKode > projects > Network Asset Management Archive > nama/liaso/editsubnets.php
<?php
$now = date("m/j/y h:i:s",time());
include "../connect.php";

$now = date("j/m/y h:i:s",time());
$stmt = "Select a.*, b.LAB as LAB_DESC FROM subnets a, lab b where (a.lab=b.serial) order by a.subnet_long;";
echo "<BR>";
$sth = ibase_query($dbh, $stmt);
?>
<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<form name="editsubnets" method="post" action="postsubnets.php">
<table BORDER=3>
<tr ALIGN=CENTER BGCOLOR="#999999">
<td><b><font face="Times New Roman,Times">SUBNET</font></b></td>

<td><b><font face="Times New Roman,Times">ROUTER</font></b></td>

<td><b><font face="Times New Roman,Times">PORT</font></b></td>

<td><b><font face="Times New Roman,Times">LOCATIONS</font></b></td>

<td><b><font face="Times New Roman,Times">TYPE SUBNET</font></b></td>

<td><b><font face="Times New Roman,Times">UNITS SERVED</font></b></td>

<td><b><font face="Times New Roman,Times">CONTACT</font></b></td>
</tr>
<?
while ($row = ibase_fetch_object($sth)) {
print '<input type="hidden" name="SUBNET[]" value="' . $row->SUBNET . '">';
$ip = explode(".", $row->SUBNET);
$row2 = '';
   if ($row->CONTACT > 0) {
      $stmt2 = "select * from owner where serial='$row->CONTACT';";
      $sth2 = ibase_query($dbh,$stmt2);
      $row2 = ibase_fetch_object($sth2);
   }
   $thisip = $ip[0] . '.' . $ip[1] . '.' . $ip[2];
   if ($ip[2]=='50') {
      $thisip = $thisip . '.' . $ip[3];
   }
   print '<tr>';
   print '<td>' . $thisip . '</td>';
   print '<td><input type="text" name="ROUTER[]" value ="' . $row->ROUTER . '" size="10" maxlength="20"></td>';
   print '<td><input type="text" name="PORT[]" value ="' . $row->PORT_NUMBER . '" size="10" maxlength="10"></td>';
   print '<td><input type="text" name="LOCATION_SERVED[]" value="' . $row->LOCATION_SERVED . '" size="25" maxlength="100"></td>';
   print '<td><input type="text" name="SUBNET_TYPE[]" value="' . $row->SUBNET_TYPE . '" size="20" maxlength="20"></td>';
   print '<td><input type="text" name="LAB_DESC[]" value="' . $row->LAB_DESC . '" size="15" maxlength="15"></td>';
   print '<td><Select name="OWNER[]">';
$stmt3 = "select SERIAL, DISPLAY_NAME from OWNER where (person is null) order by DISPLAY_NAME";
$sth3 = ibase_query($dbh, $stmt3);
print '<option value="999999">None Assigned</option>';
while ($row3 = ibase_fetch_object($sth3)) {
   print '<option value="' . $row3->SERIAL . '"';
   if ($row3->SERIAL==$row2->SERIAL) {
           print "selected "; }
   print '>' . $row3->DISPLAY_NAME . '</option>';
}
print '</select></td>';
 
   print '</tr>';
}
print '</table> <input type="submit" name="Submit" value="Submit">';

?>
</form>
Return current item: Network Asset Management Archive