Location: PHPKode > projects > Network Asset Management Archive > nama/liaso/addapp.php
<?php
$SERIAL = $_GET["SERIAL"];
$APPNAME = $_POST["APPNAME"];
$Submit = $_POST["Submit"];
$Deleteem = $_POST["Deleteem"];
$Delete = $_POST["Delete"];


include "../connect.php";
if (($Submit == 'Add Application') && ($APPNAME != '')) {
    $insertos = "insert into APPLICATIONS (DESCRIPTION) values ('$APPNAME')";
    ibase_query($dbh, $insertos);
}
if (($Deleteem == 'Delete Checked') && ($Delete[0])){
    for ($i=0; $i < sizeof($Delete); $i++) {
       $deleteiaso = "delete from APPLICATIONS where serial = '$Delete[$i]'";
       ibase_query($dbh, $deleteiaso);
    }
}
$now = date("j/m/y h:i:s",time());
$stmt = "Select * FROM applications order by DESCRIPTION;";
$sth2 = ibase_query($stmt);
$row2 = ibase_fetch_object($sth2);
print '<B>Please type name of Application to add</B><BR><BR>';
print '<form name="OSADD" method="post" action="">';
print '<input type="text" name="APPNAME" size="40"><br>';

print '<input type="submit" name="Submit" value="Add Application">';

?>
<BR><BR>
<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">
<table BORDER=3>
<tr ALIGN=CENTER BGCOLOR="#999999">
<td><b><font face="Times New Roman,Times">Version</font></b></td>

<td><b><font face="Times New Roman,Times">Remove</font></b></td>
</tr>

<?
print '<input type="hidden" name="serial" value="' . $SERIAL . '">';
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {

echo '<td>' . $row->DESCRIPTION . '&nbsp</td>';
print '<td><input type="checkbox" name="Delete[]" value="' .  $row->SERIAL . '"></td>';

echo '</tr>';
}
echo '</table>';
print '<input type="submit" name="Deleteem" value="Delete Checked">';
print '</form>';
?>

Return current item: Network Asset Management Archive