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

$now = date("j/m/y h:i:s",time());
//phpinfo();
$OWNER = $_POST["OWNER"];
$SYS_DESC = $_POST["SYS_DESC"];
$BUILDING = $_POST["BUILDING"];
$ROOM = $_POST["ROOM"];
$IASO = $_POST["IASO"];
$BARCODE = $_POST["BARCODE"];
$OS = $_POST["NOSlist"];
$JOBID = $_POST["JOBID"];
$HOSTD = $_POST["HOSTID"];
$VULNID = $_POST["VULNID"];
$DNS_NAME = $_POST["DNS_NAME"];
$NETBIOS_NAME = $_POST["NETBIOS_NAME"];
$FIXED = $_POST["Fixed"];
$WEB_SERVER = $_POST["webserver"];
$DOMAIN_CONTROLLER = $_POST["pdc"];
$serial = $_POST["serial"];
//echo $WEB_SERVER[0];
if ($WEB_SERVER[0]=='w') 
    { $WEB_SERVER[0]='1'; } 
   else {$WEB_SERVER[0]='0';}
if ($DOMAIN_CONTROLLER[0]=='p') 
   { $DOMAIN_CONTROLLER[0]='1'; } 
   else { $DOMAIN_CONTROLLER[0]='0'; }
if ($IASO[0]!='') {
if ($OWNER[0]!='') {
   if ($OS[0]!='') {
        $stmt = "update arp_table set OWNER = '$OWNER[0]', IASO='$IASO[0]', SYS_DESC = '$SYS_DESC[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', OS='$OS[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
   }
   else 
      {
      $stmt = "update arp_table set OWNER = '$OWNER[0]', IASO='$IASO[0]', SYS_DESC = '$SYS_DESC[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
   }
}
else {
if ($OS[0]!='') {
$stmt = "update arp_table set SYS_DESC = '$SYS_DESC[0]', IASO='$IASO[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', OS='$OS[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
}
else 
{
$stmt = "update arp_table set SYS_DESC = '$SYS_DESC[0]', IASO='$IASO[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
}
}
}
else {
if ($OWNER[0]!='') {
   if ($OS[0]!='') {
        $stmt = "update arp_table set OWNER = '$OWNER[0]', SYS_DESC = '$SYS_DESC[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', OS='$OS[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
   }
   else
      {
      $stmt = "update arp_table set OWNER = '$OWNER[0]', SYS_DESC = '$SYS_DESC[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
   }
}
else {
if ($OS[0]!='') {
$stmt = "update arp_table set SYS_DESC = '$SYS_DESC[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', OS='$OS[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
}
else
{
$stmt = "update arp_table set SYS_DESC = '$SYS_DESC[0]', BUILDING = '$BUILDING[0]', ROOM = '$ROOM[0]', BARCODE = '$BARCODE[0]', DNS_NAME='$DNS_NAME[0]', NETBIOS_NAME='$NETBIOS_NAME[0]', WEB_SERVER='$WEB_SERVER[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]' where serial = '$serial[0]'; ";
}
}
}

//echo $stmt . '<br>';
//echo 'Thanks.';
$stm=ibase_query($dbh, $stmt) or die("Dead lock error, please hit the back button and resubmit the data.");
ibase_close($dbh);
//Header("Location: https://iat-db.wes.army.mil/searchmac.php");
print '<form name="SEARCHMAC" method="post" action="editmac.php">';
print 'Enter Mac Address:       <input type="text" name="MAC_ADDRESS" value="" size="25" maxlength="25">';
print '<input type="submit" name="Submit" value="Search">';
print '</form>';

?>

Return current item: Network Asset Management Archive