First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
include "db.php";
|
||||
|
||||
$query = "SELECT order_num,ordered_by_num,count(*) FROM hotlunch_order_items " .
|
||||
"WHERE ordered_by_type IN ('Student', 'Staff') AND schedule_num = 2462 " .
|
||||
"group by 1,2 " .
|
||||
"order by 2,1";
|
||||
$orders = db_query($query);
|
||||
|
||||
$count = 0;
|
||||
$prev_person = 0;
|
||||
while ($row = db_fetch_array($orders)) {
|
||||
$person = $row['ordered_by_num'];
|
||||
|
||||
if ($prev_person == $person) {
|
||||
echo("$prev_person\n");
|
||||
}
|
||||
|
||||
// Check each person for a valid class number
|
||||
$results = db_query("SELECT * FROM people WHERE record_num = $person");
|
||||
$row = db_fetch_array($results);
|
||||
$class_num = $row['class_num'];
|
||||
$name = $row['first_name'] . ' ' . $row['last_name'];
|
||||
$status = $row['status'];
|
||||
|
||||
if ($status != 'Unverified' && $status != 'Verified') echo("Status: $status - $name\n");
|
||||
|
||||
if ($class_num == 0) echo("Staff: $name\n");
|
||||
else {
|
||||
$class = db_query("SELECT * FROM classes WHERE record_num = $class_num");
|
||||
if (db_num_rows($class) == 0) {
|
||||
echo("Class Not Found: $name\n");
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['people_type'] != 'Student') echo("Not Student: $name\n");
|
||||
|
||||
$prev_person = $person;
|
||||
$count++;
|
||||
}
|
||||
|
||||
echo("Count: $count\n");
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user