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

$stmt = "FROM arp_table a, subnets b where (a.subnet = b.subnet) ";
if (sizeof($LABlist) != 0) {
        $hadlab = true;
        if (sizeof($LABlist) == 1) {
        $stmt = $stmt . " and ((LAB = '$LABlist[0]')";
        }
        else {
                $stmt = $stmt . " and ((LAB in (";
                for ($i=0; $i < sizeof($LABlist); $i++) {
                    $stmt = $stmt . $LABlist[$i];
                    if ($i < sizeof($LABlist)-1) {
                        $stmt = $stmt . ",";
                    }
                    else {
                        $stmt = $stmt . "))";
                    }
                }
        }
$stmt = $stmt . ')';
} else {
$stmt = "FROM arp_table a, subnets b where (a.subnet = b.subnet) ";
}


$stmt = $stmt . " and (ip_address<>'0.0.0.0')";
print '<HTML>';
print '	<HEAD>';
print '	  <TITLE>Your Hosts</TITLE>';
print '	</HEAD>';

print '<body bgcolor="#F9F3E0">';
print "<b>*** You must click submit to save changes ****</b>";
$stmt = stripslashes($stmt);
$now = date("j/m/y h:i:s",time());

if ($Submit == 'Show All') {
$stmt = "Select * " . $stmt . " order by IPNUM";
} else {
$stmt = "Select * " . $stmt . "and (iaso is null) order by IPNUM";
}
$sth = ibase_query($dbh, $stmt);
//echo $stmt . "<br>";
$i = 0;
?>
<body bgcolor="#ffffff" text="#000000">
<form name="form1" method="post" action="postiasoedit.php">
<?
print '<input type="submit" name="Submit" value="Submit">';
print '<table bgcolor="#F9F3E0" border="2">';
while ($row = ibase_fetch_object($sth)) {
print '<input type="hidden" name="serial[]" value="' . $row->SERIAL . '">';
print '    <tr> ';

print '<td><Select name="IASO[]">';
$stmt2 = "SELECT  O3.DISPLAY_NAME, O3.SERIAL 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="999999">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 . '</option>';
}
print ' </select></td>';

   if (!$row->IASO)  {
     print '      <td nowrap bgcolor="#FE2929"> ';
     $compliant='NO';
   } 
   elseif (!$row->OWNER) {
     print '      <td nowrap bgcolor="#FBFE25"> ';
     $compliant='NO';
   }
   else{
     print '      <td nowrap bgcolor="#0BA60B"> ';
     $compliant='YES';
   }
$i = $i + 1;
print trim($row->IP_ADDRESS) . ' </td>';
print '<td>' . trim(strtoupper($row->MAC_ADDRESS)) . '&nbsp</td>';
print '<td>' . $row->DNS_NAME . '&nbsp</td>';
print '<td>' . $row->NETBIOS_NAME . '&nbsp</td>';

print '</tr>';
}
print '</table>';
print '<input type="submit" name="Submit" value="Submit">';
print "</form>";
?>

Return current item: Network Asset Management Archive