\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);
$online_price = '0.00';
$offline_price = '0.00';
$special_price1 = '0.00';
$special_price2 = '0.00';
$special_price3 = '0.00';
$number_of_alternate_prices = 0;
$alternate_price1 = '0.0';
$alternate_price2 = '0.0';
$alternate_price3 = '0.0';
$alternate_price4 = '0.0';
$alternate_price5 = '0.0';
$alternate_price6 = '0.0';
$alternate_price7 = '0.0';
$alternate_price8 = '0.0';
$alternate_price9 = '0.0';
$alternate_price10 = '0.0';
$taxable_item = 'N';
$min_quantity = 0;
$warn_quantity = 0;
$max_quantity = 0;
$max_quantity_by = 'Order';
$number_of_labels = 1;
$quantity_available = 0;
$min_options = 0;
$max_options = 0;
$min_options2 = 0;
$max_options2 = 0;
$min_options3 = 0;
$max_options3 = 0;
$menu_group = "";
$active = 'Y';
$display_price = 'Y';
$item_type = 'Item';
$menu_item_format = 'D';
}
if ($naction == 'add-heading') {
$online_price = '0.00';
$offline_price = '0.00';
$special_price1 = '0.00';
$special_price2 = '0.00';
$special_price3 = '0.00';
$number_of_alternate_prices = 0;
$alternate_price1 = '0.0';
$alternate_price2 = '0.0';
$alternate_price3 = '0.0';
$alternate_price4 = '0.0';
$alternate_price5 = '0.0';
$alternate_price6 = '0.0';
$alternate_price7 = '0.0';
$alternate_price8 = '0.0';
$alternate_price9 = '0.0';
$alternate_price10 = '0.0';
$taxable_item = 'N';
$min_quantity = 0;
$warn_quantity = 0;
$max_quantity = 0;
$max_quantity_by = 'Order';
$quantity_available = 0;
$min_options = 0;
$max_options = 0;
$min_options2 = 0;
$max_options2 = 0;
$min_options3 = 0;
$max_options3 = 0;
$menu_group = "";
$active = 'Y';
$display_price = 'N';
}
$min_quantity = intval($min_quantity);
$warn_quantity = intval($warn_quantity);
$max_quantity = intval($max_quantity);
$quantity_available = intval($quantity_available);
$min_options = intval($min_options);
$max_options = intval($max_options);
$min_options2 = intval($min_options2);
$max_options2 = intval($max_options2);
$min_options3 = intval($min_options3);
$max_options3 = intval($max_options3);
$alternate_price1 = number_format($alternate_price1,2);
$alternate_price2 = number_format($alternate_price2,2);
$alternate_price3 = number_format($alternate_price3,2);
$alternate_price4 = number_format($alternate_price4,2);
$alternate_price5 = number_format($alternate_price5,2);
$alternate_price6 = number_format($alternate_price6,2);
$alternate_price7 = number_format($alternate_price7,2);
$alternate_price8 = number_format($alternate_price8,2);
$alternate_price9 = number_format($alternate_price9,2);
$alternate_price10 = number_format($alternate_price10,2);
$numClasses = db_getVal("select count(*) from classes where school_num = $base_school_num and entry_type = 'Class'");
$numItemClasses = 0;
$select_classes = 'All Classes';
if (isset($record_num) && intval($record_num) > 0) {
$query = "SELECT count(*) FROM hotlunch_menu_items_classes " .
"WHERE school_num = $school_num " .
"AND schedule_num = $schedule_num " .
"AND menu_num = $menu_num " .
"AND menu_item_num = $record_num";
$numItemClasses = intval(db_getVal($query));
if ($numItemClasses > 0) {
$select_classes = 'Selected Classes';
}
}
if (isset($schedule_num) && !isset($hotlunch_schedule)) {
$hotlunch_schedule = db_getVal("SELECT * FROM hotlunch_schedules WHERE school_num = $school_num AND record_num = $schedule_num");
}
?>