Okay, so this is my code (a part of it though):
PHP Code:
<?php
$column=1;
$formaatcat=mysql_real_escape_string($_GET['sizecat']);
$formaat=$_GET['size'];
$bedrukking=$_GET['color'];
$papiersoort=$_GET['material'];
$thumb_formaat=$_GET['thumb_size'];
echo "<table style='width:100%;'>\n\t\t<tr><td align='center' colspan='4'><h1>View the amounts and prices</h1></td></tr><tr>";
$finalQuery=mysql_query("SELECT DISTINCT * FROM `Flyers` WHERE `sizecat`='{$sizecat}' AND `color`='{$color}' AND `material`='{$material}' AND `thumb_size`='$thumb_size;");
while($item=mysql_fetch_array($finalQuery)){
$base_m=5;
{$item['price1'] = round ((($item['price1']+5) *1.85),0); $item['price01'] = $base_m*(ceil(($item['price1'])/$base_m));}
if ($column==1) {echo "<tr>";}
?>
<td width="50%" align="center"><?php echo "<img src='{$item['thumb_size']}' alt='{$item['thumb_size']}' border='2' style='border-color: #6E1244;' />" ?></td>
<td width="50%" align="left">Flyers <br />Size: <?php echo "{$item['sizecat']} {$item['size']}<br />{$item['color']}<br />{$item['material']}<br />{$item['Info']}" ?></td>
</tr><tr>
<td width="50%" align="center"><h1>Amounts</h1></td>
<td width="50%" align="center"><h1>Prices</h1></td>
</tr><tr>
<td width="50%" valign="top" align="center"><h4><?php
if ($item['amount1'] > "0") { echo $item['amont1'] ?> <br /> <?php }
?></h4></td>
<td width="50%" align="center"><h4><?php
if (($item['price1'] > "11") && ($item['price01'] < "100")) { ?> € <?php echo $item['price01']; ?>,- <?php }
elseif (($item['price1'] > "11") && ($item['price01'] < "1000")) { ?> € <?php echo $item['price01']; ?>,- <?php }
elseif (($item['price1'] > "11") && ($item['price01'] >= "1000")) { ?> € <?php echo $item['price01']; ?>,- <?php }?> <br />
<?php
?></h4></td>
<?php
$column++; if ($column==1) { echo "</tr>"; $column=2; }
}
echo "</tr><tr><td align='center' colspan='4'><input type=button value='Back' onClick='history.go(-1)'></td></tr></table>\r\n";
So, as you can see, there's the calculation for the value of price1. I've got three prices, but I left the price2 and price3 out of the code, same for amount2 and amount3.
I also have for every price three values. So I could make a array:
PHP Code:
<?php
$priceList1 = array('price11', 'prijs12', 'prijs13');
$priceList2 = array('price21', 'prijs22', 'prijs23');
$priceList3 = array('price31', 'prijs32', 'prijs33');
?>
And then I need to find the lowest one of those? Do you know how? Well, I could search for that part... the ony trouble is... how do I use that in my current code? Since... I still need to do a little math with the one lowest outcome per price.
Or... I can let it display the way it is now.. for all three main prices, and the three values per price and then only show the lowest value of the outcome of that part? Which means after the calculation.
Are you following? Do you have any suggestions?
Thx for helping out!
Bookmarks