<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">
<HTML>
<HEAD>
<TITLE>Shopping Cart Contents</TITLE>
</HEAD>
<BODY>
<?
/***************************************************************************
 *			shop_viewcarts.php                                 *
 *                     	          				           *
 *   File Info:		  View cart contents                               *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
***************************************************************************/
include ("config.php");
include ("./tests.php");


######################### if first time...url will contain PHPSESSID=xxxx  #############################
######################### code below will refresh page to remove PHPSESSID #############################
$strvar = getenv("QUERY_STRING");
$pos = strpos($strvar,'=');
$strs = substr($strvar,0,$pos);
$PHPSESSID = session_id();
if ($pos > 0)
{
if ($noshow == "YES")
{
echo "<table width=450 border=1 cellspacing=0 cellpadding=0 height=150>
<tr><td width=450 bgcolor=#CCCCCC height=10>$header</td></tr>
<tr><td width=450 bgcolor=#FFFFFF height=140>";
	echo "<font face=verdana size=2 color=#666666><br><center>Please be patient as we now re-directing you to main store page...<br>You will only see this message once i.e every time you start a new browser window.</center></font><br></td></tr></table>";
}
	include_once("./redirect-me.php");
}else{
if ($phpcart == "NO") {
if ($usecat == "YES")
	include_once("./sidebars.php");
else
	include_once("./sidebar.php"); }
$table= "myorders";

$conn = @mysql_connect($server,$user,$password)
	or die("Unable to connect to SQL database...");
$rs = @mysql_select_db($database,$conn) 
	or die("Unable to select the database 'mydata'...Please press 'Create Database' to create new database.");
$get_itemtot = "SELECT SUM(SEL_ITEM_TOTALPRICE) FROM $table 
		WHERE USER_ID =  '$PHPSESSID'";

$itemtot_result = mysql_query($get_itemtot) 
	or die("SQL command failed - Couldn't get total");
$itemtot = mysql_result($itemtot_result,0,"SUM(SEL_ITEM_TOTALPRICE)");
$fmt_itemtot = sprintf("%0.2f",$itemtot);

if ($wcurrrency == "NO")
{
	if ($itemtot < $min_cost or $itemtot < $mincost) 
	{
		$shipping = $shipcost;
	} else {
		$shipping = 0;
	}
}
$get_cart ="SELECT SEL_ITEM, SEL_ITEM_TITLE, SEL_ITEM_QTY, SEL_ITEM_PRICE, 
		SEL_ITEM_TOTALPRICE FROM $table where user_id =  '$PHPSESSID'";
$cart_result = mysql_query($get_cart)
	or die("SQL command failed - Couldn't get cart.");


$num_rows = mysql_numrows($cart_result);

$item_count = "SELECT SUM(SEL_ITEM_QTY) FROM $table
		WHERE USER_ID =  '$PHPSESSID'";

$item_result = mysql_query($item_count) 
	or die("SQL command failed - Couldn't get count");

#### shipping option shipping calculation ####

if ($shipopt != "NO")
{
	$table = "myorders";
	$get_carts = "SELECT SEL_ITEM, SEL_ITEM_TITLE, SEL_ITEM_QTY, SEL_ITEM_PRICE, SEL_ITEM_TOTALPRICE FROM $table WHERE USER_ID =  '$PHPSESSID'";

	$cart_results = mysql_query($get_carts)
	or die("SQL command failed - Couldn't get cart.");
	$sitems = array();
	$sqty = array();
	$count = 0;
	$shiptotal = 0;
	$shiptotals = 0;
	while ($row = mysql_fetch_array($cart_results)) 
	{
		$sel_item = $row["SEL_ITEM"];
		$sel_item_qty = $row["SEL_ITEM_QTY"];
		$sitems[$count] = $sel_item;
		$sqty[$count] = $sel_item_qty;
		$count += 1;
	}
		

	$i = 0;
	foreach ($sitems as $value)
	{
		$table = "stocks";
		$sqls = "SELECT * from $table where sitem = '$value'";
		$get_cats = mysql_query($sqls)
		or die("SQL command failed - Couldn't get category for item.");
		while ($frow = mysql_fetch_array($get_cats))
		{
			$category = $frow["scat"];
		}
		$table = "shipopts";
		$sql1 = "SELECT * from $table where shipitem = '$category'";
		$get_ship = mysql_query($sql1)
		or die("SQL command failed - Couldn't get shipping price for item.");
		while ($rows = mysql_fetch_array($get_ship))
		{
			$iprice = $rows["shipitemprice"];
		}
		$sqt = $iprice;
		$shiptotals = $shiptotals + $sqt;
		$shiptotals = number_format($shiptotals,2);
		$i++;
	}
	$shiptotal = $shiptotals + $shiprates;
	$ship = $shiptotal;
	if ($wcurrency != "NO")
	{
		if ($scurrency == "gbp")
		{
			$tship = $ship * $conv1;
			$tship = number_format($tship,2);
		}
		if ($scurrency == "usd")
		{
			$tship = $ship * $conv2;
			$tship = number_format($tship,2);
		}
		if ($scurrency == "eur")
		{
			$tship = $ship * $conv3;
			$tship = number_format($tship,2);
		}
		if ($scurrency == "jpy")
		{
			$tship = $ship * $conv4;
			$tship = number_format($tship,2);
		}
		if ($scurrency == "cad")
		{
			$tship = $ship * $conv1;
			$tship = number_format($tship,2);
		}
		$ship = $tship;
	}
}
if ($shipopt == "YES" and $wcurrency == "NO")
	$shipping = $ship;
if ($wcurrency == "NO")
	$sub_total = number_format(($fmt_itemtot + $shipping),2);
else
{
	$shipping = 0;
	$sub_total = number_format(($fmt_itemtot + $shipping),2);
}
$item_count_total = mysql_result($item_result,0,"SUM(SEL_ITEM_QTY)");
if ($num_rows == "0") 
{
############## display a random product ################

$table = "products";
$conn = @mysql_connect($server,$user,$password)
	or die("Unable to connect to SQL database...");
$rs = @mysql_select_db($database,$conn) 
	or die("Unable to select the database 'mydata'...Please press 'Create Database' to create new database.");

$sql = "SELECT * from $table";
$products = mysql_query($sql,$conn);
$prods = mysql_num_rows($products);

$items = array();
$count = 1;

if ($prods >= 1)
{
	while ($row = @mysql_fetch_array($products))
	{
		$items[$count] = $row["pid"];
		$count += 1;
	}
	srand(microtime() * 1000000);
	$num = rand(1,$prods);
	if ($num == 0) $num = 1;

	$sqls = "SELECT * from $table where pid = $items[$num]";
	$details = mysql_query($sqls,$conn);
	while ($rows = @mysql_fetch_array($details))
	{
		$pid = $rows["pid"];
		$pitem = $rows["pitem"];
		$pdes = $rows["pdes"];
	
	}
}
else
{

	$pitem = "N/A";
	$pdes = "N/A";
	$scat = "N/A";
}
	if ($phpcart == "NO") 
	{
	// Only display item for recommendation if products exists
	if ($prods >= 1)
	{
		$table = "stocks";
		$sql = " SELECT pid,sitem,scat,spic,stock,color,size from $table where pid=$items[$num]";
	
		$rs = @mysql_query($sql,$conn)
		or die("Could not execute SQL query!!! Possibly SQL query already been executed.");

		$row=mysql_fetch_array($rs);
		$pics = $row["spic"];
		$scat=$row["scat"];
		$stocknum = $row["stock"];
	}
	else
	{
	$pitem = "N/A";
	$pdes = "N/A";
	$scat = "N/A";
	}
	if (strlen($pics) < 1)
	{	
		$pics="./images/nopic.jpg";
	}
	if (fopen($pics,"r") == NULL)
		$pics = "./images/nopic.jpg";
	if (strlen($scat) < 1)
	{
		$scat = "N/A";
	}
	echo "<center><TABLE cellSpacing=0 cellPadding=0 border=0><TR>
      <TD background=./images/border_cnr_tl.gif><IMG height=8 alt= src=./images/px.gif width=8 border=0></TD>
      <TD background=./images/border_top.gif><IMG height=8 alt= src=./images/px.gif width=120 border=0></TD>
      <TD background=./images/border_cnr_tr.gif><IMG height=8 alt= src=./images/px.gif width=8          border=0></TD></TR><TR><TD background=./images/border_left.gif>
       <IMG height=60 alt= src=./images/px.gif width=8 border=0></TD>
       <TD width=120>
       <TABLE cellSpacing=0 cellPadding=4 width=480 border=0>
       <TBODY>
       <TR>
       <TD align=center><img src=images/cart-contents.gif border=0><img src=images/shoppingcart.gif width = 22 height = 22 align=middle><font face=verdana size=1 color=#00CCCC> No Items in Basket</font></td></tr><tr><td align=center><font face=verdana size=1 color=navy>We recommend the following product item</font></td></tr>";
echo "<tr><td align=center><img src=$pics border=0 alt=Picture></td></tr>";
if ($prods >= 1)
echo "<tr><td><font face=verdana size=1><b>Product Item ID:</b>	$pid <a href = ./shop_showitem.php?pid=$pid></font><font color = $highlight><u>Show Item</u></font></a>";
else
echo "<tr><td><font face=verdana size=1><b>Product Item ID:</b>	N/A";	
echo "</td></tr><tr><td><font face=verdana size=1><b>Product Item   :</b>    $pitem</font>";
echo "</td></tr><tr><td><font face=verdana size=1><b>Product Description:</b> $pdes</font></td></tr>";
echo "<tr><td><font face=verdana size=1><b>Product Category:</b> $scat</font></td></tr>";
if ($stocknum >=1)
echo "<tr><td><font face=verdana size=1><b>Stock: </b> $stocknum</td></tr>";
if ($stocknum < 1)
echo "<tr><td><font face=verdana size=1><b>Stock: </b> <font face=verdana size=1 color=red>Out of Stock!</font></td></tr>";
echo "</TBODY></TABLE></TD><TD background=./images/border_right.gif>
      <IMG height=60 alt= src=./images/px.gif width=8 border=0></TD></TR>
      <TR><TD background=./images/border_cnr_bl.gif>
      <IMG height=8 alt= src=./images/px.gif width=8 border=0></TD>
      <TD background=./images/border_bottom.gif>
      <IMG height=8 alt= src=./images/px.gif width=121 border=0></TD>
      <TD background=./images/border_cnr_br.gif>
      <IMG height=8 alt= src=./images/px.gif 
      width=8 border=0></TD></TR></TABLE></center><br><br>";
	}
	else
	{
	$table = "stocks";
	$sql = " SELECT pid,sitem,scat,spic,stock,color,size from $table where pid=$pid";
	$rs = @mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");

	$row=mysql_fetch_array($rs);
	$pics = $row["spic"];
	$scat=$row["scat"];
	$stocknum = $row["stock"];
	if (strlen($pics) < 1)
	{	
		$pics="./images/nopic.jpg";
	}
	if (fopen($pics,"r") == NULL)
		$pics = "./images/nopic.jpg";
	if (strlen($scat) < 1)
	{
		$scat = "N/A";
	}
	echo "<center><TABLE cellSpacing=0 cellPadding=0 border=0><TR>
      <TD background=./images/border_cnr_tl.gif><IMG height=8 alt= src=./images/px.gif width=8 border=0></TD>
      <TD background=./images/border_top.gif><IMG height=8 alt= src=./images/px.gif width=120 border=0></TD>
      <TD background=./images/border_cnr_tr.gif><IMG height=8 alt= src=./images/px.gif width=8          border=0></TD></TR><TR><TD background=./images/border_left.gif>
       <IMG height=60 alt= src=./images/px.gif width=8 border=0></TD>
       <TD width=120>
       <TABLE cellSpacing=0 cellPadding=4 width=480 border=0>
       <TBODY>
       <TR>
       <TD align=center><img src=images/cart-contents.gif border=0><img src=images/shoppingcart.gif width = 22 height = 22 align=middle><font face=verdana size=1 color=#00CCCC> No Items in Basket</font></td></tr><tr><td align=center><font face=verdana size=1 color=navy>We recommend the following product item</font></td></tr>";
echo "<tr><td align=center><img src=$pics border=0 alt=Picture></td></tr>";
if ($prods >= 1)
echo "<tr><td><font face=verdana size=1><b>Product Item ID:</b>	$pid <a href = ./shop_showitem.php?pid=$pid></font><font color = $highlight><u>Show Item</u></font></a>";
else
echo "<tr><td><font face=verdana size=1><b>Product Item ID:</b>	N/A";	
echo "</td></tr><tr><td><font face=verdana size=1><b>Product Item   :</b>    $pitem</font>";
echo "</td></tr><tr><td><font face=verdana size=1><b>Product Description:</b> $pdes</font></td></tr>";
echo "<tr><td><font face=verdana size=1><b>Product Category:</b> $scat</font></td></tr>";
if ($stocknum >=1)
echo "<tr><td><font face=verdana size=1><b>Stock: </b> $stocknum</td></tr>";
if ($stocknum < 1)
echo "<tr><td><font face=verdana size=1><b>Stock: </b> <font face=verdana size=1 color=red>Out of Stock!</font></td></tr>";
echo "</TBODY></TABLE></TD><TD background=./images/border_right.gif>
      <IMG height=60 alt= src=./images/px.gif width=8 border=0></TD></TR>
      <TR><TD background=./images/border_cnr_bl.gif>
      <IMG height=8 alt= src=./images/px.gif width=8 border=0></TD>
      <TD background=./images/border_bottom.gif>
      <IMG height=8 alt= src=./images/px.gif width=121 border=0></TD>
      <TD background=./images/border_cnr_br.gif>
      <IMG height=8 alt= src=./images/px.gif 
      width=8 border=0></TD></TR></TABLE></center><br><br>";
	}
} 
else 
{
    echo "<table width=540 border=1 cellspacing=0 cellpadding=0 height=150>
<tr><td width=540 bgcolor=#CCCCCC height=10>$header</td></tr>
<tr><td width=540 bgcolor=#FFFFFF height=140><br>";
     if ($wcurrency == "ARS")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/argntina.gif></font></center><br>";
     if ($wcurrency == "BRL")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/brazil.gif></font></center><br>";
     if ($wcurrency == "BND")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/brunei.gif></font></center><br>";
     if ($wcurrency == "CNY")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/china.gif></font></center><br>";
     if ($wcurrency == "EGY")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/egypt.gif></font></center><br>";
     if ($wcurrency == "HKD")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/hngkng97.gif></font></center><br>";
     if ($wcurrency == "INR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/india.gif></font></center><br>";
     if ($wcurrency == "IDR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/indonsia.gif></font></center><br>";
     if ($wcurrency == "KWD")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/kuwait.gif></font></center><br>";
     if ($wcurrency == "MYR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/malaysia.gif></font></center><br>";
     if ($wcurrency == "NZD")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/newzeal.gif></font></center><br>";
     if ($wcurrency == "NOR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/norway.gif></font></center><br>";
     if ($wcurrency == "PKR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/pakistan.gif></font></center><br>";
     if ($wcurrency == "PHP")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/phillipn.gif></font></center><br>";
     if ($wcurrency == "PLN")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/poland.gif></font></center><br>";
     if ($wcurrency == "ROL")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/romania.gif></font></center><br>";
     if ($wcurrency == "RUR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/russia.gif></font></center><br>";
     if ($wcurrency == "SAR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/saudiar.gif></font></center><br>";
     if ($wcurrency == "ZAR")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency  <img src = ./images/safrica.gif></font></center><br>";
     if ($wcurrency == "KRW")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/skorea.gif></font></center><br>";
    if ($wcurrency == "SEK")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/sweden.gif></font></center><br>";
   if ($wcurrency == "CHF")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/switzrld.gif></font></center><br>";
   if ($wcurrency == "TWD")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/taiwan.gif></center><br>";
  if ($wcurrency == "THB")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/thailand.gif></center><br>";
  if ($wcurrency == "VND")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/vietnam.gif></center><br>";
 if ($wcurrency == "USD")
	echo "<center><font face=verdana size=2 color = #666666>Shopping Cart using world currency <img src = ./images/usa.gif></center><br>";		

$list = "<center><img src=./images/lines.gif border=0></center><br>";

$list.="<center><table width=52% cellpadding=2 cellspacing=0 border=0 bgcolor=ffffff align = middle>";
$list.="<tr>";
$list.="<td><center><img src=images/cart-contents.gif border=0></center></td>";
$list.="</tr>";

$list.="<tr>";
if ($wcurrency == "NO")
{
	$list.="<td><strong><p align = center><font face = verdana color = $highlight size = 2>Shopping Total $currency $fmt_itemtot <a href=./shop_checkout.php>
        <img src=images/shoppingcart.gif width = 22 height = 22 align=middle border=0 alt=Checkout></a></font></p></strong></td>";
}
else
{
	
	$list.="<td><strong><p align = center><font face = verdana color = #808080 size = 2>Shopping Total ($wcurrency) <font color=darkred>$fmt_itemtot</font> <a href=./shop_checkout.php>
        <img src=images/shoppingcart.gif width = 22 height = 22 align=middle border = 0 alt=Checkout></a></font></p></strong></td>";
}
$list.="</tr>";
$list.="<tr><td><p align = left><font size = 1 face=Verdana color=#666666>Items in Basket: $item_count_total</p></font></td></tr>";

########## default shipping calculation ##########

if ($shipopt == "NO") {
if ($shipping > 0)
{
	if ($wcurrency == "NO")
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Shipping Costs: $currency$shipping</p></font></td></tr>";
	else
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Shipping Added at Checkout</p></font></td></tr>";
}
else
{
	if ($wcurrency == "NO")
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Shipping Costs: FREE!!!</p></font></td></tr>";
	else
		$list.="<tr><td><p align=left><font size = 2 face=Verdana color=#666666>Shipping Added at Checkout</p></font></td></tr>";
}
}

########## shipping calculation using shipping options ##########

if ($shipopt == "YES")
{
		
		if ($wcurrency == "NO")
		{
		$shipping = $ship;
		$shipping = number_format($shipping,2);
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Flat rate shipping: $currency$shiprates </p></font></td></tr>";
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Shipping for order: $currency$shiptotals </p></font></td></tr>";
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Shipping Costs: $currency$shipping </p></font></td></tr>";
		}
	else
		$list.="<tr><td><p align=left><font size = 1 face=Verdana color=#666666>Shipping Added at Checkout</p></font></td></tr>";
}
if ($wcurrency == "NO")
	$list.= "<tr><td><p align =left><font size = 1 face = Verdana color=#3a6b93><strong>Basket Total: $currency$sub_total</strong></p></font></td></tr>";
else
{
	$list.= "<tr><td><p align=left><font size = 1 face = Verdana color=#3a6b93><strong>Basket Total: ($wcurrency)$sub_total</strong></p></font></td></tr>";
	
	if ($scurrency == "gbp")
	{	
		$convert = $fmt_itemtot * $conv1;	
		$convert = number_format($convert,2);
		$list.= "<tr><td><p align=left><font size = 1 face = Verdana color = #3a6b93><strong>Basket Total: ($currency)$convert</strong></p></font></td></tr>";
	}	
	if ($scurrency == "usd")
	{
		$convert = $fmt_itemtot * $conv2;
		$convert = number_format($convert,2);
		$list.= "<tr><td><p align=left><font size = 1 face = Verdana color=#3a6b93><strong>Basket Total: ($currency)$convert</strong></p></font></td></tr>";
	}
	if ($scurrency == "eur")
	{
		$convert =$fmt_itemtot * $conv3;
		$convert = number_format($convert,2);
		$list.= "<tr><td><p align=left><font size = 1 face = Verdana color=#3a6b93><strong>Basket Total: ($currency)$convert</strong></p></font></td></tr>";
	}
	if ($scurrency == "jpy")
	{
		$convert = $fmt_itemtot * $conv4;
		$convert = number_format($convert,2);
		$list.= "<tr><td><p align=left><font size = 1 face = Verdana color=#3a6b93><strong>Basket Total: ($currency)$convert</strong></p></font></td></tr>";
	}
	if ($scurrency == "cad")
	{
		$convert = $fmt_itemtot * $conv5;
		$convert = number_format($convert,2);
		$list.= "<tr><td><p align=left><font size = 1 face = Verdana><strong>Basket Total: ($currency)$convert</strong></p></font></td></tr>";
	}
}	
$list.= "</table></center><br>";
$list.= "<center><img src=./images/lines.gif border=0></center><br>";
echo($list);
echo "<center><br><font face=verdana size=1 color = #000080>The shopping cart shows all products you wish to order !</font></center>";
echo"<center><font face=verdana size=1 color=#000080>Click Previous Button to go back to previous page.<a href=javascript:history.back()><img src=images/bullet.gif border = 0></a></font></center><br>";
echo "<br><center><a href = ./shop_updcart.php><img src=images/updatecart.gif border=0></a><a href = ./shop_delcart.php><img src =./images/emptycart.gif border =0></a></center><br><br>";
$list= "<table border=0 cellpadding=1 cellspacing=0 align = center bgcolor=$backcolor>";
$list.= "<tr>";
$list.="<td align=center bgcolor=#CCCCCC><strong><font color=lightred face=verdana size=1>DELETE</font></strong></td>";
$list.="<td align=center bgcolor=#CCCCCC><strong><font face=verdana size=1>QTY</font></strong></td>";
$list.="<td align=center bgcolor=#CCCCCC><strong><font face=verdana size=1>ITEM</font></strong></td>";
$list.="<td align=center  bgcolor=#CCCCCC><strong><font face =verdana size=1>DESCRIPTION</font></strong></td>";
if ($wcurrency == "NO")
{
$list.="<td align=center  bgcolor=#CCCCCC><strong><font face=verdana size=1>PRODUCT PRICE $currency</font></strong></td>";
$list.="<td align=center bgcolor=#CCCCCC width=100><strong><font face=verdana size=1>TOTAL PRICE $currency</font></strong></td>";
}
else
{
$list.="<td align=center  bgcolor=#CCCCCC><strong><font face=verdana size=1>PRICE ($wcurrency)</font></strong></td>";
$list.="<td align=center bgcolor=#CCCCCC><strong><font face=verdana size=1>TOTAL ($wcurrency)</font></strong></td>";

}
$list.="</tr>";
echo($list);
$a = 0;
$prods = array();
$quant =array();
while ($row = mysql_fetch_array($cart_result)) {
	$a += 1;
	$sel_item_qty = $row["SEL_ITEM_QTY"];
	$sel_item = $row["SEL_ITEM"];	
	$sel_item_title = $row["SEL_ITEM_TITLE"];
	$sel_item_price = $row["SEL_ITEM_PRICE"];
	$sel_item_price = number_format($sel_item_price,2);
	$sel_item_totalprice = $row["SEL_ITEM_TOTALPRICE"];
	$fmt_item_totalprice = sprintf("%0.2f",$sel_item_totalprice);
	$prods[$a] = $sel_item;
	$quant[$a] = $sel_item_qty;
	$tables = "stocks";
	$get_carts = "SELECT size,color from $tables where (sitem like '$sel_item' or sitem like '$sel_item_title')";
	$carts = @mysql_query($get_carts,$conn)
		or die("Unable to get product and stock information for shopping cart....");
	
	$prow = mysql_fetch_array($carts);
	$color = $prow["color"];
	$size = $prow["size"];
	echo "
	<tr>
	<td align = middle>
	<a href=./shop_deletecart.php?$a>
              <img src=images/trashicon.gif width = 16 height = 16 align=middle alt = 'Delete Item' border = 0></a>
	<font face=verdana size=1 color=#000000>$a</font></td>
	<td align = middle><font face=verdana size=1 color=#000000>$sel_item_qty</font></td>
	<td align = left><font face=verdana size=1 color=#000000>$sel_item color: $color size:$size</font></td>
	<td align=left><font face=verdana size=1 color=#000000>$sel_item_title</font></td>
	<td align=right><font face=verdana size=1 color=#000000>$sel_item_price</font></td>
	<td align=right><font face=verdana size=1 color=#000000><b>$fmt_item_totalprice</b></font></td>	
	</tr>
	";}
echo("</table></tr></table>");

}
}
?>
</BODY>
</HTML>
