Location: PHPKode > projects > Network Asset Management Archive > nama/liaso/addiaso.php
<?php
include "../connect.php";
$Submit = $_POST['Submit'];
$OWNER = $_POST['OWNER'];
$LIASO = $_POST['LIASO'];
$Delete = $_POST['Delete'];
if (($Submit == 'Add IASO') && ($OWNER != '')) {
    $insertiaso = "insert into iaso (USER_NO, LIASO_NO) values ('$OWNER', '$LIASO')";
    ibase_query($dbh, $insertiaso);
}

$Deleteem = $_POST['Deleteem'];
$SERIAL = $_GET['SERIAL'];
if (($Deleteem == 'Delete Checked') && ($Delete[0])){
    for ($i=0; $i < sizeof($Delete); $i++) {
       $deleteiaso = "delete from iaso 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 lab to edit';
    exit; 
}
$now = date("j/m/y h:i:s",time());
$liaso = "Select o.DISPLAY_NAME, o.PHONE, o.email_address, l.DESCRIPTION from owner o, lab l where (l.serial = '$SERIAL') and (l.liaso = o.serial)";
$liasoq = ibase_query($dbh, $liaso);
$liasorow = ibase_fetch_object($liasoq);
print '<B>LAB:	</B>' . $liasorow->DESCRIPTION . '<BR>';
print '<B>Lead IASO:	</B>' . $liasorow->DISPLAY_NAME . '<BR>';
print '<B>EMAIL	</B>' . $liasorow->EMAIL_ADDRESS . '<BR>';
print '<B>PHONE	</B>' . $liasorow->PHONE . '<BR>';
$stmt = "Select b.DISPLAY_NAME, b.email_address, b.phone, a.serial, a.date_added FROM iaso a, owner b where (liaso_no = '$SERIAL') and (a.USER_NO = b.serial) order by DISPLAY_NAME;";

print '<form name="IASOADD" method="post" action="">';
print '<Select name="OWNER">';
$stmt2 = "select SERIAL, DISPLAY_NAME from OWNER WHERE (PERSON is null) order by DISPLAY_NAME";
$sth2 = ibase_query($dbh, $stmt2);
echo '<option value="">Not Assigned</option>';
while ($row2 = ibase_fetch_object($sth2)) {
   print '<option value="' . $row2->SERIAL . '"';
   if ($row2->SERIAL==$row->OWNER) {
           print "selected "; }
   print '>' . $row2->DISPLAY_NAME . '</option>';
}
print '</select>';
print '<input type="hidden" name="LIASO" value="' . $SERIAL . '">';
print '<input type="submit" name="Submit" value="Add IASO">';

?>
<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">Name</font></b></td>

<td><b><font face="Times New Roman,Times">E mail</font></b></td>

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

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

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

<?
$sth = ibase_query($dbh, $stmt);
while ($row = ibase_fetch_object($sth)) {

echo '<td>' . $row->DISPLAY_NAME . '&nbsp</td>';
echo '<td><A HREF="mailto:' . $row->EMAIL_ADDRESS . '"&nbsp</a>' . $row->EMAIL_ADDRESS . '</td>';
echo '<td>' . $row->PHONE . '&nbsp</td>';
echo '<td>' . substr($row->DATE_ADDED,0,11) . '&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