0) $selected_supplier = $_GET['selected_supplier']; if (array_key_exists('selected_supplier',$_POST) && strlen($_POST['selected_supplier']) > 0) $selected_supplier = $_POST['selected_supplier']; if (!isset($selected_supplier)) { $error_message = getLanguageText('ERRORMSG-NO-SUPPLIER-SELECTED'); include "form.messages.php"; return; } if (isset($selected_supplier)) { $query = "select * from suppliers where school_num = $supplier_school_num and record_num = $selected_supplier"; // writeLog($query); $results = db_query($query); if (db_num_rows($results) != 1) { echo("
\n"); $error_message = getLanguageText('ERRORMSG-NO-SUPPLIER-SELECTED'); // writeLog($error_message); include "form.messages.php"; return; } $supplier = db_fetch_array($results); $supplier_name = $supplier['supplier_name']; $subtitle = " - " . $supplier['supplier_name']; $swhere = "and record_num = $selected_supplier "; // writeLog("Supplier: $supplier_name"); } // // Process all actions to list and edit records // $naction = ""; $templatePageTitle = getLanguageText('TEXT-POST-SUPPLIER-PRODUCT-TO-SELECTED-SCHEDULE'); if (array_key_exists('naction',$_GET)) $naction = $_GET['naction']; if (array_key_exists('naction',$_POST)) $naction = $_POST['naction']; switch (strtolower($naction)) { case "post": $selected_products = $_POST['selected_products']; $selected_schedules = $_POST['selected_schedules']; if (!is_array($selected_products)) { // writeLog("selected_products is not an array"); $error_message = getLanguageText('ERRORMSG-NO-PRODUCTS-SELECTED'); echo("
\n"); include "form.messages.php"; break; } $num_products = count($selected_products); // writeLog("num_products: $num_products"); // Ensure that there are products to post if ($num_products == 0) { $error_message = getLanguageText('ERRORMSG-NO-PRODUCTS-SELECTED'); echo("
\n"); include "form.messages.php"; break; } // Check that there is an item to post $items_to_post = false; if (array_key_exists('post_title', $_POST) && $_POST['post_title'] == 'Y') $items_to_post = true; if (array_key_exists('post_description', $_POST) && $_POST['post_description'] == 'Y') $items_to_post = true; if (array_key_exists('post_label', $_POST) && $_POST['post_label'] == 'Y') $items_to_post = true; if (array_key_exists('post_online', $_POST) && $_POST['post_online'] == 'Y') $items_to_post = true; if (array_key_exists('post_paper', $_POST) && $_POST['post_paper'] == 'Y') $items_to_post = true; if (array_key_exists('post_special1', $_POST) && $_POST['post_special1'] == 'Y') $items_to_post = true; if (array_key_exists('post_special2', $_POST) && $_POST['post_special2'] == 'Y') $items_to_post = true; if (array_key_exists('post_special3', $_POST) && $_POST['post_special3'] == 'Y') $items_to_post = true; if (array_key_exists('post_options', $_POST) && $_POST['post_options'] == 'Y') $items_to_post = true; if (array_key_exists('post_rating', $_POST) && $_POST['post_rating'] == 'Y') $items_to_post = true; if (array_key_exists('post_message', $_POST) && $_POST['post_message'] == 'Y') $items_to_post = true; if (array_key_exists('post_image', $_POST) && $_POST['post_image'] == 'Y') $items_to_post = true; if (array_key_exists('post_hot_cold_food', $_POST) && $_POST['post_hot_cold_food'] == 'Y') $items_to_post = true; if (array_key_exists('post_taxable', $_POST) && $_POST['post_taxable'] == 'Y') $items_to_post = true; if (!$items_to_post) { $error_message = getLanguageText('ERRORMSG-NO-FEATURES-TO-POST'); // writeLog($error_message); echo("
\n"); include "form.messages.php"; break; } $nSchedules = count($selected_schedules); // writeLog("nSchedules: $nSchedules"); for ($sn = 0; $sn < count($selected_schedules); $sn++) { $selected_schedule = $selected_schedules[$sn]; // Get schedule title $query = "SELECT schedule_name, school_num FROM hotlunch_schedules WHERE record_num = $selected_schedule"; $results = db_query($query); if (db_num_rows($results) == 0) continue; $schedule = db_fetch_assoc($results); $schedule_name = $schedule['schedule_name']; $school_num = $schedule['school_num']; $school_name = db_getVal("SELECT school_name FROM schools WHERE record_num = $school_num"); // Start the table ?>
: -

0) { // Get set of items to update $items = ""; while ($row = db_fetch_array($results)) { if (strlen($items)) $items .= ", "; $items .= $row['record_num']; } // Create SQL statement $set = ""; // Post the item_title if (array_key_exists('post_title', $_POST) && $_POST['post_title'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "item_title = '" . db_escape_string($product['product_name']) . "'"; } // Post the item_description if (array_key_exists('post_description', $_POST) && $_POST['post_description'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "item_description = '" . db_escape_string($product['product_description']) . "'"; } // Post the label if (array_key_exists('post_label', $_POST) && $_POST['post_label'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "label_title = '" . db_escape_string($product['label_name']) . "'"; } // Post the online price if (array_key_exists('post_online', $_POST) && $_POST['post_online'] == 'Y') { if (strlen($set)) $set .= ", "; $price = floatval($product['standard_online_price']); $set .= "online_price = $price"; if ($school_record['implement_multiple_item_prices'] == 'Y') { $num = intval($product['number_of_alternate_prices']); $set .= ", number_of_alternate_prices = $num"; for ($n = 1; $n <= 10; $n++) { $price = floatval($product["alternate_price$n"]); $set .= ", alternate_price$n = $price"; } } } // Post the paper price if (array_key_exists('post_paper', $_POST) && $_POST['post_paper'] == 'Y') { if (strlen($set)) $set .= ", "; $price = $product['standard_offline_price']; if ($price == '') $price = '0'; $set .= "offline_price = $price"; } // Post the special price 1 if (array_key_exists('post_special1', $_POST) && $_POST['post_special1'] == 'Y') { if (strlen($set)) $set .= ", "; $price = $product['special_price1']; if ($price == '') $price = '0'; $set .= "special_price1 = $price"; } // Post the special price 2 if (array_key_exists('post_special2', $_POST) && $_POST['post_special2'] == 'Y') { if (strlen($set)) $set .= ", "; $price = $product['special_price2']; if ($price == '') $price = '0'; $set .= "special_price2 = $price"; } // Post the special price 3 if (array_key_exists('post_special3', $_POST) && $_POST['post_special3'] == 'Y') { if (strlen($set)) $set .= ", "; $price = $product['special_price3']; if ($price == '') $price = '0'; $set .= "special_price3 = $price"; } // Post the taxable flag if (array_key_exists('post_taxable', $_POST) && $_POST['post_taxable'] == 'Y') { if (strlen($set)) $set .= ", "; $taxable = $product['taxable_product']; $set .= "taxable_item = '$taxable'"; } // Post the options if (array_key_exists('post_options', $_POST) && $_POST['post_options'] == 'Y') { if (strlen($set)) $set .= ", "; $min = intval($product['min_options'],0); $max = intval($product['max_options'],0); $min2 = intval($product['min_options2'],0); $max2 = intval($product['max_options2'],0); $min3 = intval($product['min_options3'],0); $max3 = intval($product['max_options3'],0); $set .= "options_title = '" . db_escape_string($product['options_title']) . "'," . "options = '" . db_escape_string($product['product_options']) . "'," . "default_options = '" . db_escape_string($product['default_options']) . "'," . "min_options = $min, max_options = $max, " . "options2_title = '" . db_escape_string($product['options2_title']) . "'," . "options2 = '" . db_escape_string($product['product_options2']) . "'," . "default_options2 = '" . db_escape_string($product['default_options2']) . "'," . "min_options2 = $min2, max_options2 = $max2, " . "options3_title = '" . db_escape_string($product['options3_title']) . "'," . "options3 = '" . db_escape_string($product['product_options3']) . "'," . "default_options3 = '" . db_escape_string($product['default_options3']) . "'," . "min_options3 = $min3, max_options3 = $max3"; } // Post the nutritional info if (array_key_exists('post_nutritional', $_POST) && $_POST['post_nutritional'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "nutritional_info = '" . db_escape_string($product['nutritional_info']) . "'"; } // Post the image if (array_key_exists('post_image', $_POST) && $_POST['post_image'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "image = '" . db_escape_string($product['image']) . "'"; } // Post the hot_cold_food if (array_key_exists('post_hot_cold_food', $_POST) && $_POST['post_hot_cold_food'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "hot_cold_food = '" . $product['hot_cold_food'] . "'"; } // Post the item message if (array_key_exists('post_message', $_POST) && $_POST['post_message'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "item_message = '" . db_escape_string($product['item_message']) . "'"; } // Post the Food rating if (array_key_exists('post_rating', $_POST) && $_POST['post_rating'] == 'Y') { if (strlen($set)) $set .= ", "; $set .= "bc_guideline_rating = '" . db_escape_string($product['bc_guideline_rating']) . "'"; } if (strlen($set)) $set .= ", "; $set .= "sales_summary_item = '" . $product['sales_summary_item'] . "'"; $query = "UPDATE hotlunch_menu_items SET $set WHERE record_num IN ($items)"; db_query($query); echo("\n"); } $class = 'data-even'; if ($i % 2) $class = 'data-odd'; ?>



\n"); echo(" \n"); echo(" \n"); } echo(" \n"); echo(" \n"); echo(" \n"); ?> \n"); echo(" \n"); echo(" \n"); echo(" \n"); $count++; } $scount++; } ?>
 
