First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,151 @@
|
||||
<?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 = 5;
|
||||
|
||||
?>
|
||||
<table width='95%' class='content-table'>
|
||||
<tr>
|
||||
<td align='center' class='heading'>Supplier Product Description 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 = "";
|
||||
if (isset($selected_supplier)) $swhere = "and record_num = $selected_supplier ";
|
||||
$query = "select * from suppliers " .
|
||||
"where school_num = $supplier_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='22%' align='left' class='oitem'><b>SUPPLIER</b></td>
|
||||
<td width='23%' align='left' class='oitem'><b>ITEM NAME</b></td>
|
||||
<td width='23%' align='left' class='oitem'><b>DESCRIPTION</b></td>
|
||||
<td width='23%' align='left' class='oitem'><b>LABEL</b></td>
|
||||
<td width='10%' align='left' class='oitem'> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
while ($product = db_fetch_array($products)) {
|
||||
extract($product);
|
||||
|
||||
$product_num = $record_num;
|
||||
|
||||
// Setup field names
|
||||
$sfield = "supplier_$product_num";
|
||||
$nfield = "name_$product_num";
|
||||
$dfield = "description_$product_num";
|
||||
$lfield = "label_$product_num";
|
||||
$hfield = "hot_cold_$product_num";
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<!--
|
||||
<td align='left' class='oitem'><?php echo($product_name) ?> ::</td>
|
||||
-->
|
||||
<td align='left' class='oitem'>
|
||||
<select name='<?php echo($sfield) ?>'>
|
||||
<?php
|
||||
$results = db_query("SELECT * FROM suppliers WHERE school_num = $supplier_school_num AND status = 'Active' ORDER BY supplier_name");
|
||||
while ($row = db_fetch_array($results)) {
|
||||
$snum = $row['record_num'];
|
||||
$sname = $row['supplier_name'];
|
||||
|
||||
$selected = "";
|
||||
if ($snum == $supplier_num) $selected = " selected='selected'";
|
||||
|
||||
echo(" <option value='$snum'$selected>$sname</option>\n");
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td align='left' class='oitem'><input type='text' name='<?php echo($nfield) ?>' value='<?php echo(str_replace("'","'",$product_name)) ?>' size='30'></td>
|
||||
<td align='left' class='oitem'><input type='text' name='<?php echo($dfield) ?>' value='<?php echo(str_replace("'","'",$product_description)) ?>' size='40'></td>
|
||||
<td align='left' class='oitem'><input type='text' name='<?php echo($lfield) ?>' value='<?php echo(str_replace("'","'",$label_name)) ?>' size='20'></td>
|
||||
<td align='left' class='oitem'><?php BuildFileRadio("hot_cold.txt",$hfield,$hot_cold_food,"<br>") ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center'>
|
||||
<br>
|
||||
<input type='submit' class='btn btn--primary' value='Update'>
|
||||
<input type='hidden' name='action' value='supplier-products-update-description'>
|
||||
<input type='hidden' name='naction' value='update'>
|
||||
<?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>'>Supplier Products</a></td>
|
||||
<?php } ?>
|
||||
<td align='center'><a href='/?action=suppliers&naction=list' class='btn btn--primary>'>Suppliers List</a></td>
|
||||
<td align='center'><a href='/?action=supplier-products-post&selected_supplier=<?php echo($selected_supplier) ?>' class='btn btn--primary>'>Post Products to Menu</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user