OK, Im working on an ordering system. When the user logs in they are presented with a list of vendors along with that vendors address and so on. Then under each vendor is a list of their product and box where they can input the quanity of each product they want.
I know how i can pass the quanity to the next page but im having trouble figuring out how im going to pass the vendor information for where the order is associated for instance if they placed an order for 25 of something for one vendor then on the confirm page it would put the quanity and diplay the vendor for which the order is associated.
My code is below. Any help will obviously be greatly appreciated and there's a chance i'll let you name my first born. Assuming i ever have kids and that's a big assumption.
<form name="OrderForm" action="/confirm" method="POST">
<?php $query = 'SELECT * FROM Vendors WHERE VendorID = 1';
$productquery = 'SELECT * FROM Products WHERE VendorID = 1';
$results = $db->getAll($query);
$productresults = $db->getAll($productquery);?>
<table class="table">
<thead>
<tr>
<th>Quantity/Product</th>
<th>Category</th>
<th>Vendor</th>
<th>Address</th>
</tr>
<?php
foreach ($results as $vendor) {
?>
<tr class="category">
<td></td>
<td><?php echo $vendor['Category'];?></td>
<td><?php echo $vendor['Vendor'];?></td>
<td><?php echo $vendor['Address'];?></td>
</tr>
<?php
foreach ($productresults as $product){
?>
<tr class="product">
<td colspan="4"><span class="name"><input type="text" name="quantities[]" size="1" /><?php echo $product['Product'];?></span></td>
</tr>
</table>
<input type="submit" value="Checkout"<button style="float:right;" type="button" class="btn btn-primary"></button>
</form>