i used labels (not sure if this was a good idea now!) and once two or more items are added, they get displayed all wrong.
can someone have a look or help me out? thanx
Code: Select all
<!-- start content -->
<div id="content">
<p class="text">
<label for="aircraft" class="aircraft_lbl"><strong>Aircraft</strong></label>
<label for="price" class="price_lbl"><strong>Price Ea</strong></label>
<label for="qty" class="qty_lbl"><strong>Qty</strong></label>
<label for="sub-total" class="aircraft_lbl"><strong>Sub-Total</strong></label>
</p>
<p>
<?
while($row = mysql_fetch_array($result))
{
// Increment the total cost of all planes
$totalCost += ($rowї"qty"] * $rowї"P_Price"]);
?>
<label for="aircraft1" class="aircraft_lbl"> <?php echo $rowї"P_Name"]; ?> </label>
<label for="price1" class="price_lbl"> $<?php echo number_format($rowї"P_Price"], 2, ".", ","); ?> </label>
<label for="qty1" class="qty_lbl">
<select name="<?php echo $rowї"itemId"]; ?>" onChange="UpdateQty(this)">
<?php
for($i = 1; $i <= 20; $i++)
{
echo "<option ";
if($rowї"qty"] == $i)
{
echo " SELECTED ";
}
echo ">" . $i . "</option>";
}
?>
</select>
</label>
<label for="sub-total1" class="aircraft_lbl">
$<?php
$rowї"subtotal"] = ($rowї"qty"] * $rowї"P_Price"]);
echo number_format($rowї"subtotal"], 2, ".", ",");
?>
</label>
<label for="remove"> <a href="cart.php?action=remove_item&id=<?php echo $rowї"itemId"]; ?>Remove</a> </label> </p>
<?
} //You have to have this read as php
?>
<p>
<label for="total" class="total_lbl"> </label><strong> Total: </strong> </label>
$<?php
echo number_format($totalCost, 2, ".", ",");
?>
<?
} //You have to have this read as php
?>
</p>
</div>
<!-- End Content -->