142 lines
5.4 KiB
PHP
142 lines
5.4 KiB
PHP
<?php
|
|
require_once("include/globals.php");
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
?>
|
|
|
|
<br>
|
|
<form method='post' action='/' name='updateform'>
|
|
<?php
|
|
|
|
$form_width = '80%';
|
|
$message_width = $form_width;
|
|
include "form.messages.php";
|
|
|
|
$numDataCols = 7;
|
|
if ($school_record['display_bc_food_guidelines'] == 'Y') $numDataCols = 7;
|
|
|
|
?>
|
|
<table width='95%' class='content-table'>
|
|
<tr>
|
|
<td align='center' class='heading'>Supplier Product Price Update</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='center'>
|
|
<br>
|
|
<table width='95%' cellpadding='1' cellspacing='1' border='0' class='content-table'>
|
|
<?php
|
|
// Get suppliers to process
|
|
$swhere = "and status = 'Active' ";
|
|
if (isset($selected_supplier)) $swhere = "and record_num = $selected_supplier ";
|
|
$query = "select * from suppliers " .
|
|
"where school_num = $school_num " .
|
|
"and status = 'Active' " .
|
|
$swhere .
|
|
"order by supplier_name";
|
|
$suppliers = db_query($query);
|
|
|
|
while ($supplier = db_fetch_array($suppliers)) {
|
|
$supplier_num = $supplier['record_num'];
|
|
$supplier_name = $supplier['supplier_name'];
|
|
|
|
// Get products for this supplier
|
|
$query = "select * from supplier_products " .
|
|
"where school_num = $supplier_school_num " .
|
|
"and supplier_num = $supplier_num " .
|
|
"AND status = 'Active' " .
|
|
"order by sequence,product_name";
|
|
$products = db_query($query);
|
|
|
|
if (db_num_rows($products) == 0) continue;
|
|
|
|
?>
|
|
<tr>
|
|
<td align='left' colspan='<?php echo($numDataCols) ?>' class='success'>
|
|
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
|
|
<tr>
|
|
<td align='left' class='success'><b><?php echo($supplier_name) ?></td>
|
|
</tr>
|
|
</td>
|
|
</table>
|
|
</tr>
|
|
<tr>
|
|
<td width='50%' align='left' class='oitem'><b><?php displayLanguageText('TEXT-ITEM') ?></b></td>
|
|
<td width='10%' align='right' class='oitem'><b><?php displayLanguageText('TEXT-COST') ?></b></td>
|
|
<td width='10%' align='right' class='oitem'><nobr><b><?php displayLanguageText('TEXT-ON-LINE') ?></b></nobr></td>
|
|
<td width='10%' align='right' class='oitem'><nobr><b><?php displayLanguageText('TEXT-PAPER') ?></b></nobr></td>
|
|
<td width='10%' align='right' class='oitem'><nobr><b><?php echo($Special1_Title) ?></b></nobr></td>
|
|
<td width='10%' align='right' class='oitem'><nobr><b><?php echo($Special2_Title) ?></b></nobr></td>
|
|
<td width='10%' align='right' class='oitem'><nobr><b><?php echo($Special3_Title) ?></b></nobr></td>
|
|
</tr>
|
|
<?php
|
|
|
|
while ($product = db_fetch_array($products)) {
|
|
extract($product);
|
|
|
|
$product_num = $record_num;
|
|
|
|
// Setup field names
|
|
$field1 = "price1_$product_num";
|
|
$field2 = "price2_$product_num";
|
|
$field3 = "price3_$product_num";
|
|
|
|
$fpm = " size='6' style='text-align: right; float: right;'";
|
|
$fpmq = " size='3' style='text-align: center;'";
|
|
|
|
if (strlen($product_description)) $product_name .= " ($product_description)";
|
|
|
|
?>
|
|
<tr>
|
|
<td align='left' class='oitem'><?php echo($product_name) ?> ::</td>
|
|
<td align='right' class='oitem'><?php echo($currencySymbol . sprintf($costFmt,$package_cost)) ?></td>
|
|
<td align='right' class='oitem'><?php echo($currencySymbol . number_format($standard_online_price,2)) ?></td>
|
|
<td align='right' class='oitem'><?php echo($currencySymbol . number_format($standard_offline_price,2)) ?></td>
|
|
<td align='right' class='oitem'><input type='text' name='<?php echo($field1) ?>' value='<?php echo($currencySymbol . number_format($special_price1,2)) ?>'<?php echo($fpm) ?>></td>
|
|
<td align='right' class='oitem'><input type='text' name='<?php echo($field2) ?>' value='<?php echo($currencySymbol . number_format($special_price2,2)) ?>'<?php echo($fpm) ?>></td>
|
|
<td align='right' class='oitem'><input type='text' name='<?php echo($field3) ?>' value='<?php echo($currencySymbol . number_format($special_price3,2)) ?>'<?php echo($fpm) ?>></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align='center'>
|
|
<br>
|
|
<input type='submit' class='btn btn--primary' value='<?php displayLanguageText('TEXT-UPDATE-PRICES') ?>'>
|
|
<input type='hidden' name='action' value='supplier-products-update-special'>
|
|
<input type='hidden' name='naction' value='update-special'>
|
|
<?php if (isset($selected_supplier)) { ?>
|
|
<input type='hidden' name='selected_supplier' value='<?php echo($selected_supplier) ?>'>
|
|
<?php } ?>
|
|
<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<?php
|
|
if (isset($selected_supplier)) {
|
|
$smode = 'secondary';
|
|
include "supplier_products.buttons.php";
|
|
}
|
|
?>
|
|
<table cellspacing='1' cellpadding='5' border='0'>
|
|
<tr>
|
|
<?php if (isset($selected_supplier)) { ?>
|
|
<td align='center'><a href='/?action=supplier-products&naction=list&supplier_num=<?php echo($selected_supplier) ?>' class='btn btn--primary>'><?php displayLanguageText('TEXT-SUPPLIER-PRODUCTS') ?></a></td>
|
|
<?php } ?>
|
|
<td align='center'><a href='/?action=suppliers&naction=list' class='btn btn--primary>'>TEXT-SUPPLIERS-LIST</a></td>
|
|
<td align='center'><a href='/?action=supplier-products-post&selected_supplier=<?php echo($selected_supplier) ?>' class='btn btn--primary>'><?php displayLanguageText('TEXT-POST-TO-MENU') ?></a></td>
|
|
</tr>
|
|
</table>
|
|
|