Location: PHPKode > projects > Network Asset Management Archive > nama/iaso/postthis.php
<?php
$now = date("m/j/y h:i:s",time());
include "../connect.php";
//phpinfo();
$now = date("j/m/y h:i:s",time());
$submitc = $_POST["Submitc"];
$OWNER = $_POST["OWNER"];
$ENDUSER = $_POST["ENDUSER"];
$SYS_DESC = $_POST["SYS_DESC"];
$BUILDING = $_POST["BUILDING"];
$ROOM = $_POST["ROOM"];
$IASO = $_POST["IASO"];
$BARCODE =$_POST["BARCODE"];
$MBARCODE =$_POST["MBARCODE"];
$PBARCODE =$_POST["PBARCODE"];
$SERIALNUMBER =$_POST["SERIALNUMBER"];
$OS =$_POST["NOSlist"];
$JOBID =$_POST["JOBID"];
$HOSTD =$_POST["HOSTID"];
$VULNID =$_POST["VULNID"];
$CAC_READER =$_POST["CAC_READER"];
$CAC_TYPE =$_POST["CAC_TYPE"];
$CAC_OTHER =$_POST["CAC_OTHER"];
$WINDOWS_TYPE =$_POST["WINDOWS_TYPE"];
$OFFICE_TYPE =$_POST["OFFICE_TYPE"];
//$OS =$_POST["OSlist"]);
//$OS2 =$_POST["OS2list"]);
$DNS_NAME =$_POST["DNS_NAME"];
$NETBIOS_NAME =$_POST["NETBIOS_NAME"];
$DELETEVIRUS =$_POST["DELETEVIRUS"];
$FIXED =$_POST["Fixed"];
$WEB_SERVER =$_POST["webserver"];
$WEBFARM =$_POST["farm"];
$DOMAIN_CONTROLLER =$_POST["pdc"];
$LAPTOP =$_POST["laptop"];
$MULTINICK =$_POST["multinick"];
$AUTOLOGIN =$_POST["autologin"];
$COMMENTS =$_POST["COMMENTS"];
$NOTES =$_POST["NOTES"];
$serial =$_POST["serial"];
if ($submitc == 'Certification Document') {
 include "certify.php";
 exit;
}
echo $WEB_SERVER[0];
if ($WEB_SERVER[0]=='w') 
    { $WEB_SERVER[0]='1'; } 
   else {$WEB_SERVER[0]='0';}
if ($WEBFARM[0]=='f') 
    { $WEBFARM[0]='1'; } 
   else {$WEBFARM[0]='0';}
if ($DOMAIN_CONTROLLER[0]=='p') 
   { $DOMAIN_CONTROLLER[0]='1'; } 
   else { $DOMAIN_CONTROLLER[0]='0'; }
if ($LAPTOP[0]=='l') 
   { $LAPTOP[0]='1'; } 
   else { $LAPTOP[0]='0'; }
if ($AUTOLOGIN[0]=='a') 
   { $AUTOLOGIN[0]='1'; } 
   else { $AUTOLOGIN[0]='0'; }
if ($MULTINICK[0]=='m') 
   { $MULTINICK[0]='1'; } 
   else { $MULTINICK[0]='0'; }
//echo $stmt;
$stmt = "update arp_table set SYS_DESC = '" . mysql_escape_string($SYS_DESC[0]) . "', BUILDING = '" . mysql_escape_string($BUILDING[0]) . "', ROOM = '" . mysql_escape_string($ROOM[0]) . "', BARCODE = '" . mysql_escape_string($BARCODE[0]) . "', PRINTER_BARCODE='" . mysql_escape_string($PBARCODE[0]) . "', SERIALNUMBER='" . mysql_escape_string($SERIALNUMBER[0]) . "', MONITOR_BARCODE = '" . mysql_escape_string($MBARCODE[0]) . "', DNS_NAME='" . mysql_escape_string($DNS_NAME[0]) . "', NETBIOS_NAME='" . mysql_escape_string($NETBIOS_NAME[0]) . "', LAPTOP='$LAPTOP[0]', MULTINICK='$MULTINICK[0]', WEB_SERVER='$WEB_SERVER[0]', WEBFARM='$WEBFARM[0]', DOMAIN_CONTROLLER = '$DOMAIN_CONTROLLER[0]', CAC_OTHER='" . mysql_escape_string($CAC_OTHER[0]) . "', CAC_READER='" . mysql_escape_string($CAC_READER[0]) . "', NOTES='" . mysql_escape_string($NOTES[0]) . "', AUTOLOGIN='$AUTOLOGIN[0]' where serial = '$serial[0]'; ";
//echo $stmt . '<br>';
$sth = ibase_query ($dbh,$stmt);
if ($IASO[0]!='') {
    if ($IASO[0] != 14122) { 
       $stmt="update arp_table set IASO='$IASO[0]' where serial='$serial[0]';";
       $sth = ibase_query ($dbh, $stmt);
    } else {
       $stmt = "update arp_table set ip_address='0.0.0.0', iaso=null where serial='$serial[0]';";
       $sth = ibase_query ($dbh, $stmt);
}
}
if ($ENDUSER[0]!=''){
    $stmt="update arp_table set SYSTEM_USER='$ENDUSER[0]' where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
} else {
    $stmt="update arp_table set SYSTEM_USER = null where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($OWNER[0]!='') {
    $stmt="update arp_table set OWNER='$OWNER[0]' where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
} else {
    $stmt="update arp_table set OWNER = null where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($OS[0]!='') {
    $stmt="update arp_table set OS='$OS[0]' where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
} else {
    $stmt="update arp_table set OS = null where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($CAC_TYPE[0] !='') {
    $stmt="update arp_table set CAC_TYPE='$CAC_TYPE[0]' where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($CAC_TYPE[0] =='') {
    $stmt="update arp_table set CAC_TYPE = null where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($WINDOWS_TYPE[0] !='') {
    $stmt="update arp_table set WINDOWS_TYPE='$WINDOWS_TYPE[0]' where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
} else {
    $stmt="update arp_table set WINDOWS_TYPE = null where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($OFFICE_TYPE[0] !='') {
    $stmt="update arp_table set OFFICE_TYPE='$OFFICE_TYPE[0]' where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
} else {
    $stmt="update arp_table set OFFICE_TYPE = null where serial='$serial[0]';";
    $sth = ibase_query ($dbh, $stmt);
}
if ($COMMENTS[0] != '') {
   $mycom = mysql_escape_string($COMMENTS[0]);
   $myblob = ibase_blob_create($dbh);
   ibase_blob_add($myblob,$mycom);
   $comments_blob = ibase_blob_close($myblob);
   $mysql = "update arp_table set COMMENTS=? where serial='$serial[0]';";
   ibase_query($mysql, $comments_blob);
   ibase_commit();
}
echo 'Thank You.<BR><BR>';
echo '<a href="/">Click here to return home</a>';
$i=0;
$ii=count($DELETEVIRUS);
for($i=0;$i<$ii;$i++){
    $deletestmt = "UPDATE VIRUSLOG set checked = 1 where (serial='$DELETEVIRUS[$i]');";
    ibase_query($dbh, $deletestmt); 
}
ibase_close($dbh);

?>

Return current item: Network Asset Management Archive