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

<?php
/***************************************************************************
 *			do_delete3a.php	                                   *
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~	                   *
 *   File Info:		  Delete orders                                    *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include ("./header.inc");
?>
<img src=images/line.gif border=0 width=100% height=1><br><br>
<center><img src=images/computer.gif border=0><font face=verdana size=3 color=darkred> Viewing Records from MYORDERS / Delete Records</font></center><br>
<center>
<table width="500" border=1><tr align="justify" class="subtitle"><td>
  <p align="center">
  <img border="0" src="images/database.GIF" width="24" height="24"><font face=Verdana size=1><a href="./create_db.php">Create database</a>&nbsp;
  <img border="0" src="images/database.GIF" width="24" height="24"></font><a href="./delete_db.php"><font face=Verdana size=1>Delete database</font></a><font face="Verdana" size="1">&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"><a href="./create_menu.php">Create table</a>&nbsp;&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24">&nbsp;
  </font> <a href="./add_menu.php"><font face=Verdana size=1>Add Record </font></a>  
  </p>
  <p align="center">&nbsp;<font face="Verdana" size="1"><img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./view_menu.php"><font face=verdana size=1>View Records</font></a>&nbsp;
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./del_menu.php"><font face=verdana size=1>Delete Record</font></a>
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font> <a href="./upd_menu.php"><font face=verdana size=1>Update Record</font></a>&nbsp;
  <img border="0" src="images/home-to.GIF" width="24" height="24"><font face=verdana size=1>&nbsp; <a href="./index.php">Home</a></font>  </a></td></tr></table><br></center>
<?php
include("./config.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...Please press 'Create Database' to create new database.");
$sql = " SELECT * from $table";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
$list = "<table border =\"1\" cellpadding =\"2\" align=center>";
$list.="<tr ><th><font face=verdana size=2>User ID</font></th>";
$list.="<th><font face=verdana size=2>Item</font></th>";
$list.="<th><font face=verdana size=2>Description</font></th>";
$list.="<th><font face=verdana size=2>Quantity</font></th>";
$list.="<th><font face=verdana size=2>Unit Price</font></th>";
$list.="<th><font face=verdana size=2>Total Price</font></th>";
$list.="<th><font face=verdana size=2>Date Added</font></th></tr>";

while($row = mysql_fetch_array($rs))
{
	$list.= "<tr><font face=verdana size=2>";
	$list.="<td>".$row["user_id"]."</td>";
	$list.="<td>".$row["sel_item"]."</td>";
	$list.="<td>".$row["sel_item_title"]."</td>";
	$list.="<td>".$row["sel_item_qty"]."</td>";
	$list.="<td>".$row["sel_item_price"]."</td>";
	$list.="<td>".$row["sel_item_totalprice"]."</td>";
	$list.="<td>".$row["date_added"]."</td>";
	$list.="<font></tr>";
}
$list.= "</table>";
echo($list);
?>
<br>
<font face=verdana size=2 color=navy>Delete Record from MYORDERS</font>
<form action = "do_deleterec4a.php" method = "POST">
<font face=verdana size=2>User ID: </font><input type ="text" name = "user_id">
<input type = "submit" value="Delete Record">
</form>

<br><p align=justify><img src=images/readme.gif border=0><font face=verdana size=2 color=darkgreen>In order to delete MYORDERS record from the list above, copy the USER ID using the copy function by right clicking the right mouse button. Next copy the USER ID you wish to delete and paste into the USER ID textbox. To proceed to delete the record, press the 'Delete Record' button and the record will be deleted from the database.</font></p>
<?php include("./your-footer.inc");?>
</BODY>
</HTML>