\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"); } ?>
0) { $products_array = array(); $all_items = array(); $count = 0; // Process each supplier while ($supplier = db_fetch_array($suppliers)) { $supplier_num = $supplier['record_num']; $supplier_name = $supplier['supplier_name']; $sname = $SchoolNames[$supplier['school_num']]; $supplier_name .= " ($sname)"; $query = "select * from supplier_products " . "where supplier_num = $supplier_num " . "and school_num = $supplier_school_num " . "and product_type = 'Product' " . "AND status = 'Active' " . "order by sequence,product_name"; $products = db_query($query); // Process each product if (db_num_rows($products) > 0) { $products_array[$count]['Supplier'] = $supplier_name; $items_array = array(); $icount = 0; while ($row = db_fetch_array($products)) { $descr = ""; if (strlen($row['product_description'])) $descr = " - " . $row['product_description']; $name = $row['product_name'] . "$descr (" . $row['package_qty'] . " for $currencySymbol" . number_format($row['package_cost'],2) . ")"; $pnum = $row['record_num']; $items_array[$icount]['num'] = $pnum; $items_array[$icount]['name'] = $name; $entry = array(); $entry['num'] = $pnum; $entry['name'] = $row['product_name']; $entry['description'] = $row['product_description']; $entry['label'] = $row['label_name']; $entry['online'] = $row['standard_online_price']; $entry['offline'] = $row['standard_offline_price']; $entry['special1'] = $row['special_price1']; $entry['special2'] = $row['special_price2']; $entry['special3'] = $row['special_price3']; $entry['number_of_alternate_prices'] = $row['number_of_alternate_prices']; $entry['alternate_price1'] = $row['alternate_price1']; $entry['alternate_price2'] = $row['alternate_price2']; $entry['alternate_price3'] = $row['alternate_price3']; $entry['alternate_price4'] = $row['alternate_price4']; $entry['alternate_price5'] = $row['alternate_price5']; $entry['alternate_price6'] = $row['alternate_price6']; $entry['alternate_price7'] = $row['alternate_price7']; $entry['alternate_price8'] = $row['alternate_price8']; $entry['alternate_price9'] = $row['alternate_price9']; $entry['alternate_price10'] = $row['alternate_price10']; $entry['taxable_item'] = $row['taxable_product']; $entry['options_title'] = $row['options_title']; $entry['options'] = $row['product_options']; $entry['default_options'] = $row['default_options']; $entry['min_options'] = $row['min_options']; $entry['max_options'] = $row['max_options']; $entry['options2_title'] = $row['options2_title']; $entry['options2'] = $row['product_options2']; $entry['default_options2'] = $row['default_options2']; $entry['min_options2'] = $row['min_options2']; $entry['max_options2'] = $row['max_options2']; $entry['options3_title'] = $row['options3_title']; $entry['options3'] = $row['product_options3']; $entry['default_options3'] = $row['default_options3']; $entry['min_options3'] = $row['min_options3']; $entry['max_options3'] = $row['max_options3']; $entry['hot_cold_food'] = $row['hot_cold_food']; if (array_key_exists('min_quantity', $row)) $entry['min_quantity'] = $row['min_quantity']; if (array_key_exists('warn_quantity', $row)) $entry['warn_quantity'] = $row['warn_quantity']; if (array_key_exists('max_quantity', $row)) $entry['max_quantity'] = $row['max_quantity']; if (array_key_exists('max_quantity_by', $row)) $entry['max_quantity_by'] = $row['max_quantity_by']; if (array_key_exists('image', $row)) $entry['image'] = $row['image']; if (array_key_exists('nutrition', $row)) $entry['nutrition'] = $row['nutritional_info']; if (array_key_exists('rating', $row)) $entry['rating'] = $row['bc_guideline_rating']; $all_items[] = $entry; $icount++; } $products_array[$count]['Items'] = $items_array; $count++; } } $menu_items = array(); for ($i = 0; $i < $num_products; $i++) { $menu_items[$i]['qty'] = 1; $menu_items[$i]['num'] = 0; } // Get existing products for this menu item $displayRows = 2; if ($naction != 'add') { $query = "select hmp.*,sp.product_name " . "from hotlunch_menu_products as hmp,supplier_products as sp " . "where hmp.school_num = $school_num " . "and menu_item_num = $record_num " . "and hmp.supplier_product_num = sp.record_num " . "and sp.school_num = $supplier_school_num " . "order by product_sequence"; $results = db_query($query); if (db_num_rows($results)) { $count = 0; while ($row = db_fetch_array($results)) { $pnum = $row['supplier_product_num']; $pqty = $row['supplier_product_qty']; $menu_items[$count]['num'] = $pnum; $menu_items[$count]['qty'] = $pqty; $count++; if ($count > 1) $displayRows++; } } } if (count($products_array) > 0) { ?> "); $dir = opendir($imagedir); $imageFiles = array(); while (($file = readdir($dir)) != false) { if ($file == ".") continue; if ($file == "..") continue; $imageFiles[] = $file; } if (count($imageFiles) > 0) { sort($imageFiles); ?> 0) { ?>
 
:
: $displayRows) $bgclass .= ' invisible'; ?>
' size='5'> \n"); $items_array = $products_array[$i]['Items']; for ($j = 0; $j < count($items_array); $j++) { $pnum = $items_array[$j]['num']; $name = $items_array[$j]['name']; if (strlen($name) > $maxLength) $name = substr($name, 0, $maxLength) . "..."; $selected = ""; if ($menu_items[$row]['num'] == $pnum) $selected = " selected='selected'"; echo("\n"); } echo("\n"); } ?>
 
: " size='80' pname='product_name' class='form-field item-field'>
: " size='100' pname='product_description' class='form-field item-field'>
: " size='30' maxlength='30' pname='label_name' class='form-field item-field'>
 
:
:
:
 
:
:
:
:
:
:
Number of Alternate Prices:
Alternate Price 1:
Alternate Price 2:
Alternate Price 3:
Alternate Price 4:
Alternate Price 5:
Alternate Price 6:
Alternate Price 7:
Alternate Price 8:
Alternate Price 9:
Alternate Price 10:
:
 
:
 
:
:
:
:
:
:
:
 
:
:
:
span>
:
:
 
:
:
:
:
:
 
:
:
:
:
:
:
:
 
:
:
: " size='70' class='form-field'>
: " size='70' class='form-field'>
:
: