$id_basket = $_SESSION['id_basket'];
// connecting to the database on
battcave.com
$link = mysql_connect($host, $user, $password);
// now we need to get all the basic info
on the products
// in the basket_item table for this shopper
// in order to display them
?>
<table width = 800 border = 0 cellpadding=4 align="center">
<tr>
<td align="center"><font size="4" color="a66838"><b>Product
Name</b></font></td>
<td align="center"><font size="4"
color="a66838"><b>Attributes</b></font></td>
<td align="center" width="150"><font size="4"
color="a66838"><b>Quantity</b></font></td>
<td align="left"><font size="4"
color="a66838"><b>Weight</b></font></td>
<td align="center"><font size="4"
color="a66838"><b>Cost</b></font></td>
<td align="center"></td>
</tr>
<?php
$total_weight = 0.0;
$total_cost = 0.0;
$query_string = "SELECT * FROM basket_item WHERE id_basket = $id_basket";
$result_set = mysql_db_query($db_name, $query_string, $link);
while ($row = mysql_fetch_array($result_set))
{
?>
<form method="post" action="update_quantity.php">
<tr valign="middle">
<td align="center"><font size="4" color="c0c0c0"> <?php echo
$row[product_name]; ?></font></td>
<?php
$row_attributes = "";
if ($row[attribute2] != "") $row_attributes = $row_attributes
. $row[attribute2];
if ($row[attribute1] != "") $row_attributes = $row_attributes
. "<br>" . $row[attribute1];
?>
<td align="center"><font size="4" color="c0c0c0"> <?php echo
$row_attributes; ?></font></td>
<td align="center"><font size="4" color="c0c0c0"><input
type="text" size="2" name="txt_quantity" style="font-size:
14pt" value="<?php echo $row[item_quantity]; ?>"></font>
<input type="hidden" name="txt_id_basket_item" value="<?php
echo $row[id_basket_item]; ?>"><input type="submit"
value="Update" style="font-size: 12pt; font-weight:
bold"></td>
<?php $row_weight = $row[weight]*$row[item_quantity]; ?>
<td align="left"><font size="4" color="c0c0c0"> <?php printf("%01.1f",$row_weight);
?></font></td>
<?php $row_subtotal = $row[price] * $row[item_quantity]; ?>
<td align="right"><font size="4" color="c0c0c0"> <?php
printf("%01.2f",$row_subtotal); ?></font></td>
<?php
$total_weight = $total_weight + $row_weight;
$total_cost = $total_cost + $row_subtotal;
?>
<td align="center"><a href="delete_item.php?id_item=<?php
echo $row[id_basket_item]; ?>"><img src="images/sub_remove.gif"
border="0"></a></td>
</tr>
</form>
<?php
} // end the while loop for entries
in the basket_item table
?>
<td colspan=3 align="right"><font size="4"
color="a66838"><b>Totals:</b></td>
<td align="left"><font size="4" color="c0c0c0"> <?php printf("%01.1f",$total_weight);
?> LBS</font></td>
<td align="right"><font size="4" color="c0c0c0">$<?php printf("%01.2f",$total_cost);
?></font></td>
<td></td>
<tr><td colspan="6"> </td></tr>
<tr><td colspan="6" align="center"><a href="checkout_profile_access.php"><img
src="images/sub_check_out.gif" border="0"></a></td></tr>
<?php
// create session variables for $total_cost
and $total_weight for use in check out process
$_SESSION['total_cost'] = $total_cost;
$_SESSION['total_weight'] = $total_weight;