<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Viewing / Deleting Records</TITLE>
</HEAD>
<BODY>

<?php
/***************************************************************************
 *			view_custord.php                                   *
 *                     	          				           *
 *   File Info:		  View Customer Orders                             *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
***************************************************************************/
include ("./header.inc");
?>
<h2><center>Viewing Records from your CUSTOMER ORDER</center></h2>
<br>
<?php
include("./config.php");

 if ($_SERVER['REQUEST_METHOD'] == "POST") 
  {
        # escape data and set variables
        $orderid = addslashes($_POST["orderid"]);
}
$table = "custdet";
$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...Please press 'Create Database' to create new database.");
$sql = " SELECT * from $table where username = '$username'";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");

$list.="<table width=50% cellpadding=2 cellspacing=0 border=0 bgcolor=$backcolor align = center>";
$list.="<tr>";
$list.="<td><strong><center>YOUR ORDER DETAILS:</center></strong></td>";
$list.="</tr>";
$list.="</table><br>";
echo($list);
?>
<hr>
<br>
<p align = "justify"><font face = "Verdana" size = 3">Below is a list of orders you have placed so far. To view the details of each order
click on the Order Number of the order you wish to view.</p>
<?php 
$list = "<center><table border =\"1\" cellpadding =\"2\" bgcolor = $backcolor>";
$list.="<th>Order ID</th>";
$list.="<th>PRODUCT</th>";
$list.="<th>QUANTITY</th>";
$list.="<th>PRICE</th>";
$list.="<th>TOTAL PRICE</th>";
$list.="</tr>";

while($row = mysql_fetch_array($rs))
{
	$order = $row["orderid"];
	$qty = $row["qty"];
	$product = $row["product"];
	$price = $row["price"];
	$totalprice = $row["totalprice"];
	$list.= "<tr>";
	$list.="<td>$order</td>";
	$list.="<td>$product</td>";
	$list.="<td>$qty</td>";
	$list.="<td>£$price</td>";
	$list.="<td>£$totalprice</td>";
	$list.="</tr>";
}
$list.= "</table></center>";
echo($list);
echo"
<center><br>
<table width=60% cellpadding=0 cellspacing=0 border=0 bgcolor=CCCCFF align = middle><tr><td valign=top>
<table width=100% cellpadding=1 cellspacing=3 border=0 align = middle>
<tr bgcolor=ffffff><td>
&nbsp;<font face=Verdana size=-1><b><a href=./shop_showall.php>Product List</a></b><img src = ./images/shop.gif><br><small>&nbsp;</small></font>
<td>&nbsp;<font face=Verdana size=-1><b><a href=./shop_delcart.php>Empty Cart</a></b><img src = ./images/trashicon.gif><br><small>&nbsp;</small></font></td>
<td>&nbsp;<font face=Verdana size=-1><b><a href=./shop_viewcart.php>View Cart</a></b><img src = ./images/shoppingcart.gif width=18 height = 18><br><small>&nbsp;</small></font></td>
</table></td></tr></table></center><br>";
include("./your-footer.inc");?>
</BODY>
</HTML>