<?php
$SERIAL = $_GET["SERIAL"];
$OSVERSION = $_POST["OSVERSION"];
$Submit = $_POST["Submit"];
$Deleteem = $_POST["Deleteem"];
$Delete = $_POST["Delete"];
include "../connect.php";
if (($Submit == 'Add Version') && ($OSVERSION != '')) {
$insertos = "insert into OSVERSION (OS ,OSVERSION) values ('$SERIAL', '$OSVERSION')";
ibase_query($dbh, $insertos);
}
if (($Deleteem == 'Delete Checked') && ($Delete[0])){
for ($i=0; $i < sizeof($Delete); $i++) {
$deleteiaso = "delete from osversion where serial = '$Delete[$i]'";
ibase_query($dbh, $deleteiaso);
}
}
if ($SERIAL == '') {
print '<body text="#000000" bgcolor="#FFFFCC" link="#0000EE" vlink="#551A8B" alink="#FF0000">';
print 'Please Pick a OS to edit';
exit;
}
$now = date("j/m/y h:i:s",time());
$stmt = "Select o.os, v.osversion, v.serial, o.serial as OSSERIAL FROM os o, osversion v where (o.serial = '$SERIAL') and (v.os = o.serial) order by v.osversion;";
$sth2 = ibase_query($stmt);
$row2 = ibase_fetch_object($sth2);
print '<B>' . $row2->OS . '</B><BR><BR>';
print '<form name="OSADD" method="post" action="">';
print '<input type="text" name="OSVERSION">';
print '<input type="submit" name="Submit" value="Add Version">';
?>
<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->OSVERSION . ' </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>';
?>