<?php ob_start(); ?>
<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
$MAC_ADDRESS = str_replace(':','',strtolower($_POST["MAC_ADDRESS"]));
$now = date("j/m/y h:i:s",time());
$stmt = "Select O3.DISPLAY_NAME AS LIASO, 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_ADDRESS')";
$sth = ibase_query($dbh, $stmt);
$row = ibase_fetch_object($sth);
print '<HTML>';
print ' <HEAD>';
print ' <TITLE>Edit Host</TITLE>';
print ' </HEAD>';
//phpinfo();
$REMOTE_ADDR = $_SERVER["REMOTE_ADDR"];
//echo $stmt . "<br>";
$i = 0;
?>
<body bgcolor="#ffffcc" text="#000000">
<form name="form1" method="post" action="postmac.php">
<?
print '<table width="620" bgcolor="#ff9900" border="2">';
print '<input type="hidden" name="serial[]" value="' . $row->SERIAL . '">';
print ' <tr> ';
if ($COMP=='YES') {
print ' <td nowrap bgcolor="#ffffff" background="../compliant.gif"> ';
}
else {
print ' <td nowrap bgcolor="#ffffff" background="../noncompliant.gif"> ';
}
$i = $i + 1;
$stmtiaso="select distinct d.DISPLAY_NAME as DN from iaso b, lab c, owner d where (b.user_no = d.serial);";
//echo $stmtiaso . '<br>';
$sthiaso = ibase_query($dbh, $stmtiaso);
$rowiaso = ibase_fetch_object($sthiaso);
?>
<PRE>IP Address: <b><?print $row->IP_ADDRESS;?></b> MAC Address: <b><?print strtoupper($row->MAC_ADDRESS);?></b>
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"></b>
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 $row->LIASO;?></b>
IASO: <b><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) and (l.LAB = '$row->LAB') 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 . '</option>';
}
?> </select></b> SA: <Select name="OWNER[]">
<?
$stmt2 = "select SERIAL, DISPLAY_NAME from OWNER WHERE (PERSON is null) 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 . '</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: <b><?print $row->OS;?></b>
<?
$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 $row2->OS . ' - ' . $row2->OSVERSION . '<br>';
}
}
?>
<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 '</pre>';
//print ' <input type="submit" name="Submit" value="Submit">';
print '</pre>';
print "</td></tr>";
print "</table>";
print '<input type="submit" name="Submit" value="Submit">';
print "</form>";
?>