Location: PHPKode > projects > Network Asset Management Archive > nama/liaso/saveiava.php
<?php
$now = date("m/j/y h:i:s",time());
include "../connect.php";
$lab = $_POST["lab"];
$labname = $_POST["labname"];
$vnum = $_POST["vnum"];
$vserial = $_POST["vserial"];
$oserial = $_POST["oserial"];
$TYPEA = $_POST["TYPEA"];
$TYPEB = $_POST["TYPEB"];
$TYPEC = $_POST["TYPEC"];
$TYPED = $_POST["TYPED"];
$TYPEE = $_POST["TYPEE"];
$i=0;
$ii=count($oserial);
for($i=0;$i<$ii;$i++){
       if (trim($TYPEA[$i])=='') {$TYPEA[$i]=0;}
       if (trim($TYPEB[$i])=='') {$TYPEB[$i]=0;}
       if (trim($TYPEC[$i])=='') {$TYPEC[$i]=0;}
       if (trim($TYPED[$i])=='') {$TYPED[$i]=0;}
       if (trim($TYPEE[$i])=='') {$TYPEE[$i]=0;}
       $stmt4 = "select * from iavacompliance where (lab = $lab[$i]) and (vulnerability = '$vserial[$i]') and (os_application = '$oserial[$i]');";
       $sth4 = ibase_query($dbh, $stmt4);
       if ($row4 = ibase_fetch_object($sth4))
       {  $stmt = "update iavacompliance set a='$TYPEA[$i]',b='$TYPEB[$i]',c='$TYPEC[$i]',d='$TYPED[$i]',e='$TYPEE[$i]' where (lab = $lab[$i]) and (vulnerability = '$vserial[$i]') and (os_application = '$oserial[$i]');";
       } else {
            $stmt = "insert into iavacompliance (lab, vulnerability, os_application, a, b, c, d, e) values ('$lab[$i]','$vserial[$i]','$oserial[$i]','$TYPEA[$i]','$TYPEB[$i]','$TYPEC[$i]','$TYPED[$i]','$TYPEE[$i]')";
       }
//echo $stmt;
$sth = ibase_query ($dbh,$stmt);
}

ibase_close($dbh);
$redirlocation = '/liaso/reportiava.php?lab=' . $lab[0] . '&vnum=' . $vnum[0] . '&LABNAME=' . $labname[0];
header("Location: " . $redirlocation);
?>
Return current item: Network Asset Management Archive