645 lines
25 KiB
PHP
645 lines
25 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
|
|
// Start the template and output buffering
|
|
startTemplate();
|
|
$headerArgs = "";
|
|
|
|
|
|
// Ensure that only valid user types have access to this module
|
|
$AllowedUserTypes = array('SuperUser','System Administrator','Application Administrator','Application Volunteer','Schedule Volunteer','Administration Team','Schedule Team','Supplier','Financial Team','Schedule Reporting');
|
|
if (checkPermission($AllowedUserTypes) != 1) {
|
|
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
|
|
$action = '';
|
|
$naction = '';
|
|
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
|
exit();
|
|
}
|
|
|
|
|
|
//
|
|
// Process all actions to list and edit records
|
|
//
|
|
$naction = "";
|
|
|
|
if (array_key_exists('schedule_num',$_GET)) $schedule_num = intval($_GET['schedule_num']);
|
|
if (array_key_exists('schedule_num',$_POST)) $schedule_num = intval($_POST['schedule_num']);
|
|
|
|
if (array_key_exists('menu_num',$_GET)) $menu_num = intval($_GET['menu_num']);
|
|
if (array_key_exists('menu_num',$_POST)) $menu_num = intval($_POST['menu_num']);
|
|
|
|
$headerArgs = "&schedule_num=$schedule_num&menu_num=$menu_num";
|
|
|
|
if (!isset($schedule_num)) {
|
|
$error_message = getLanguageText('ERRORMSG-MISSING-DATA');
|
|
$action = 'schedule-reports';
|
|
$naction = '';
|
|
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
|
exit();
|
|
}
|
|
|
|
|
|
if (!isset($menu_num)) {
|
|
$error_message = getLanguageText('ERRORMSG-MISSING-DATA');
|
|
$action = 'schedule-reports';
|
|
$naction = '';
|
|
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
|
exit();
|
|
}
|
|
|
|
|
|
// Check if this is a valid schedule
|
|
$query = "select * from hotlunch_schedules " .
|
|
"where school_num = $school_num " .
|
|
"and record_num = $schedule_num";
|
|
$results = db_query($query);
|
|
|
|
if (db_num_rows($results) == 0) {
|
|
$error_message = getLanguageText('ERRORMSG-INVALID-SCHEDULE-NUM');
|
|
$action = 'schedule-reports';
|
|
$naction = '';
|
|
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
|
exit();
|
|
}
|
|
|
|
$hotlunch_schedule = db_fetch_array($results);
|
|
|
|
|
|
// If this is a ScheduleTeam user check if they have permission to access this schedule
|
|
if (in_array($_SESSION['UserInfo']['type'],array('Schedule Team','Schedule Volunteer'))) {
|
|
$userNum = intval($_SESSION['UserInfo']['record_num']);
|
|
$access = db_getVal("SELECT count(*) FROM hotlunch_schedules_people WHERE school_num = $school_num AND schedule_num = $schedule_num AND user_num = $userNum");
|
|
|
|
if (!$access || $access == 0) {
|
|
$error_message = getLanguageText('ERRORMSG-NO-SCHEDULE-ACCESS');
|
|
$action = 'schedule-reports';
|
|
$naction = '';
|
|
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
|
exit();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Check if this is a valid menu
|
|
$query = "select * from hotlunch_menu_dates " .
|
|
"where school_num = $school_num " .
|
|
"and schedule_num = $schedule_num " .
|
|
"and record_num = $menu_num";
|
|
$results = db_query($query);
|
|
|
|
if (db_num_rows($results) == 0) {
|
|
$error_message = getLanguageText('ERRORMSG-INVALID-MENU');
|
|
$action = 'schedule-reports';
|
|
$naction = '';
|
|
header("Location: /?action=$action&naction=$naction$headerArgs&form_message=" . urlencode($form_message) . "&error_message=" . urlencode($error_message));
|
|
exit();
|
|
}
|
|
|
|
$hotlunch_menu_date = db_fetch_array($results);
|
|
$menu_date = $hotlunch_menu_date['menu_date'];
|
|
$menu_title = $hotlunch_menu_date['menu_title'];
|
|
|
|
|
|
$templatePageTitle = $OrderDetailsText . " - $menu_title - $menu_date";
|
|
|
|
include "hotlunch_reports.menu.php";
|
|
echo("<br>\n");
|
|
|
|
|
|
if (array_key_exists('naction',$_GET)) $naction = $_GET['naction'];
|
|
if (array_key_exists('naction',$_POST)) $naction = $_POST['naction'];
|
|
|
|
$school_num = $school_record['record_num'];
|
|
|
|
include "form.messages.php";
|
|
|
|
|
|
//
|
|
// Display the menu selection
|
|
//
|
|
?>
|
|
<form method='post' action='/'>
|
|
<table width='90%' cellpadding='5' cellspacing='1'>
|
|
<tr>
|
|
<td width='25%' align='right'><b><?php displayLanguageText('TEXT-MENU-DATE'); ?>: </b></td>
|
|
<td align='left'>
|
|
<select name='menu_num' class='select-width500'>
|
|
<?php
|
|
$query = "select * from hotlunch_menu_dates " .
|
|
"where school_num = $school_num " .
|
|
"and schedule_num = $schedule_num " .
|
|
"order by sequence,menu_date";
|
|
$results = db_query($query);
|
|
|
|
$iTitle = getLanguageText('TEXT-ITEMS-ORDERED');
|
|
|
|
$selected_date = 'N';
|
|
while ($row = db_fetch_array($results)) {
|
|
$mtitle = $row['menu_title'];
|
|
$mdate = $row['menu_date'];
|
|
$record_num = $row['record_num'];
|
|
|
|
if ($hotlunch_schedule['display_menu_date'] == 'Y') $mtitle .= " - $mdate";
|
|
$numItems = db_getVal("SELECT count(*) FROM hotlunch_order_items WHERE school_num = $school_num AND schedule_num = $schedule_num AND menu_num = $record_num");
|
|
$mtitle .= " ($iTitle: $numItems)";
|
|
|
|
$selected = "";
|
|
if (isset($menu_num) && $menu_num == $record_num) {
|
|
$selected_date = 'Y';
|
|
$selected = " selected='selected'";
|
|
}
|
|
echo(" <option value='$record_num'$selected>$mtitle</option>\n");
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='center' colspan='2'><input type='submit' name='button' class='btn btn--primary' value="<?php displayLanguageText('TEXT-CHANGE-MENU-DATE'); ?>"></td>
|
|
</tr>
|
|
</table>
|
|
<input type='hidden' name='action' value='order-details'>
|
|
<input type='hidden' name='schedule_num' value='<?php echo($schedule_num) ?>'>
|
|
</form>
|
|
<br>
|
|
<?php
|
|
|
|
// Check that this menu has menu items
|
|
$numItems = db_getVal("SELECT count(*) FROM hotlunch_menu_items WHERE school_num = $school_num AND menu_num = $menu_num");
|
|
if ($numItems == 0) $error_message = getLanguageText('ERRORMSG-NO-MENU-ITEMS');
|
|
include "form.messages.php";
|
|
|
|
if ($numItems > 0) {
|
|
?>
|
|
<form method='post' action='/'>
|
|
<table width='500' class='content-table'>
|
|
<tr class='heading'>
|
|
<td colspan='2' align='center'><?php echo("$menu_title - $menu_date") ?></td>
|
|
</tr>
|
|
<tr class='data-odd'>
|
|
<td align='left'><b><?php displayLanguageText('TEXT-SELECT-ALL-MENU-ITEMS'); ?></b>: </td>
|
|
<td align='center'><input type='checkbox' name='select_all' id='select_all' value='Y' checked='checked' onClick='toggleItemCheckboxes();'></td>
|
|
</tr>
|
|
<?php
|
|
// Display the menu items
|
|
$query = "select * from hotlunch_menu_items " .
|
|
"where school_num = $school_num " .
|
|
"and menu_num = $menu_num " .
|
|
"order by sequence";
|
|
$menu_items = db_query($query);
|
|
|
|
$count = 0;
|
|
$items = array();
|
|
while ($menu_item = db_fetch_array($menu_items)) {
|
|
$item_num = $menu_item['record_num'];
|
|
$item_title = $menu_item['item_title'];
|
|
$label_title = $menu_item['label_title'];
|
|
$group_code = $menu_item['menu_group'];
|
|
if (strlen($group_code)) $group_code = "($group_code) ";
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
if ($menu_item['item_type'] != 'Heading') {
|
|
$items[] = "item_$item_num";
|
|
|
|
?>
|
|
<tr class='<?php echo($class) ?>'>
|
|
<td align='left'><b><?php echo("$group_code$item_title") ?>:</b> </td>
|
|
<td align='center'><input type='checkbox' name='item_<?php echo($item_num) ?>' id='item_<?php echo($item_num) ?>' value='Y' checked='checked' onClick='clearOnePerBox();'></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
else {
|
|
?>
|
|
<tr class='<?php echo($class) ?>'>
|
|
<td colspan='2' align='left'><b><?php echo($item_title) ?></b></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'document_format'");
|
|
if (strlen($default) == 0) $default = 'list';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-DOCUMENT-FORMAT'); ?>:</b><br>
|
|
<input type='radio' name='document_format' value='list' <?php if ($default == 'list') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-LIST'); ?>
|
|
<input type='radio' name='document_format' value='report' <?php if ($default == 'report') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-REPORT'); ?>
|
|
<input type='radio' name='document_format' value='receipt' <?php if ($default == 'receipt') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-RECEIPT'); ?>
|
|
<input type='radio' name='document_format' value='page' <?php if ($default == 'page') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-PAGE'); ?>
|
|
<input type='radio' name='document_format' value='CSV' <?php if ($default == 'CSV') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-SPREADSHEET'); ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'report_sort'");
|
|
if (strlen($default) == 0) {
|
|
$default = 'byStudent';
|
|
if ($NumClasses > 0) $default = 'byClass';
|
|
}
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-REPORT-SORT'); ?>:</b><br>
|
|
<select name='report_sort' class='select-width200'>
|
|
<?php
|
|
if ($NumClasses > 0) {
|
|
$Options = array(
|
|
array('byClass',$GlobalText['Class']." (".getLanguageText('TEXT-LAST-NAME').")"),
|
|
array('byClassFirstName',$GlobalText['Class']." (".getLanguageText('TEXT-FIRST-NAME').")"),
|
|
array('byStudent',getLanguageText('TEXT-ALPHABETICALLY')),
|
|
array('byStudentFirstName',getLanguageText('TEXT-ALPHABETICALLY-BY-FIRST-NAME')),
|
|
array('byEnteredDate',getLanguageText('TEXT-ORDER-DATE')),
|
|
array('byPaidDate',getLanguageText('TEXT-PAID-DATE')),
|
|
);
|
|
}
|
|
else {
|
|
$Options = array(
|
|
array('byStudent',getLanguageText('TEXT-ALPHABETICALLY')),
|
|
array('byEnteredDate',getLanguageText('TEXT-ORDER-DATE')),
|
|
array('byPaidDate',getLanguageText('TEXT-PAID-DATE')),
|
|
);
|
|
}
|
|
|
|
for ($i = 0; $i < count($Options); $i++) {
|
|
$option = $Options[$i][0];
|
|
$text = $Options[$i][1];
|
|
|
|
$selected = '';
|
|
if ($default == $option) $selected = " selected='selected'";
|
|
|
|
echo(" <option value='$option'$selected>$text</option>\n");
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'include_people'");
|
|
if (!$default) $default = '9';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-INCLUDE'); ?>:</b><br>
|
|
<select name='include_people' id='include_people'>
|
|
<?php BuildFileList("include_people.txt",$default) ?>
|
|
</select>
|
|
<span class='small'>(<?php displayLanguageText('TEXT-SPREADSHEET-ONLY'); ?>)</span>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'printTotals'");
|
|
if (!$default) $default = 'Y';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-PRINT-TOTALS'); ?>:</b><br> <?php BuildFileRadio("yn.txt","printTotals",$default) ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'fontSize'");
|
|
if (!$default) $default = '9';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-FONT-SIZE'); ?>:</b><br>
|
|
<select name='fontSize' id='fontSize'>
|
|
<?php BuildFileList("font.sizes.txt",$default) ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'titleHighlights'");
|
|
if (!$default) $default = 'Y';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-PRINT-HIGHLIGHTED-TITLES'); ?>:</b><br>
|
|
<select name='titleHighlights' id='titleHighlights'>
|
|
<?php BuildFileList("yn.txt",$default) ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
if ($school_record['orders_for'] == 'Participants' || $school_record['orders_for'] == 'Both') {
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'contactInfo'");
|
|
if (!$default) $default = 'Student';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-DISPLAY'); ?>:</b><br>
|
|
<input type='radio' name='contactInfo' id='contactInfo_id' value='Student' <?php if ($default == 'Student') echo("checked='checked'") ?>> <?php echo($GlobalText['Student']) ?>
|
|
<input type='radio' name='contactInfo' id='contactInfo_id' value='Parent' <?php if ($default == 'Parent') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-PARENT'); ?>
|
|
<input type='radio' name='contactInfo' id='contactInfo_id' value='Both' <?php if ($default == 'Both') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-BOTH'); ?>
|
|
<!-- <input type='radio' name='contactInfo' id='contactInfo_id' value='BothNames' <?php if ($default == 'BothNames') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-NAMES-OF-BOTH'); ?> -->
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
else {
|
|
echo("<input type='hidden' name='contactInfo' value='Parent'>\n");
|
|
}
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'studentInfo'");
|
|
if (!$default) $default = 'NameClass';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-STUDENT-INFORMATION'); ?>:</b><br>
|
|
<input type='radio' name='studentInfo' id='studentInfo_id' value='All' <?php if ($default == 'All') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-ALL-INFORMATION'); ?>
|
|
<input type='radio' name='studentInfo' id='studentInfo_id' value='NameClass' <?php if ($default == 'NameClass') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-NAME-AND-CLASS'); ?>
|
|
<input type='radio' name='studentInfo' id='studentInfo_id' value='Name' <?php if ($default == 'Name') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-NAME'); ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'studentName'");
|
|
if (!$default) $default = 'Full';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-STUDENT-NAME'); ?>:</b><br>
|
|
<input type='radio' name='studentName' id='studentName_id' value='Full' <?php if ($default == 'Full') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-NAME'); ?>
|
|
<input type='radio' name='studentName' id='studentFirst_id' value='First' <?php if ($default == 'First') echo("checked='checked'") ?>> <?php displayLanguageText('TEXT-FIRST-NAME'); ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
if ($NumClasses > 0) {
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'display_details'");
|
|
if (!$default) $default = 'Y';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-DISPLAY-ORDER-DETAILS'); ?>: <span class='small'>(<?php displayLanguageText('TEXT-ORDER-DETAILS-OR-SUMMARY') ?>)</span></b><br>
|
|
<?php BuildFileRadio("yn.txt","display_details",$default) ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'display_payment_status'");
|
|
if (!$default) $default = 'N';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-DISPLAY-PAYMENT-STATUS'); ?>:</b><br>
|
|
<?php BuildFileRadio("yn.txt","display_payment_status",$default) ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'display_user_data'");
|
|
if (!$default) $default = 'N';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-DISPLAY-USER-DATA'); ?>:</b><br>
|
|
<?php BuildFileRadio("yn.txt","display_user_data",$default) ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'orderStatus'");
|
|
if (!$default) $default = 'Active';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-ORDER-STATUS'); ?>:</b><br>
|
|
<?php BuildFileRadio("delivery_report_order_status.txt","orderStatus",$default) ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'include_allergy_info'");
|
|
if (!$default) $default = 'N';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-ALLERGIES'); ?>:</b><br>
|
|
<?php BuildFileRadio("yn.txt","include_allergy_info",$default,'','include-allergy-info') ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
if (in_array($school_record['registration_address'],array('Optional','Required'))) {
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
|
|
$default = db_getVal("SELECT default_value FROM form_defaults WHERE school_num = $school_num AND action = '$action' AND field = 'display_contact_details'");
|
|
if (!$default) {
|
|
$default = 'N';
|
|
if ($siteType == 'registration') $default = 'Y';
|
|
}
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td colspan='2' align='left'>
|
|
<b><?php displayLanguageText('TEXT-INCLUDE-CONTACT-DETAILS'); ?>:</b><br>
|
|
<?php BuildFileRadio("yn.txt","display_contact_details",$default) ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='40'>
|
|
<td colspan='2' align='center'>
|
|
<input type='hidden' name='action' value='order-details-generate'>
|
|
<input type='hidden' name='schedule_num' value='<?php echo($schedule_num) ?>'>
|
|
<input type='hidden' name='menu_num' value='<?php echo($menu_num) ?>'>
|
|
<input type='submit' name='button' class='btn btn--primary' value="<?php displayLanguageText('TEXT-GENERATE'); ?>">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
</form>
|
|
<br>
|
|
<?php
|
|
}
|
|
|
|
// Determine if groups are in use in this menu
|
|
$groupCount = db_getVal("SELECT count(*) FROM hotlunch_menu_items WHERE school_num = $school_num AND menu_num = $menu_num AND menu_group IN ('A','B','C','D','E','F','G','H','I','J','K','L','M')");
|
|
if ($groupCount > 0) {
|
|
?>
|
|
<form method='post' action='/'>
|
|
<table width='500' class='content-table'>
|
|
<tr class='heading'>
|
|
<td colspan='2' align='center'><?php displayLanguageText('TEXT-MENU-GROUPS-REPORT'); ?><br><?php echo($menu_title) ?></td>
|
|
</tr>
|
|
<?php
|
|
$results = db_query("SELECT distinct menu_group FROM hotlunch_menu_items WHERE school_num = $school_num AND menu_num = $menu_num ORDER BY 1");
|
|
$count = 0;
|
|
while ($row = db_fetch_array($results)) {
|
|
$gCode = $row['menu_group'];
|
|
if (strlen($gCode) == 0) continue;
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
$count++;
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='30'>
|
|
<td width='50%' align='right'><?php displayLanguageText('TEXT-ITEMS-FROM-GROUP'); ?> <?php echo($gCode) ?>:</td>
|
|
<td align='left'><input type='checkbox' name='selected_groups[]' value="<?php echo($gCode) ?>"></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
|
|
$class = 'data-even';
|
|
if ($count % 2) $class = 'data-odd';
|
|
?>
|
|
<tr class='<?php echo($class) ?>' height='40'>
|
|
<td colspan='2' align='center'>
|
|
<input type='hidden' name='action' value='group-details-generate'>
|
|
<input type='hidden' name='schedule_num' value='<?php echo($schedule_num) ?>'>
|
|
<input type='hidden' name='menu_num' value='<?php echo($menu_num) ?>'>
|
|
<input type='submit' name='button' class='btn btn--primary' value="<?php displayLanguageText('TEXT-GENERATE-REPORT'); ?>">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
</form>
|
|
<br>
|
|
<form method='post' action='/'>
|
|
<table width='500' class='content-table'>
|
|
<tr class='heading'>
|
|
<td align='center'><?php displayLanguageText('TEXT-MENU-GROUPS-CHECK-REPORT'); ?><br><?php echo($menu_title) ?></td>
|
|
</tr>
|
|
<tr class='data-even' height='40'>
|
|
<td align='center'>
|
|
<input type='hidden' name='action' value='group-check-generate'>
|
|
<input type='hidden' name='schedule_num' value='<?php echo($schedule_num) ?>'>
|
|
<input type='hidden' name='menu_num' value='<?php echo($menu_num) ?>'>
|
|
<input type='submit' name='button' class='btn btn--primary' value="<?php displayLanguageText('TEXT-GENERATE-REPORT'); ?>">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
</form>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<?php include "hotlunch_orders.print_buttons.php"; ?>
|
|
|
|
<script language='javascript'>
|
|
function toggleItemCheckboxes() {
|
|
var cb = document.getElementById('select_all').checked;
|
|
|
|
if (cb == false) {
|
|
<?php
|
|
if (isset($items) && count($items) > 0) {
|
|
for ($i = 0; $i < count($items); $i++) {
|
|
$item = $items[$i];
|
|
echo(" var cb$i = document.getElementById('$item');\n");
|
|
echo(" cb$i.checked = false;\n");
|
|
}
|
|
}
|
|
?>
|
|
}
|
|
else {
|
|
<?php
|
|
if (isset($items) && count($items) > 0) {
|
|
for ($i = 0; $i < count($items); $i++) {
|
|
$item = $items[$i];
|
|
echo(" var cb$i = document.getElementById('$item');\n");
|
|
echo(" cb$i.checked = true;\n");
|
|
}
|
|
}
|
|
?>
|
|
}
|
|
}
|
|
|
|
function clearOnePerBox() {
|
|
var cb = document.getElementById('select_all');
|
|
cb.checked = false;
|
|
}
|
|
</script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$(".include-people").change(function() {
|
|
var format = $("input:radio[name=document_format]:checked").val();
|
|
var value = $(this).val();
|
|
|
|
if (format != 'CSV' && value == 'All People') {
|
|
var msg = "<?php displayLanguageText('TEXT-ALL-PEOPLE-MESSAGE'); ?>";
|
|
alert(msg);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<?php
|
|
endTemplate();
|
|
?>
|