1094 lines
44 KiB
PHP
1094 lines
44 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
|
|
// Ensure that only valid user types have access to this module
|
|
$AllowedUserTypes = array('SuperUser','System Administrator','Application Administrator','Administration Team','Supplier');
|
|
if (checkPermission($AllowedUserTypes) != 1) {
|
|
echo("<br>\n");
|
|
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
|
|
include "form.messages.php";
|
|
return;
|
|
}
|
|
|
|
|
|
// Setup default values on insert
|
|
if ($naction == 'add') {
|
|
$initTableName = $CurrentTable;
|
|
$tarray = initializeTableArray($initTableName);
|
|
extract($tarray, EXTR_OVERWRITE);
|
|
|
|
$custom_menu_end_dates = 'N';
|
|
$status = 'Pending';
|
|
$schedule_type = 'Hot Lunch';
|
|
$schedule_prices = 'Y';
|
|
$order_button_text = 'Order';
|
|
$display_on_calendar = 'Y';
|
|
$schedule_for = 'Parents';
|
|
$menu_display_mode = 'Form';
|
|
$calendar_month_breaks = 'Y';
|
|
$display_title_or_label = 'Title';
|
|
$display_menu_title = 'Y';
|
|
$display_menu_headings = 'Y';
|
|
$display_item_price = 'N';
|
|
$display_product_thumbnail = 'N';
|
|
$edit_paid_orders = 'D';
|
|
$edit_complimentary_orders = 'D';
|
|
$edit_linked_menus = 'N';
|
|
$default_order_format = "Quantity";
|
|
$schedule_print_format = 'All Menus';
|
|
$schedule_receipts_description = 'N';
|
|
$check_for_missed_menus = 'Y';
|
|
$allow_multiple_orders = 'N';
|
|
$default_menu_title = "Hot Lunch";
|
|
if ($siteType != 'hotlunch') {
|
|
$schedule_type = 'Other';
|
|
$check_for_missed_menus = 'N';
|
|
$display_on_calendar = 'N';
|
|
$default_menu_title = "Fee";
|
|
}
|
|
|
|
$start_order_date = date("Y-m-d",time());
|
|
$start_order_datetime = date("Y-m-d 00:00",time());
|
|
$end_order_date = date("Y-m-d",time());
|
|
$end_order_datetime = date("Y-m-d 23:59",time());
|
|
$end_order_time = 'End of Day';
|
|
$schedule_start_date = date("Y-m-d",time());
|
|
$schedule_end_date = date("Y-m-d",time() + 60 * 60 * 24 * 20);
|
|
$discount_offered = 0.00;
|
|
$discount_expiry_date = date("Y-m-d",time());
|
|
$paper_order_charge = 0.00;
|
|
$paper_order_message = '';
|
|
$late_charge = '0.00';
|
|
$late_charge_date = date("Y-m-d",time() + 60 * 60 * 24 * 30);
|
|
$tax_rate = '0.00';
|
|
$tax_description = '';
|
|
$additional_charge = '0.00';
|
|
$num_orders = 0;
|
|
$qty_warning_limit = 3;
|
|
$qty_absolute_limit = 10;
|
|
$display_menu_date = 'Y';
|
|
$display_instructions = 'N';
|
|
$default_posting_schedule = 'N';
|
|
$days_prior_to_order_date = 7;
|
|
$order_until_hour = '12';
|
|
$hide_unavailable_dates = 'N';
|
|
$volunteer_signup = 'D';
|
|
$max_volunteers = 0;
|
|
$class_sort_field = 'D';
|
|
$implement_order_notes = 'N';
|
|
$implement_order_notes2 = 'N';
|
|
$notification_email = "";
|
|
$notification_order_details = 'N';
|
|
$email_message = $school_record['order_entered_message'];
|
|
$order_entered_message = $school_record['order_entered_message'];
|
|
$current_days = '';
|
|
$menus_per_date = 1;
|
|
}
|
|
else {
|
|
// Get the number of orders in this schedule
|
|
$query = "select count(*) from hotlunch_order_header " .
|
|
"where school_num = $school_num " .
|
|
"and schedule_num = $record_num " .
|
|
"and ordered_by_type != 'Concession' " .
|
|
"AND status NOT IN ('Inactive','Deleted')";
|
|
$num_orders = db_getVal($query);
|
|
if (!$num_orders) $num_orders = 0;
|
|
echo("<!-- $num_orders :: $query -->\n");
|
|
|
|
echo("\n\n<!-- lunch_days $lunch_days -->\n");
|
|
$current_days = explode(",",$lunch_days);
|
|
for ($i = 0; $i < count($current_days); $i++) {
|
|
echo("<!-- " . $current_days[$i] . " -->\n");
|
|
}
|
|
|
|
$start_order_datetime = substr($start_order_datetime,0,16);
|
|
$end_order_datetime = substr($end_order_datetime,0,16);
|
|
}
|
|
|
|
if (!isset($menus_per_date)) $menus_per_date = 1;
|
|
|
|
|
|
?>
|
|
<script language="JavaScript" SRC="include/utils.js"></script>
|
|
|
|
<?php
|
|
// Handle student categories
|
|
$numCatClasses = 0;
|
|
$numCategories = db_getVal("select count(*) from student_categories where school_num = $base_school_num");
|
|
$select_category = 'All Categories';
|
|
if (isset($record_num) && intval($record_num) > 0) {
|
|
$numCatClasses = db_getVal("SELECT count(*) FROM hotlunch_schedules_categories WHERE school_num = $school_num AND schedule_num = $record_num");
|
|
if ($numCatClasses > 0) $select_category = 'Selected Categories';
|
|
}
|
|
?>
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
<?php include "include/ajax.Setup.php" ?>
|
|
|
|
$(".calendar-fields").hide();
|
|
|
|
<?php if ($menu_display_mode != 'Form') { ?>
|
|
$(".calendar-fields").show();
|
|
<?php } ?>
|
|
|
|
$("input[name='menu_display_mode']").change(function() {
|
|
if ($("input[name='menu_display_mode']:checked").val() == 'Form') {
|
|
$(".calendar-fields").hide();
|
|
}
|
|
else {
|
|
$(".calendar-fields").show();
|
|
}
|
|
});
|
|
|
|
<?php if ($numCatClasses > 0) { ?>
|
|
$("#selected-categories-row").show();
|
|
<?php } else { ?>
|
|
$("#selected-categories-row").hide();
|
|
<?php } ?>
|
|
|
|
$("input[name='select_category']").change(function() {
|
|
var cclasses = $("input[name='select_category']:checked").val();
|
|
if (cclasses == 'Selected Categories') $("#selected-categories-row").show();
|
|
else $("#selected-categories-row").hide();
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
<link href="summernote/summernote-lite.min.css" rel="stylesheet">
|
|
<script language="JavaScript" type="text/javascript" src="summernote/summernote-lite.min.js"></script>
|
|
<script src="summernote/summernote-image-attributes.js"></script>
|
|
<script src="summernote/lang/en-us.js"></script>
|
|
|
|
<?php include "hotlunch_reports.menu.php"; ?>
|
|
<br>
|
|
<form method='post' action='/'>
|
|
<?php
|
|
$message_width = $default_form_width;
|
|
include "form.messages.php";
|
|
?>
|
|
<table width='98%' class='content-table'>
|
|
<tr>
|
|
<td colspan='2' align='center' class='heading'><?php echo($PageTitle) ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2' align='center'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width='35%' align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-NAME'); ?>: </td>
|
|
<td width='65%' align='left' valign='top'><input type='text' name='schedule_name' id='schedule_name' value="<?php echo($schedule_name) ?>" size='50'></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-TYPE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<select name='schedule_type' id='schedule_type'>
|
|
<?php BuildFileList("hotlunch_schedule_type.txt",$schedule_type); ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>
|
|
<span class='small warning'><?php displayLanguageText('TEXT-24-HOUR-CLOCK-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ORDERING-START-DATE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='start_order_datetime' id='start_order_datetime' value="<?php echo($start_order_datetime) ?>" size='20' class='datetime-field'>
|
|
<br>
|
|
<span class='small'><?php displayLanguageText('TEXT-DATE-ORDERING-WILL-COMMENCE-FOR-THIS-SCHEDULE'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ORDERING-END-DATE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='end_order_datetime' id='end_order_datetime' value="<?php echo($end_order_datetime) ?>" size='20' class='datetime-field'>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-IMPLEMENT-CUSTOM-MENU-END-DATES'); ?>: </td>
|
|
<td align='left' valign='top'><?php BuildFileRadio("yn.txt","custom_menu_end_dates",$custom_menu_end_dates) ?></td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-START-DATE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='schedule_start_date' id='schedule_start_date' value="<?php echo($schedule_start_date) ?>" size='15' class='date-field'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-FIRST-MENU-DATE'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-END-DATE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='schedule_end_date' id='schedule_end_date' value="<?php echo($schedule_end_date) ?>" size='15' class='date-field'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-LAST-MENU-DATE'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MENU-DAYS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileCheckbox("lunch_days.txt","lunch_days",$current_days," ","menu-days") ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-MENU-DAYS-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MENUS-PER-DATE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<select name='menus_per_date' id='menus_per_date'>
|
|
<?php BuildFileList("menus_per_date.txt",$menus_per_date) ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MENU-ITEM-FORMAT'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<select name='default_order_format' id='default_order_format'>
|
|
<?php BuildFileList("order_format.txt",'Quantity') ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MENU-TITLE'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='default_menu_title' id='default_menu_title' value='<?php echoValue($default_menu_title) ?>' size='30'></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-STATUS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<select name='status' id='status'>
|
|
<?php BuildFileList("hotlunch_schedule_status.txt",$status) ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-PRICES'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","schedule_prices",$schedule_prices) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ORDER-BUTTON-TEXT'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='order_button_text' id='order_button_text' value='<?php echo($order_button_text) ?>' size='20'></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-MENUS-ON-EVENT-CALENDAR'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_on_calendar",$display_on_calendar) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-IS-FOR'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("schedule_for.txt","schedule_for",$schedule_for) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PARENTS-EDIT-PAID-ORDERS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("ynd.txt","edit_paid_orders",$edit_paid_orders) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PARENTS-EDIT-COMPLIMENTARY-ORDERS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("ynd.txt","edit_complimentary_orders",$edit_complimentary_orders) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PARENTS-EDIT-LINKED-MENUS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","edit_linked_menus",$edit_linked_menus) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-FORM-DISPLAY-MODE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("menu_display_mode.txt","menu_display_mode",$menu_display_mode) ?>
|
|
</td>
|
|
</tr>
|
|
<tr class='calendar-fields'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-BREAK-BETWEEN-MONTHS-IN-CALENDAR-MODE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","calendar_month_breaks",$calendar_month_breaks) ?>
|
|
</td>
|
|
</tr>
|
|
<tr class='calendar-fields'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-ITEM-TITLE-OR-LABEL-IN-CALENDAR-MODE') ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("display_title_or_label.txt","display_title_or_label",$display_title_or_label) ?>
|
|
</td>
|
|
</tr>
|
|
<tr class='calendar-fields'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-MENU-TITLE-IN-CALENDAR-MODE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_menu_title",$display_menu_title) ?>
|
|
</td>
|
|
</tr>
|
|
<tr class='calendar-fields'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-MENU-HEADINGS-IN-CALENDAR-MODE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_menu_headings",$display_menu_headings) ?>
|
|
</td>
|
|
</tr>
|
|
<tr class='calendar-fields'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-ITEM-PRICE-IN-CALENDAR-MODE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_item_price",$display_item_price) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-ITEM-THUMBNAIL-IN-FORM-MODE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_product_thumbnail",$display_product_thumbnail) ?>
|
|
</td>
|
|
</tr>
|
|
<tr><td colspan='2'> </td></tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-PRINT'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("schedule_print_format.txt","schedule_print_format",$schedule_print_format) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PRINT-ITEM-DESCRIPTION-ON-RECEIPTS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","schedule_receipts_description",$schedule_receipts_description) ?>
|
|
</td>
|
|
</tr>
|
|
<tr><td colspan='2'> </td></tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-CHECK-FOR-MISSED-MENUS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","check_for_missed_menus",$check_for_missed_menus) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-CHECK-FOR-MISSED-MENUS-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-MENU-DATES'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_menu_date",$display_menu_date) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-DISPLAY-MENU-DATES-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISCOUNT-OFFERED'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='discount_offered' id='discount_offered' value="<?php echo($discount_offered) ?>" size='12'>
|
|
<select name='discount_type' id='discount_type'>
|
|
<?php BuildFileList("hotlunch_schedule_discount_type.txt",$discount_type) ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MINIMUM-ORDER-AMOUNT-TO-QUALIFY'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='discount_order_minimum' id='discount_order_minimum' value="<?php echo($discount_order_minimum) ?>" size='12'></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-EXPIRY-DATE'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='discount_expiry_date' id='discount_expiry_date' value="<?php echo($discount_expiry_date) ?>" size='15' class='date-field'></td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PAPER-ORDER-FEE'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='paper_order_charge' id='paper_order_charge' value="<?php echo($paper_order_charge) ?>" size='12'></td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PAPER-ORDER-FEE-MESSAGE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='paper_order_message' id='paper_order_message' value="<?php echo($paper_order_message) ?>" size='50'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-PAPER-ORDER-FEE-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-LATE-CHARGE-AMOUNT'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='late_charge' id='late_charge' value="<?php echo($late_charge) ?>" size='12'></td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-START-DATE'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='late_charge_date' id='late_charge_date' value="<?php echo($late_charge_date) ?>" size='15' class='date-field'></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-TAX-RATE-ON-ORDERS'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='tax_rate' id='tax_rate' value="<?php echo($tax_rate) ?>" size='10'> %</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DESCRIPTION'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='tax_description' id='tax_description' value="<?php echo($tax_description) ?>" size='20'></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ADDITIONAL-ORDER-FEE'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='additional_charge' id='additional_charge' value="<?php echo($additional_charge) ?>" size='12'></td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ADDITIONAL-ORDER-FEE-MESSAGE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='additional_charge_message' id='additional_charge_message' value="<?php echo($additional_charge_message) ?>" size='50'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-ADDITIONAL-ORDER-FEE-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-NUMBER-OF-DAYS-PRIOR-TO-MENU-DATE'); ?>: </td>
|
|
<td align='left' align='left'>
|
|
<select name='days_prior_to_order_date' id='days_prior_to_order_date'>
|
|
<?php BuildFileList("days_prior_to_order_date.txt",$days_prior_to_order_date) ?>
|
|
</select><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-NUMBER-OF-DAYS-PRIOR-MSG1'); ?><br><br>
|
|
<?php displayLanguageText('TEXT-NUMBER-OF-DAYS-PRIOR-MSG2'); ?><br><br></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ORDER-UNTIL-HOUR-ON-MENU-DATE'); ?>: </td>
|
|
<td align='left' align='left'>
|
|
<select name='order_until_hour' id='order_until_hour'>
|
|
<?php BuildFileList("order_until_hour.txt",$order_until_hour); ?>
|
|
</select><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-ORDER-UNTIL-HOUR-ON-MENU-DATE-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MENU-DATE-CUT-OFF'); ?>: </td>
|
|
<td align='left' valign='top'><input type='text' name='menu_cutoff_date' id='menu_cutoff_date' value="<?php echo($menu_cutoff_date) ?>" size='15' class='date-field'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-MENU-DATE-CUT-OFF-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-HIDE-UNAVAILABLE-MENU-DATES'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","hide_unavailable_dates",$hide_unavailable_dates) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-HIDE-UNAVAILABLE-MENU-DATES-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-WARNING-ORDER-QUANTITY'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='qty_warning_limit' id='qty_warning_limit' value='<?php echo($qty_warning_limit) ?>' size='2'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-WARNING-ORDER-QUANTITY-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ABSOLUTE-ORDER-QUANTITY'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<input type='text' name='qty_absolute_limit' id='qty_absolute_limit' value='<?php echo($qty_absolute_limit) ?>' size='2'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-ABSOLUTE-ORDER-QUANTITY-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DISPLAY-INSTRUCTIONS-ON-ORDER-FORM'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","display_instructions",$display_instructions) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-DISPLAY-INSTRUCTIONS-ON-ORDER-FORM-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SCHEDULE-DESCRIPTION'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<a href='#' id='edit-description' class='btn btn--primary btn--xsmall'><?php displayLanguageText('TEXT-EDIT'); ?></a>
|
|
</td>
|
|
</tr>
|
|
<tr id='schedule-description-row'>
|
|
<td align='left' colspan='2' valign='top' style='background-color: #ffffff'><b><?php displayLanguageText('TEXT-SCHEDULE-DESCRIPTION'); ?>: </b><br>
|
|
<textarea cols='80' rows='10' id='description' name='description' class='summernote'><?php echo($description) ?></textarea>
|
|
<?php
|
|
$windowHeight = 200;
|
|
$fieldName = 'description';
|
|
include "summernote.images.php";
|
|
?>
|
|
<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PAPER-ORDER-FORM-DESCRIPTION'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='paper_description' id='paper_description' rows='4' cols='80'><?php echo($paper_description) ?></textarea><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-PAPER-ORDER-FORM-DESCRIPTION-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-PAPER-FORM-FOOTER'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='paper_footer' id='paper_footer' rows='2' cols='80'><?php echo($paper_footer) ?></textarea><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-PAPER-FORM-FOOTER-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-NOTIFICATION-EMAIL'); ?>: </td>
|
|
<td colspan='2' align='left'>
|
|
<input type='text' name='notification_email' id='notification_email' value='<?php echo($notification_email) ?>' size='40'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-NOTIFICATION-EMAIL-MSG'); ?>.</span>
|
|
</td>
|
|
</tr>
|
|
<!--
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-INCLUDE-ORDER-DETAILS'); ?>: </td>
|
|
<td align='left' valign='top'><?php BuildFileRadio("yn.txt","notification_order_details",$notification_order_details) ?></td>
|
|
</tr>
|
|
-->
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-EMAIL-MESSAGE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='email_message' id='email_message' rows='2' cols='80'><?php echo($email_message) ?></textarea><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-EMAIL-MESSAGE-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ORDER-ENTERED-MESSAGE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='order_entered_message' id='order_entered_message' rows='2' cols='80'><?php echo($order_entered_message) ?></textarea><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-ORDER-ENTERED-MESSAGE-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-VOLUNTEER-SIGNUP-TITLE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("ynd.txt","volunteer_signup",$volunteer_signup) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-VOLUNTEER-SIGNUP-TITLE-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-MAX-VOLUNTEERS'); ?>: </td>
|
|
<td colspan='2' align='left'>
|
|
<input type='text' name='max_volunteers' id='max_volunteers' value='<?php echo($max_volunteers) ?>' size='5'><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-MAX-VOLUNTEERS-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-VOLUNTEER-MESSAGE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='schedule_volunteer_message' id='schedule_volunteer_message' rows='2' cols='80'><?php echo($schedule_volunteer_message) ?></textarea><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-SCHEDULE-VOLUNTEER-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<?php if ($school_record['implement_meal_locations'] == 'Y') { ?>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-USE-CLASS-OR-ALTERNATE-LOCATION'); ?>: </td>
|
|
<td colspan='2' align='left'>
|
|
<?php BuildFileRadio("class_sort_field.txt","class_sort_field",$class_sort_field) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-USE-CLASS-OR-ALTERNATE-LOCATION-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-IMPLEMENT-ORDER-NOTES'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","implement_order_notes",$implement_order_notes) ?><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-IMPLEMENT-ORDER-NOTES-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-ORDER-NOTES-EXPLANATION'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='order_notes_message' id='order_notes_message' rows='2' cols='80'><?php echo($order_notes_message) ?></textarea><br>
|
|
<span class='small'><?php displayLanguageText('TEXT-ORDER-NOTES-EXPLANATION-MSG'); ?></span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-IMPLEMENT-SECOND-ORDER-NOTES'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php BuildFileRadio("yn.txt","implement_order_notes2",$implement_order_notes2) ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SECOND-ORDER-NOTES-MESSAGE'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<textarea name='order_notes_message2' id='order_notes_message2' rows='2' cols='80'><?php echo($order_notes_message2) ?></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan='2'> </td>
|
|
</tr>
|
|
<tr class='hotlunch-dates'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SUPPLIER-ACCESS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<select name='supplier_num' id='supplier_num' class='select-width400'>
|
|
<option value='0'></option>
|
|
<?php
|
|
$suppliers = db_query("select * from suppliers where school_num = $supplier_school_num and status = 'Active' order by supplier_name");
|
|
while ($row = db_fetch_array($suppliers)) {
|
|
$name = $row['supplier_name'];
|
|
$snum = $row['record_num'];
|
|
$selected = "";
|
|
if ($snum == $supplier_num) $selected = " selected='selected'";
|
|
echo(" <option value='$snum'$selected>$name</option>\n");
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$num_docs = db_getVal("select count(*) from documents where school_num = $school_num");
|
|
if ($num_docs > 0) {
|
|
?>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-DOCUMENTS'); ?>: </td>
|
|
<td align='left' valign='top'>
|
|
<?php
|
|
$selectSize = 10;
|
|
if ($num_docs < 10) $selectSize = $num_docs + 1;
|
|
?>
|
|
<select name='selected_documents[]' id='selected_documents' size='<?php echo($selectSize) ?>' multiple class='select-width400'>
|
|
<?php
|
|
// Get documents
|
|
$document_path = sprintf("%08d",$record_num);
|
|
$doc_path = "files/$document_path";
|
|
$documents = db_query("select * from documents where school_num = $school_num order by sequence,title");
|
|
while ($row = db_fetch_array($documents)) {
|
|
$doc_num = $row['record_num'];
|
|
$doc_title = $row['title'];
|
|
$file_name = $row['file_name'];
|
|
$selected = "";
|
|
if (isset($schedule_num) && $schedule_num > 0) {
|
|
$results = db_query("SELECT * FROM hotlunch_schedules_documents WHERE school_num = $school_num AND schedule_num = $schedule_num AND document_num = $doc_num");
|
|
}
|
|
echo(" <option value='$doc_num'$selected>$doc_title</option>\n");
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php } ?>
|
|
<?php
|
|
$num_classes = db_getVal("select count(*) from classes where school_num = $base_school_num and entry_type = 'Class'");
|
|
if ($num_classes == 0) $num_classes = 1;
|
|
if ($num_classes > 0) {
|
|
?>
|
|
<tr>
|
|
<td align='right' valign='top'>
|
|
<?php displayLanguageText('TEXT-SCHEDULE-ACCESS'); ?>: <br>
|
|
</td>
|
|
<td align='left' valign='top'>
|
|
<?php
|
|
$selectSize = 10;
|
|
if ($num_classes < 10) $selectSize = $num_classes + 1;
|
|
?>
|
|
<select name='selected_classes[]' id='selected_classes' size='<?php echo($selectSize) ?>' multiple class='select-width400'>
|
|
<?php
|
|
if ($naction == 'edit') {
|
|
$class_entries = db_getVal("select count(*) from hotlunch_schedules_classes where school_num = $base_school_num and schedule_num = $record_num");
|
|
}
|
|
else {
|
|
$class_entries = 0;
|
|
}
|
|
|
|
if ($class_entries == 0) {
|
|
echo(" <option value='0' selected='selected'>" . getLanguageText('TEXT-ALL') . "</option>\n");
|
|
}
|
|
else {
|
|
echo(" <option value='0'>" . getLanguageText('TEXT-ALL') . "</option>\n");
|
|
}
|
|
|
|
// Get set of classes
|
|
$classes = db_query("select record_num from classes where school_num = $base_school_num and entry_type = 'Class' order by sequence");
|
|
$schedule_access = 0;
|
|
while ($row = db_fetch_array($classes)) {
|
|
$class_num = $row['record_num'];
|
|
$class_info = getClassInfo($class_num);
|
|
|
|
$selected = "";
|
|
if ($naction == 'edit' && $class_num > 0) {
|
|
$schedule_access = db_getVal("select count(*) from hotlunch_schedules_classes where school_num = $school_num and schedule_num = $record_num and class_num = $class_num");
|
|
}
|
|
if ($schedule_access == 1) $selected = " selected='selected'";
|
|
echo(" <option value='$class_num'$selected>$class_info</option>\n");
|
|
}
|
|
|
|
// Handle Staff Only access
|
|
$selected = "";
|
|
if ($naction == 'edit') {
|
|
$schedule_access = db_getVal("select count(*) from hotlunch_schedules_classes where school_num = $school_num and schedule_num = $record_num and class_num = 1");
|
|
}
|
|
if ($schedule_access == 1) $selected = " selected='selected'";
|
|
?>
|
|
<option value='1'<?php echo($selected) ?>><?php displayLanguageText('TEXT-STAFF-ONLY'); ?></option>
|
|
<?php
|
|
$numCustomers = db_getVal("SELECT count(*) FROM people WHERE school_num = $base_school_num AND class_num = 2");
|
|
if ($numCustomers > 0) {
|
|
$selected = "";
|
|
if ($naction == 'edit') {
|
|
$schedule_access = db_getVal("select count(*) from hotlunch_schedules_classes where school_num = $school_num and schedule_num = $record_num and class_num = 2");
|
|
}
|
|
if ($schedule_access == 1) $selected = " selected='selected'";
|
|
echo(" <option value='2'$selected>" . getLanguageText('TEXT-PARENTS') . "</option>\n");
|
|
}
|
|
?>
|
|
</select>
|
|
<?php // echo("SELECT count(*) FROM people WHERE school_num = $base_school_num AND class_num = 2"); ?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php if ($numCategories > 0) { ?>
|
|
<tr>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-CATEGORIES'); ?></td>
|
|
<td align='left' valign='top'><?php BuildFileRadio("select_categories.txt","select_category",$select_category) ?></td>
|
|
</tr>
|
|
<?php } else { ?>
|
|
<input type='hidden' name='select_category' id='select_category' value='All Categories'>
|
|
<?php } ?>
|
|
<tr id='selected-categories-row'>
|
|
<td align='right' valign='top'><?php displayLanguageText('TEXT-SELECTED'); ?></td>
|
|
<td align='left' valign='top'>
|
|
<?php
|
|
if ($numCategories == 0) $numCategories = 1;
|
|
$selectSize = 10;
|
|
if ($numCategories < 10) $selectSize = $numCategories;
|
|
?>
|
|
<select name='selected_categories[]' id='selected_categories' size='<?php echo($selectSize) ?>' multiple class='select-width400'>
|
|
<?php
|
|
// Get set of categories
|
|
$categories = db_query("select * from student_categories where school_num = $base_school_num order by sequence");
|
|
while ($row = db_fetch_array($categories)) {
|
|
$c_num = $row['record_num'];
|
|
$c_info = $row['category'];
|
|
|
|
$selected = "";
|
|
if ($naction == 'edit' && intval($record_num) > 0 && intval($c_num) > 0) {
|
|
$schedule_access = db_getVal("select count(*) from hotlunch_schedules_categories where school_num = $school_num and schedule_num = $record_num and category_num = $c_num");
|
|
}
|
|
if ($schedule_access == 1) $selected = " selected='selected'";
|
|
echo(" <option value='$c_num'$selected>$c_info</option>\n");
|
|
}
|
|
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
// Determine if there are ScheduleTeam users for this school
|
|
$num_users = db_getVal("select count(*) from users where school_num = $base_school_num and type IN ('Schedule Team','Schedule Volunteer')");
|
|
if ($num_users > 0) {
|
|
?>
|
|
<tr>
|
|
<td align='right' valign='top'>
|
|
<?php displayLanguageText('TEXT-USER-ACCESS'); ?>: <br>
|
|
<span class='small'><?php displayLanguageText('TEXT-USER-ACCESS-MSG'); ?></span>
|
|
</td>
|
|
<td align='left' valign='top'>
|
|
<?php
|
|
$selectSize = 10;
|
|
if ($num_users < 10) $selectSize = $num_users + 2;
|
|
?>
|
|
<select name='selected_people[]' id='selected_people' size='<?php echo($selectSize) ?>' multiple class='select-width400'>
|
|
<?php
|
|
if ($naction == 'edit') {
|
|
$user_entries = db_getVal("select count(*) from hotlunch_schedules_people where school_num = $school_num and schedule_num = $record_num");
|
|
}
|
|
else {
|
|
$user_entries = 0;
|
|
}
|
|
|
|
if ($user_entries == 0) {
|
|
echo(" <option value='0' selected='selected'>" . getLanguageText('TEXT-NO-SCHEDULE-ACCESS-USERS') . "</option>\n");
|
|
}
|
|
else {
|
|
echo(" <option value='0'>" . getLanguageText('TEXT-NO-SCHEDULE-ACCESS-USERS') . "</option>\n");
|
|
}
|
|
|
|
// Get set of users
|
|
$users = db_query("select * from users where school_num = $base_school_num and type IN ('Schedule Team','Schedule Volunteer') order by last_name,first_name");
|
|
$schedule_access = 0;
|
|
while ($row = db_fetch_array($users)) {
|
|
$user_num = $row['record_num'];
|
|
$first_name = $row['first_name'];
|
|
$last_name = $row['last_name'];
|
|
$userid = $row['userid'];
|
|
|
|
$selected = "";
|
|
if ($naction == 'edit') {
|
|
$schedule_access = db_getVal("select count(*) from hotlunch_schedules_people where school_num = $base_school_num and schedule_num = $record_num and user_num = $user_num");
|
|
}
|
|
if ($schedule_access == 1) $selected = " selected='selected'";
|
|
echo(" <option value='$user_num'$selected>$first_name $last_name - $userid</option>\n");
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
<tr>
|
|
<td colspan='2' align='center'>
|
|
<br>
|
|
<input type='submit' id='submitButton' class='btn btn--primary' value='<?php echo($ButtonText) ?>'>
|
|
<input type='hidden' name='action' value='<?php echo($action) ?>'>
|
|
<input type='hidden' name='naction' value='<?php echo($next_naction) ?>'>
|
|
<input type='hidden' name='record_num' value='<?php echo($record_num) ?>'>
|
|
<input type='hidden' name='next_action' value='<?php if (isset($next_action)) echo($next_action) ?>'>
|
|
<input type='hidden' name='allow_multiple_orders' id='allow_multiple_orders' value='<?php echo($allow_multiple_orders) ?>'>
|
|
<input type='hidden' name='group_a' id='group_a' value='0'>
|
|
<input type='hidden' name='group_b' id='group_b' value='0'>
|
|
<input type='hidden' name='group_c' id='group_c' value='0'>
|
|
<input type='hidden' name='group_d' id='group_d' value='0'>
|
|
<input type='hidden' name='group_e' id='group_e' value='0'>
|
|
<input type='hidden' name='group_f' id='group_f' value='0'>
|
|
<input type='hidden' name='group_g' id='group_g' value='0'>
|
|
<input type='hidden' name='group_h' id='group_h' value='0'>
|
|
<input type='hidden' name='group_i' id='group_i' value='0'>
|
|
<input type='hidden' name='group_j' id='group_j' value='0'>
|
|
<input type='hidden' name='group_k' id='group_k' value='0'>
|
|
<input type='hidden' name='group_l' id='group_l' value='0'>
|
|
<input type='hidden' name='group_m' id='group_m' value='0'>
|
|
<?php if ($school_record['implement_meal_locations'] != 'Y') { ?>
|
|
<input type='hidden' name='class_sort_field' id='class_sort_field' value='D'>
|
|
<?php } ?>
|
|
<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<?php include "hotlunch_orders.print_buttons.php"; ?>
|
|
|
|
<input type='hidden' id='edit-window'>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
|
|
<?php include "include/ajax.Setup.php" ?>
|
|
|
|
$("#schedule-description-row").hide();
|
|
$("#edit-window").val('closed');
|
|
|
|
$("#edit-description").click(function(e) {
|
|
e.preventDefault();
|
|
|
|
var state = $("#edit-window").val();
|
|
|
|
if (state == 'closed') {
|
|
$("#schedule-description-row").show();
|
|
$("#edit-window").val('open');
|
|
}
|
|
else {
|
|
$("#schedule-description-row").hide();
|
|
$("#edit-window").val('closed');
|
|
}
|
|
});
|
|
|
|
scheduleTypeChange();
|
|
|
|
$("#schedule_type").change(function() {
|
|
var schedule_type = $("#schedule_type").val();
|
|
scheduleTypeChange();
|
|
|
|
switch (schedule_type) {
|
|
case 'Hot Lunch':
|
|
case 'Date Sensitive':
|
|
$(".hotlunch-dates").show();
|
|
break;
|
|
|
|
default:
|
|
$(".hotlunch-dates").hide();
|
|
alert("<?php displayLanguageText('TEXT-ORDERING-WILL-END-ONLY'); ?>");
|
|
break;
|
|
}
|
|
});
|
|
|
|
function scheduleTypeChange() {
|
|
var schedule_type = $("#schedule_type").val();
|
|
|
|
switch (schedule_type) {
|
|
case 'Hot Lunch':
|
|
case 'Date Sensitive':
|
|
$(".hotlunch-dates").show();
|
|
break;
|
|
|
|
default:
|
|
$(".hotlunch-dates").hide();
|
|
break;
|
|
}
|
|
}
|
|
|
|
$("#start_order_datetime").blur(function() {
|
|
validateDates();
|
|
});
|
|
|
|
$("#end_order_datetime").focus(function() {
|
|
validateDates();
|
|
});
|
|
|
|
$("#schedule_start_date").focus(function() {
|
|
validateDates();
|
|
});
|
|
|
|
$("#schedule_end_date").focus(function() {
|
|
validateDates();
|
|
});
|
|
|
|
function validateDates() {
|
|
var sdate = $("#schedule_start_date").val();
|
|
var edate = $("#schedule_end_date").val();
|
|
var sodate = $("#start_order_datetime").val();
|
|
var eodate = $("#end_order_datetime").val();
|
|
|
|
if (eodate < sodate) {
|
|
eodate = sodate.substring(0,10)+" 23:59";
|
|
$("#end_order_datetime").val(eodate);
|
|
}
|
|
|
|
if (sdate < sodate) {
|
|
sdate = sodate.substring(0,10);
|
|
$("#schedule_start_date").val(sdate);
|
|
}
|
|
|
|
if (edate < sodate) {
|
|
edate = sodate.substring(0,10);
|
|
$("#schedule_end_date").val(edate);
|
|
}
|
|
|
|
if (edate < sdate) {
|
|
$("#schedule_end_date").val(sdate);
|
|
}
|
|
}
|
|
|
|
|
|
$("#menu_cutoff_date").change(function() {
|
|
var sdate = $("#schedule_start_date").val();
|
|
var edate = $("#schedule_end_date").val();
|
|
var cdate = $("#menu_cutoff_date").val();
|
|
|
|
if (cdate > sdate) {
|
|
var msg = "<?php displayLanguageText('TEXT-ALL-MENUS-PRIOR-TO-CUTOFF-DATE-WILL-BE-INACTIVE'); ?>\n";
|
|
msg += "<?php displayLanguageText('TEXT-CUTOFF-DATE'); ?>: "+cdate+"\n\n";
|
|
alert(msg);
|
|
}
|
|
});
|
|
|
|
|
|
$("#submitButton").click(function() {
|
|
var errorFlag = false;
|
|
var schedule_type = $("#schedule_type").val();
|
|
|
|
if ($("#custom_menu_end_dates_Y")) {
|
|
var custom_menu_end_dates = $("input[name='custom_menu_end_dates']:checked").val();
|
|
|
|
switch (schedule_type) {
|
|
case 'Hot Lunch':
|
|
case 'Date Sensitive':
|
|
break;
|
|
|
|
default:
|
|
if (custom_menu_end_dates == 'Y') {
|
|
alert("<?php displayLanguageText('ERRORMSG-CUSTOM-END-DATES-SCHEDULE-TYPE'); ?>");
|
|
errorFlag = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Check for required fields
|
|
var schedule_name = $("#schedule_name").val();
|
|
if (schedule_name.length == 0) {
|
|
alert("<?php displayLanguageText('ERRORMSG-TITLE-REQUIRED'); ?>");
|
|
errorFlag = true;
|
|
}
|
|
|
|
var schedule_start = $("#schedule_start_date").val();
|
|
var schedule_end = $("#schedule_end_date").val();
|
|
var schedule_order_start = $("#start_order_datetime").val();
|
|
var schedule_order_end = $("#end_order_datetime").val();
|
|
var schedule_type = $("#schedule_type").val();
|
|
var dateError = false;
|
|
|
|
var schedule_start_time = schedule_start+" 00:00:00";
|
|
|
|
if (schedule_order_start.length == 0) dateError = true;
|
|
if (schedule_order_end.length == 0) dateError = true;
|
|
|
|
if (schedule_type == 'Hot Lunch' || schedule_type == 'Date Sensitive') {
|
|
if (schedule_end < schedule_start) dateError = true;
|
|
if (schedule_end < schedule_start) dateError = true;
|
|
if (schedule_order_start > schedule_start_time) dateError = true;
|
|
}
|
|
if (schedule_order_end < schedule_order_start) dateError = true;
|
|
|
|
if (dateError) {
|
|
alert("<?php displayLanguageText('ERRORMSG-DATE-ORDER'); ?>");
|
|
errorFlag = true;
|
|
}
|
|
|
|
|
|
// Check that a menu day has been selected
|
|
if (schedule_type == 'Hot Lunch' || schedule_type == 'Date Sensitive') {
|
|
var menuDaySelected = false;
|
|
if ($("#lunch_days_Mon").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_Tue").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_Wed").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_Thu").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_Fri").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_Sat").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_Sun").prop('checked')) menuDaySelected = true;
|
|
if ($("#lunch_days_None").prop('checked')) menuDaySelected = true;
|
|
|
|
if (!menuDaySelected) {
|
|
alert("<?php displayLanguageText('ERRORMSG-NO-MENU-DAYS-SELECTED'); ?>");
|
|
errorFlag = true;
|
|
}
|
|
}
|
|
|
|
if (errorFlag) return false;
|
|
return true;
|
|
});
|
|
});
|
|
</script>
|
|
|