Files
HotLunches/order-check.php
T
2026-10-19 15:22:52 -07:00

36 lines
911 B
PHP

<?php
include "db.php";
$Schools = array();
$query = "SELECT school_name, record_num FROM schools WHERE status IN ('Active','Linked')";
$results = db_query($query);
while ($row = db_fetch_assoc($results)) {
extract($row);
$Schools[$record_num] = $school_name;
}
$cutoff = date("Y-m-d", time() - 60 * 60 * 24 * 20);
$query = "SELECT * FROM hotlunch_order_header WHERE ordered_by_type != 'Concession' AND status != 'Deleted' AND added_date >= '$cutoff'";
$orders = db_query($query);
$count = 0;
while ($row = db_fetch_assoc($orders)) {
extract($row);
$query = "SELECT * FROM user_account WHERE school_num = $school_num AND order_num = $record_num";
$results = db_query($query);
if (db_num_rows($results) == 0) {
$school_name = $Schools[$school_num];
echo("$school_name - Order Not Found\n");
echo(" - $record_num ($count)\n");
echo("\n");
}
$count++;
}
?>