<?php
include("../etc/global.inc");
//Database connection parameters.
$dbh = mysql_connect($host,$user,$pass);
mysql_select_db($dbname);
$sql = "SELECT * FROM queue WHERE processed='no' ORDER BY ou ASC";
$result = mysql_query($sql);
echo "<table width=622 border=1>\n";
echo "<tr><th>Req. Number</th><th>Facility</th><th>User</th><th>Title</th><th>Action</th><th>Date Requested</th><th>Approval</th></tr>\n";
echo "<form method=post action=\"$PHP_SELF\">\n";
while($row = mysql_fetch_array($result)) {
$id = $row["id"];
$ou2 = $row["ou"];
$req_action = $row["action"];
$givenname = $row["givenname"];
$sn = $row["sn"];
$title = $row["title"];
$request_dt = $row["request_dt"];
print "<tr><td>$id</td><td>$ou2</td><td>$sn, $givenname</td><td>$title</td><td>$req_action</td><td>$request_dt</td><td><input type=checkbox name=req_id$id></td></tr>\n";
}
echo "<input type=submit name=submit value=\"Process Checked\">\n";
echo "</form>\n";
echo "</table>\n";
if ($submit == "Process Checked") {
while(list($key,$value)=each($HTTP_POST_VARS)) {
if ($value == "on") {
$req_id = substr($key,6);
print "id=$req_id<br>\n";
}
}
}
?>
Sorry, under a seriously irrational deadline, can't explain it all. Hope it makes sense, seems to work fine. Thanks for the help!
-Ray