Files
HotLunches/supplier_products.form.php
T
2026-10-19 15:22:52 -07:00

571 lines
26 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','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' || $naction == 'add-combo') {
$initTableName = "supplier_products";
$tarray = initializeTableArray($initTableName);
extract($tarray, EXTR_OVERWRITE);
$package_qty = 1;
$package_cost = '0.00';
$margin_cost = '0.00';
$standard_offline_price = '0.00';
$standard_online_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_product = 'N';
$added_date = date("Y-m-d",time());
$bc_guideline_rating = 'Not Defined';
$min_options = 0;
$max_options = 0;
$min_options2 = 0;
$max_options2 = 0;
$min_options3 = 0;
$max_options3 = 0;
$min_options4 = 0;
$max_options4 = 0;
$min_options5 = 0;
$max_options5 = 0;
$min_options6 = 0;
$max_options6 = 0;
$hot_cold_food = 'Hot';
$status = 'Active';
}
$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);
$province_text = "Province";
if ($school_record['country'] == 'USA') $province_text = "State";
?>
<br>
<form method='post' enctype='multipart/form-data' action='/'>
<?php
$message_width = $default_form_width;
include "form.messages.php";
?>
<table width='<?php echo($default_form_width) ?>' class='content-table'>
<tr>
<td colspan='2' align='center' class='heading'><?php echo($PageTitle) ?></td>
</tr>
<tr>
<td colspan='2' align='center'>&nbsp;</td>
</tr>
<tr>
<td width='30%' align='right' valign='top'>Supplier: </td>
<td width='70%' align='left' valign='top'>
<select name='supplier_num'>
<?php
$swhere = "";
if ($_SESSION['UserInfo']['type'] == 'Supplier') $swhere = "and record_num = " . $_SESSION['UserInfo']['supplier_num'];
$query = "select * from suppliers " .
"where school_num = $supplier_school_num $swhere " .
"AND status = 'Active' " .
"order by supplier_name";
$results = db_query($query);
while ($row = db_fetch_array($results)) {
$name = $row['supplier_name'];
$rnum = $row['record_num'];
$selected = "";
if ($rnum == $supplier_num) $selected = " selected='selected'";
echo(" <option value='$rnum'$selected>$name</option>\n");
}
?>
</select>
</td>
</tr>
<tr>
<td align='right' valign='top'><?php echo($product_type) ?> Name: </td>
<td align='left' valign='top'>
<input type='text' name='product_name' id='product_name' value="<?php echo(str_replace('"',"&quot;",$product_name)) ?>" size='70'><br>
<span class='small'>The product name will be used as the default menu item name and displayed on the order form.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'>Description: </td>
<td align='left' valign='top'>
<input type='text' name='product_description' id='product_description' value="<?php echo(str_replace('"',"&quot;",$product_description)) ?>" size='70'><br>
<!-- <textarea name='product_description' id='product_description' cols=70 rows=2><?php echo($product_description) ?></textarea><br> -->
<span class='small'>The description will be displayed below the menu item name on the order form.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'>Label Title: </td>
<td align='left' valign='top'>
<input type='text' name='label_name' id='label_name' value="<?php echo(str_replace('"',"&quot;",$label_name)) ?>" size='30' maxlength='30'><br>
<span class='small'>The label title is used when printing labels and on some reports.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'>Supplier Code: </td>
<td align='left' valign='top'>
<input type='text' name='supplier_code' id='supplier_code' value="<?php echo(str_replace('"',"&quot;",$supplier_code)) ?>" size='30'><br>
<span class='small'>The product code can be printed on the supplier orders. This can be the UPC code or the supplier's product number.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'><?php displayLanguageText('TEXT-STATUS'); ?>: </td>
<td align='left' valign='top'>
<?php BuildFileRadio("status.txt","status",$status); ?>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top'>Package Qty: </td>
<td align='left' valign='top'>
<input type='text' name='package_qty' id='package_qty' value="<?php echo($package_qty) ?>" size='10' style='text-align: right;'><br>
<span class='small'>This is the number of this product that are purchased in a package. Typically this is one but for some snack items or baked goods this is the number of units that you purchase. The system will calculate the correct quantity needed when generating supplier orders.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'>Package Cost: </td>
<td align='left' valign='top'>
<input type='text' name='package_cost' id='package_cost' value="<?php printf($costFmt,$package_cost) ?>" size='10' style='text-align: right;'>
<?php if (in_array($school_record['reseller'], array('esns','backpac'))) { ?>
<input type='text' name='margin_cost' id='margin_cost' value="<?php printf($costFmt,$margin_cost) ?>" size='10' style='text-align: right;'>
<?php } ?>
<br>
<span class='small'>This is the cost of a package of this product, not necessarily the cost of a single product unless the product quantity above is one. The system will calculate the correct product cost based on the package quantity and the package cost.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'>Taxable: </td>
<td align='left' valign='top'>
<?php BuildFileRadio("yn.txt","taxable_product",$taxable_product); ?><br>
<span class='small'>If this supplier has taxable product orders this will allow you to override the tax calculation on a product.</span>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top'>On-Line Selling Price: </td>
<td align='left' valign='top'><input type='text' name='standard_online_price' id='standard_online_price' value="<?php echo($standard_online_price) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr>
<td align='right' valign='top'>Paper Selling Price: </td>
<td align='left' valign='top'><input type='text' name='standard_offline_price' id='standard_offline_price' value="<?php echo($standard_offline_price) ?>" size='10' style='text-align: right;'></td>
</tr>
<?php if ($school_record['special_item_prices'] == 'Y') { ?>
<tr>
<td align='right' valign='top'>Special Price 1: </td>
<td align='left' valign='top'><input type='text' name='special_price1' id='special_price1' value="<?php echo($special_price1) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr>
<td align='right' valign='top'>Special Price 2: </td>
<td align='left' valign='top'><input type='text' name='special_price2' id='special_price2' value="<?php echo($special_price2) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr>
<td align='right' valign='top'>Special Price 3: </td>
<td align='left' valign='top'><input type='text' name='special_price3' id='special_price3' value="<?php echo($special_price3) ?>" size='10' style='text-align: right;'></td>
</tr>
<?php } ?>
<?php if ($school_record['implement_multiple_item_prices'] == 'Y') { ?>
<tr>
<td align='right' valign='top'>Number of Alternate Prices: </td>
<td align='left' valign='top'>
<select name='number_of_alternate_prices' id='number_of_alternate_prices'>
<?php
for ($n = 0; $n <= 10; $n++) {
$selected = "";
if (isset($number_of_alternate_prices) && $number_of_alternate_prices == $n) $selected = " selected='selected'";
echo(" <option value='$n'$selected>$n</option>\n");
}
?>
</select>
</td>
</tr>
<tr class='alt1 alt2 alt3 alt4 alt5 alt6 alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 1: </td>
<td align='left' valign='top'><input type='text' name='alternate_price1' id='alternate_price1' value="<?php echo($alternate_price1) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt2 alt3 alt4 alt5 alt6 alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 2: </td>
<td align='left' valign='top'><input type='text' name='alternate_price2' id='alternate_price2' value="<?php echo($alternate_price2) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt3 alt4 alt5 alt6 alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 3: </td>
<td align='left' valign='top'><input type='text' name='alternate_price3' id='alternate_price3' value="<?php echo($alternate_price3) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt4 alt5 alt6 alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 4: </td>
<td align='left' valign='top'><input type='text' name='alternate_price4' id='alternate_price4' value="<?php echo($alternate_price4) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt5 alt6 alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 5: </td>
<td align='left' valign='top'><input type='text' name='alternate_price5' id='alternate_price5' value="<?php echo($alternate_price5) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt6 alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 6: </td>
<td align='left' valign='top'><input type='text' name='alternate_price6' id='alternate_price6' value="<?php echo($alternate_price6) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt7 alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 7: </td>
<td align='left' valign='top'><input type='text' name='alternate_price7' id='alternate_price7' value="<?php echo($alternate_price7) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt8 alt9 alt10'>
<td align='right' valign='top'>Alternate Price 8: </td>
<td align='left' valign='top'><input type='text' name='alternate_price8' id='alternate_price8' value="<?php echo($alternate_price8) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt9 alt10'>
<td align='right' valign='top'>Alternate Price 9: </td>
<td align='left' valign='top'><input type='text' name='alternate_price9' id='alternate_price9' value="<?php echo($alternate_price9) ?>" size='10' style='text-align: right;'></td>
</tr>
<tr class='alt10'>
<td align='right' valign='top'>Alternate Price 10: </td>
<td align='left' valign='top'><input type='text' name='alternate_price10' id='alternate_price10' value="<?php echo($alternate_price10) ?>" size='10' style='text-align: right;'></td>
</tr>
<?php } ?>
<?php if ($school_record['display_bc_food_guidelines'] == 'Y') { ?>
<tr>
<td align='right' valign='top'>Food Guidelines Rating: </td>
<td align='left' valign='top'>
<?php BuildFileRadio("bc_guideline_rating.txt","bc_guideline_rating",$bc_guideline_rating) ?>
</td>
</tr>
<?php } ?>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<?php if ($product_type == 'Product') { ?>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Options Title: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='options_title' id='options_title' value='<?php echo($options_title) ?>' size='20'><br>
<span class='small'>This title will be displayed before the options when a menu is displayed.</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Options: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<textarea name='product_options' rows='4' cols='60'><?php echo($product_options) ?></textarea><br>
<span class='small'>These are options for this product that will be listed on the order form and the detailed classroom order report. Options should be used as modifiers for the menu item.
If the option is a different item it should be from the same supplier or you will not be able to generate useful supplier orders. It is difficult to get the count of the
options for suppliers and options are not listed on supplier orders in the same way that menu items are. <b>List one option per line.</b></span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Default Options: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<textarea name='default_options' rows='2' cols='60'><?php echo($default_options) ?></textarea><br>
<span class='small'>The options listed in this set will be flagged as selected when the order form is displayed.</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Minimum Options: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='min_options' id='min_options' value="<?php echo($min_options) ?>" size='5'><br>
<span class='small'>Set to zero if no options selected is acceptable</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Maximum Options: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='max_options' id='max_options' value="<?php echo($max_options) ?>" size='5'><br>
<span class='small'>Set to zero if there is no limit to the number of options that can be selected</span>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Options Title 2: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='options2_title' id='options2_title' value='<?php echo($options2_title) ?>' size='20'><br>
<span class='small'>This title will be displayed before the options when a menu is displayed.</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Options 2: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<textarea name='product_options2' rows='4' cols='60'><?php echo($product_options2) ?></textarea><br>
<span class='small'>These are options for this product that will be listed on the order form and the detailed classroom order report. Options should be used as modifiers for the menu item.
If the option is a different item it should be from the same supplier or you will not be able to generate useful supplier orders. It is difficult to get the count of the
options for suppliers and options are not listed on supplier orders in the same way that menu items are. <b>List one option per line.</b></span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Default Options 2: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<textarea name='default_options2' rows='2' cols='60'><?php echo($default_options2) ?></textarea><br>
<span class='small'>The options listed in this set will be flagged as selected when the order form is displayed.</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Minimum Options 2: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='min_options2' id='min_options2' value="<?php echo($min_options2) ?>" size='5'><br>
<span class='small'>Set to zero if no options selected is acceptable</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Maximum Options 2: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='max_options2' id='max_options2' value="<?php echo($max_options2) ?>" size='5'><br>
<span class='small'>Set to zero if there is no limit to the number of options that can be selected</span>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Options Title 3: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='options3_title' id='options3_title' value='<?php echo($options3_title) ?>' size='20'><br>
<span class='small'>This title will be displayed before the options when a menu is displayed.</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Options 3: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<textarea name='product_options3' rows='4' cols='60'><?php echo($product_options3) ?></textarea><br>
<span class='small'>These are options for this product that will be listed on the order form and the detailed classroom order report. Options should be used as modifiers for the menu item.
If the option is a different item it should be from the same supplier or you will not be able to generate useful supplier orders. It is difficult to get the count of the
options for suppliers and options are not listed on supplier orders in the same way that menu items are. <b>List one option per line.</b></span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Default Options 3: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<textarea name='default_options3' rows='2' cols='60'><?php echo($default_options3) ?></textarea><br>
<span class='small'>The options listed in this set will be flagged as selected when the order form is displayed.</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Minimum Options 3: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='min_options3' id='min_options3' value="<?php echo($min_options3) ?>" size='5'><br>
<span class='small'>Set to zero if no options selected is acceptable</span>
</td>
</tr>
<tr>
<td align='right' valign='top' bgcolor='#dddddd'>Maximum Options 3: </td>
<td align='left' valign='top' bgcolor='#dddddd'>
<input type='text' name='max_options3' id='max_options3' value="<?php echo($max_options3) ?>" size='5'><br>
<span class='small'>Set to zero if there is no limit to the number of options that can be selected</span>
</td>
</tr>
<?php } else { ?>
<input type='hidden' name='options_title' value=''>
<input type='hidden' name='product_options' value=''>
<input type='hidden' name='default_options' value=''>
<input type='hidden' name='min_options' value='0'>
<input type='hidden' name='max_options' value='0'>
<input type='hidden' name='options2_title' value=''>
<input type='hidden' name='product_options2' value=''>
<input type='hidden' name='default_options2' value=''>
<input type='hidden' name='min_options2' value='0'>
<input type='hidden' name='max_options2' value='0'>
<input type='hidden' name='options3_title' value=''>
<input type='hidden' name='product_options3' value=''>
<input type='hidden' name='default_options3' value=''>
<input type='hidden' name='min_options3' value='0'>
<input type='hidden' name='max_options3' value='0'>
<tr>
<td align='right' valign='top'>Component Products: </td>
<td align='left' valign='top'>
<select name='component_products[]' size='10' multiple>
<?php
$query = "SELECT * FROM suppliers " .
"WHERE school_num = $supplier_school_num " .
"AND status = 'Active' " .
"ORDER BY supplier_name";
$suppliers = db_query($query);
if (db_num_rows($suppliers) > 0) {
// Process each supplier
while ($supplier = db_fetch_assoc($suppliers)) {
$supplier_num = $supplier['record_num'];
$supplier_name = $supplier['supplier_name'];
$query = "SELECT * FROM supplier_products " .
"WHERE supplier_num = $supplier_num " .
"AND school_num = $supplier_school_num " .
"AND status = 'Active' " .
"AND product_type = 'Product' " .
"ORDER BY sequence,product_name";
$products = db_query($query);
// Process each product
if (db_num_rows($products) > 0) {
echo(" <optgroup label='$supplier_name'>\n");
while ($product = db_fetch_assoc($products)) {
$pnum = $product['record_num'];
$pname = $product['product_name'];
$selected = "";
if (isset($record_num) && $record_num > 0) {
$numSelections = db_getVal("SELECT count(*) FROM supplier_products_combos " .
"WHERE school_num = $supplier_school_num AND primary_product_num = $record_num AND component_product_num = $pnum");
if ($numSelections) $selected = " selected='selected'";
}
echo(" <option value='$pnum'$selected>$pname</option>\n");
}
echo(" </optgroup>\n");
}
}
}
?>
</select>
</td>
</tr>
<?php } ?>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top'>Hot or Cold Food Classification: </td>
<td align='left' valign='top'>
<?php BuildFileRadio("hot_cold.txt","hot_cold_food",$hot_cold_food) ?><br>
<span class='small'>This value is used when printing labels for hot food and for cold food.</span>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<?php
// Determine if there are any images available
$files = array();
if (is_dir($imagedir)) {
$dir = opendir($imagedir);
while (($file = readdir($dir)) != false) {
if ($file == ".") continue;
if ($file == "..") continue;
$files[] = $file;
}
}
if (count($files) > 0) {
sort($files);
?>
<tr>
<td align='right' valign='top'>Selected Image: </td>
<td align='left' valign='top'>
<select name='image'>
<option value=''>No Image</option>
<?php
for ($i = 0; $i < count($files); $i++) {
$fname = $files[$i];
$selected = "";
if ($fname == $image) $selected = " selected='selected'";
echo(" <option value='$fname'$selected>$fname</option>\n");
}
?>
</select>
</td>
</tr>
<?php
}
?>
<tr>
<td align='right' valign='top'>New Image to Upload: </td>
<td align='left' valign='top'>
<input type='file' name='filename' id='filename' size='40'><br>
<span class='small'>Upload a new image from your computer for this product.<br>
Note: The maximum height or width is 300 pixels. Larger images will be resized.</span>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top'><?php displayLanguageText('TEXT-ADDITIONAL-INFORMATION'); ?>: </td>
<td align='left' valign='top'>
<textarea name='nutritional_info' rows='4' cols='80'><?php echo($nutritional_info) ?></textarea><br>
<span class='small'>Additional information that will be available on the on-line order forms.</span>
</td>
</tr>
<tr>
<td align='right' valign='top'><?php displayLanguageText('TEXT-ITEM-MESSAGE'); ?>: </td>
<td align='left' valign='top'>
<input type='text' name='item_message' id='item_message' value="<?php echo($item_message) ?>" size='80'>
</td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
<td align='right' valign='top'><?php displayLanguageText('TEXT-ADDED-DATE'); ?>: </td>
<td align='left' valign='top'><input type='text' name='added_date' id='added_date' value="<?php echo($added_date) ?>" size='15' class='date-field'></td>
</tr>
<tr>
<td align='right' valign='top'>Notes: </td>
<td align='left' valign='top'><textarea name='notes' rows='5' cols='60'><?php echo($notes) ?></textarea></td>
</tr>
<tr>
<td colspan='2' align='center'>
<br>
<input type='submit' 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='paction' value='<?php echo($paction) ?>'>
<input type='hidden' name='record_num' value='<?php echo($record_num) ?>'>
<input type='hidden' name='supplier_product_num' value='<?php echo($record_num) ?>'>
<input type='hidden' name='product_type' value='<?php echo($product_type) ?>'>
<br>
<br>
</td>
</tr>
</table>
</form>
<script>
$(document).ready(function() {
var num_alt_prices = <?php echo(intval($number_of_alternate_prices)) ?>;
$(".alt10").hide();
if (num_alt_prices > 0) $(".alt"+num_alt_prices).show();
$("#number_of_alternate_prices").change(function() {
var num_alt_prices = $(this).val();
$(".alt10").hide();
if (num_alt_prices > 0) $(".alt"+num_alt_prices).show();
});
});
</script>