SHIS DATA INDEX
";
echo "Results of your search";
echo "";
echo "
";
$disp = $_POST['display'];
//store the table of matches in a variable
$result = pg_exec($db,"SELECT * FROM shis2 ORDER BY $disp, disk");
$row = pg_numrows ($result);
//if there are no rows say it
if ($row!=0) {
//keeps track if there were any records displayed
echo "\n";
echo " | Disk | Experiment | Launch Date | Calibration | Comments | Sortie | Link |
\n";
for($i=0; $i < $row; $i++) {
$myrow = pg_fetch_array($result,$i);
$cal = $_POST['calibration'];
$exp = $_POST['exp'];
$date = $_POST['date'];
$disk = $_POST['disk'];
if(($date == '' || $date == $myrow["date"]) && ($cal == "NULL" || $cal == trim($myrow["calibration"])) && ($disk == '' || $disk == $myrow["disk"]) && ($exp == "NULL" || $exp == trim($myrow["exp"]))) {
if($myrow["online"] == 0) {
printf("X | SHIS-%s | %s | %06d | %s | %s | %s | OFFLINE |
\n", $myrow["entry"], $myrow["disk"], $myrow["exp"], $myrow["date"], $myrow["calibration"], $myrow["comments"], $myrow["er2"]);
}else {
printf("X | SHIS-%s | %s | %06d | %s | %s | %s | SHIS-%s |
\n", $myrow["entry"], $myrow["disk"], $myrow["exp"], $myrow["exp"], $myrow["date"], $myrow["date"], $myrow["calibration"], $myrow["comments"], $myrow["er2"], $myrow["disk"], $myrow["disk"]);
}//end of else to put in Not Available
}//end of if statement
}//end of for statement
echo "
\n";
} else {
echo "Sorry, no records were found!";
}
//close the connection
pg_close($db);
}else{
// display form
?>
Fill in ONLY the fields desired.
| Query Again |