48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
|
|
// Start the template and output buffering
|
|
startTemplate();
|
|
$templatePageTitle = getLanguageText('TEXT-CONCESSION-ORDERS');
|
|
$headerArgs = "";
|
|
|
|
|
|
$school_name = $school_record['school_name'];
|
|
|
|
$ConcessionOrders = array();
|
|
|
|
$schedules = db_query("SELECT * FROM hotlunch_schedules WHERE school_num = $school_num ORDER BY start_order_datetime");
|
|
while ($row = db_fetch_assoc($schedules)) {
|
|
$schedule_num = $row['record_num'];
|
|
$schedule_name = $row['schedule_name'];
|
|
|
|
$query = "SELECT * FROM hotlunch_order_header WHERE school_num = $school_num AND schedule_num = $schedule_num AND ordered_by_type = 'Concession'";
|
|
$results = db_query($query);
|
|
if (db_num_rows($results) == 1) {
|
|
$order = db_fetch_assoc($results);
|
|
$amount = $order['order_total'];
|
|
$cost = $order['order_cost'];
|
|
|
|
$ConcessionOrders[] = array(
|
|
$schedule_name,
|
|
'$'.number_format($amount,2),
|
|
'$'.number_format($cost,2),
|
|
);
|
|
}
|
|
}
|
|
|
|
$commands = array();
|
|
$columnHeaders = array(getLanguageText('TEXT-SCHEDULE'), getLanguageText('TEXT-ORDER-TOTAL'), getLanguageText('TEXT-COST'));
|
|
$columnAlign = array('left', 'right', 'right');
|
|
|
|
listDataCustom($ConcessionOrders, $columnHeaders, '', $commands, 'N', $columnAlign, array(), "", "");
|
|
|
|
endTemplate();
|
|
?>
|