$supplier_name
:
$product_name

$school_num, 'school_name' => $school_record['school_name']); if ($school_record['reseller'] != 'hotlunch' && $school_record['status'] == 'Special') { $reseller = $school_record['reseller']; $schools = db_query("SELECT school_name, record_num FROM schools WHERE reseller = '$reseller' AND status = 'Active' ORDER BY school_name"); if (db_num_rows($schools)) { while ($row = db_fetch_assoc($schools)) { $SchoolSet[] = $row; } } } // Get set of upcoming schedules $ScheduleSet = array(); $cutoff = date("Y-m-d",time() - 60 * 60 * 24 * 100); $m = date("m",time()); if ($m < '08') $cutoff = date("Y-m-d",time() - 60 * 60 * 24 * 200); for ($i = 0; $i < count($SchoolSet); $i++) { $school_num = $SchoolSet[$i]['record_num']; $school_name = $SchoolSet[$i]['school_name']; $query = "select * from hotlunch_schedules " . "where school_num = $school_num " . "and status not in ('Disabled','Deleted') " . "and schedule_start_date > '$cutoff' " . "order by $scheduleSortOrder"; $schedules = db_query($query); if (db_num_rows($schedules) > 0) { while ($row = db_fetch_assoc($schedules)) { $row['school_name'] = $school_name; $ScheduleSet[] = $row; } } } if (count($ScheduleSet)) { $size = count($ScheduleSet) + 1; if ($size > 30) $size = 30; ?>
:


:
:
:
:
:
:
:
:
:
:
:
:
:
:
:

'>