First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
include "db.php";
|
||||
include "table.php";
|
||||
|
||||
$hloh_table = new Table("hotlunch_order_header");
|
||||
|
||||
// $swhere = "AND school_num < 100 ";
|
||||
$query = "SELECT * FROM hotlunch_order_header WHERE ordered_by_type != 'Concession' $swhere AND (ordered_by_status = '' OR ordered_by_status IS NULL) ORDER BY school_num,record_num";
|
||||
$orders = db_query($query);
|
||||
|
||||
while ($row = db_fetch_assoc($orders)) {
|
||||
extract($row);
|
||||
|
||||
$onum = $record_num;
|
||||
$pnum = $ordered_by_num;
|
||||
|
||||
$results = db_query("SELECT * FROM people WHERE school_num = $school_num AND record_num = $pnum");
|
||||
if (db_num_rows($results) == 1) {
|
||||
$person = db_fetch_assoc($results);
|
||||
|
||||
$entry = array();
|
||||
$entry['ordered_by_first_name'] = $person['first_name'];
|
||||
$entry['ordered_by_last_name'] = $person['last_name'];
|
||||
$entry['ordered_by_status'] = 'Active User';
|
||||
$entry['record_num'] = $onum;
|
||||
|
||||
$query = $hloh_table->BuildUpdate($entry);
|
||||
// echo("$query\n");
|
||||
db_query($query);
|
||||
}
|
||||
else {
|
||||
$query = "UPDATE hotlunch_order_header SET ordered_by_status = 'Not Found' WHERE school_num = $school_num AND record_num = $onum";
|
||||
// echo("$query\n");
|
||||
db_query($query);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user