Files
HotLunches/hotlunch_order_list.staff.php
2026-10-19 15:22:52 -07:00

31 lines
812 B
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
// Get records to display
$today = date("Y-m-d",time());
$now = date("Y-m-d H:i:s",time());
$cutoff = date("Y-m-d H:i:00",time() - 60 * 60 * 24 * 20);
$query = "select * from hotlunch_schedules " .
"where school_num = $school_num " .
"and status = 'Active' " .
"and start_order_datetime <= '$now' " .
"and (schedule_end_date >= '$cutoff' OR end_order_datetime >= '$cutoff') " .
"order by $scheduleSortOrder";
$schedules = db_query($query);
if (db_num_rows($schedules) == 0) {
echo("<p><b>There are no active schedules to view</b></p>\n");
return;
}
include "hotlunch_order_list.parent.php";
?>