1:
2:
<div id="main">
3:
<div id="shopping_cart">
4:
<form action="?page=quick_by" method="post">
5:
<?php
6:
7:
include("db.php");
8:
$get_products = "SELECT * FROM products LIMIT 2";
9:
$result_products = mysql_query($get_products)
10:
or die(mysql_error());
11:
12:
while($row_products = mysql_fetch_row($result_products))
13:
{
14:
$id = $row_products[0];
15:
//Get the flavors
16:
$get_flavors = "SELECT flavor FROM flavors WHERE product_id=$id LIMIT 2 ";
17:
$flavor_result = mysql_query($get_flavors)
18:
or die(mysql_error());
19:
20:
while($flavor_row = mysql_fetch_row($flavor_result))
21:
{
22:
23:
?>
24:
25:
<table border="0" cellspacing="0" cellpadding="0" width="">
26:
<td class="shopping_cart"></td>
27:
<td class="shopping_cart">Produkt</td>
28:
<td class="shopping_cart">Smak</td>
29:
<td class="shopping_cart">Antal</td>
30:
<tr>
31:
<td><img src="admin/logged_in/product_images/thumb/<?= $row_products[1] ?>"></td>
32:
<td><?= $row_products[2] ?></td>
33:
<td><?= $flavor_row[0] ?></td>
34:
<td><input type="text" name="qty"><input type="hidden" name="product" value="<?= $row_products[0] ?>"></td></tr>
35:
36:
37:
<?php
38:
}
39:
}
40:
?>
41:
<input type="submit" name="submit" value="vidare">
42:
</form>
43:
</div>
44:
<?php
45:
if(isset($_POST['submit']))
46:
{
47:
if(isset($_POST['qty']))
48:
{
49:
if(isset($_POST['product']))
50:
{
51:
foreach($_POST as $pd)
52:
{
53:
54:
}
55:
}
56:
57:
}
58:
}
59:
?>
60: