-

1) $class_info = getClassInfo($class_num,'internal'); // Get classroom orders for this menu date $query = "select concat_ws(', ',st.last_name,st.first_name) as name,people_type as ptype,concat('$currencySymbol',hloh.order_total) as total," . "hloh.status as status,hloh.ordered_by_num " . "from people as st, hotlunch_order_header as hloh, hotlunch_order_items as hloi " . "where st.school_num = $base_school_num " . "and hloh.school_num = $school_num " . "and hloi.school_num = $school_num " . "and st.record_num = hloh.ordered_by_num " . "and st.record_num = hloi.ordered_by_num " . "and st.class_num = $class_num " . "and hloh.schedule_num = $schedule_num " . "AND hloh.status NOT IN ('Inactive','Deleted') " . "and hloi.schedule_num = $schedule_num " . "and hloi.menu_num = $menu_num " . "and hloi.active != 'N' " . "and hloh.record_num = hloi.order_num " . "order by ptype desc,name"; $results = db_query($query); if (db_num_rows($results) == 0) continue; ?> $title\n"); $menu_items[$i]['total'] = 0; } ?> \n"); $name = $entry['name']; $ordered_by_type = $entry['ptype']; $ordered_by_num = $entry['ordered_by_num']; if ($ordered_by_type == 'Staff') $processed_staff[] = $ordered_by_num; $class = "data-odd"; if ($count % 2) $class = "data-even"; $count++; echo(" \n"); for ($i = 0; $i < count($menu_items); $i++) { $menu_item_num = intval($menu_items[$i]['num']); $query = "select qty from hotlunch_order_items " . "where school_num = $school_num " . "and ordered_by_num = $ordered_by_num " . "and schedule_num = $schedule_num " . "and menu_num = $menu_num " . "and menu_item_num = $menu_item_num " . "and active != 'N'"; $mresults = db_query($query); if (db_num_rows($mresults) == 0) { echo(" \n"); } else { $mrow = db_fetch_array($mresults); $qty = $mrow['qty']; $menu_items[$i]['total'] += $qty; $menu_items[$i]['grandtotal'] += $qty; echo(" \n"); } } echo(" \n"); } ?> $total\n"); $menu_items[$i]['total'] = 0; } ?> 0) $pwhere = "and s.record_num not in (" . implode(",",$processed_staff) . ") "; $query = "select concat_ws(', ',s.last_name,s.first_name) as name,'Staff' as ptype,concat('$currencySymbol',hloh.order_total) as total," . "hloh.status as status,hloh.ordered_by_num " . "from people as s, hotlunch_order_header as hloh, hotlunch_order_items as hloi " . "where s.school_num = $base_school_num " . "and hloh.school_num = $school_num " . "and hloi.school_num = $school_num " . "and s.record_num = hloh.ordered_by_num " . "and s.record_num = hloi.ordered_by_num " . "and s.status != 'Inactive' " . "and s.people_type = 'Staff' " . "and hloh.status NOT IN ('Inactive','Deleted') " . "and hloh.schedule_num = $schedule_num " . "and hloi.menu_num = $menu_num " . "and hloi.active != 'N' " . "and hloh.record_num = hloi.order_num " . $pwhere . "order by ptype,name"; $results = db_query($query); if (db_num_rows($results) > 0) { ?> $title\n"); $menu_items[$i]['total'] = 0; } ?> \n"); $name = $entry['name']; $ordered_by_type = $entry['ptype']; $ordered_by_num = $entry['ordered_by_num']; $class = "data-odd"; if ($count % 2) $class = "data-even"; $count++; echo(" \n"); for ($i = 0; $i < count($menu_items); $i++) { $menu_item_num = intval($menu_items[$i]['num']); $query = "select qty from hotlunch_order_items " . "where school_num = $school_num " . "and ordered_by_num = $ordered_by_num " . "and schedule_num = $schedule_num " . "and menu_num = $menu_num " . "and menu_item_num = $menu_item_num " . "and active != 'N'"; $mresults = db_query($query); if (db_num_rows($mresults) == 0) { echo(" \n"); } else { $mrow = db_fetch_array($mresults); $qty = $mrow['qty']; $menu_items[$i]['total'] += $qty; $menu_items[$i]['grandtotal'] += $qty; echo(" \n"); } } echo(" \n"); } ?> $total\n"); $menu_items[$i]['total'] = 0; } } ?> 0) { $query = "select qty from hotlunch_order_items " . "where school_num = $school_num " . "and schedule_num = $schedule_num " . "and ordered_by_type = 'Concession' " . "and menu_item_num = $item_num " . "and active != 'N'"; $qty = db_getVal($query); } echo(" \n"); $menu_items[$i]['grandtotal'] += $qty; } ?> $total\n"); } ?>

 
$name $qty
:
 

Staff Orders

 
$name $qty
Staff Totals:

Concession Order

Concession: $qty
 
School Totals:


Print Menu Report