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

<?php
/***************************************************************************
 *			do_showall1.php	                                   *
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~	                   *
 *   File Info:		  View all contacts records                        *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include ("./header.inc");
?>
<center><img src=images/computer.gif border=0><font face=verdana size=3 color=darkred> Viewing Records from CONTACTS table</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>
<?php
include("./config.php");
$table = "contacts";
$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 order by cid";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
$list = "<table border =\"1\" cellpadding =\"2\">";
$list.="<tr ><th><font face=verdana size=2>Conatct ID</font></th>";
$list.="<th><font face=verdana size=2>Title</font></th>";
$list.="<th><font face=verdana size=2>First Name</font></th>";
$list.="<th><font face=verdana size=2>Surname</font></th>";
$list.="<th><font face=verdana size=2>Address #1</font></th>";
$list.="<th><font face=verdana size=2>Address #2</font></th>";
$list.="<th><font face=verdana size=2>City</font></th>";
$list.="<th><font face=verdana size=2>County</font></th>";
$list.="<th><font face=verdana size=2>Post Code</font></th>";
$list.="<th><font face=verdana size=2>Phone</font></th>";
$list.="<th><font face=verdana size=2>Fax</font></th>";
$list.="<th><font face=verdana size=2>Email</font></th>";
$list.="</tr>";

while($row = mysql_fetch_array($rs))
{
	$list.= "<tr><font face=verdana size=2>";
	$list.="<td>".$row["cid"]."</td>";
	$list.="<td>".$row["ctitle"]."</td>";
	$list.="<td>".$row["cfirst"]."</td>";
	$list.="<td>".$row["csurname"]."</td>";
	$list.="<td>".$row["cadd1"]."</td>";
	$list.="<td>".$row["cadd2"]."</td>";
	$list.="<td>".$row["ccity"]."</td>";
	$list.="<td>".$row["ccounty"]."</td>";
	$list.="<td>".$row["ccode"]."</td>";
	$list.="<td>".$row["cphone"]."</td>";
	$list.="<td>".$row["cfax"]."</td>";
	$list.="<td>".$row["cemail"]."</td>";
	$list.="</font></tr>";
}
$list.= "</table>";
echo($list);
echo "<br><center><a href = view_menu.php><img src=images/back-to.gif border=0>  Back to view records menu</a></center>";
include("./your-footer.inc");
?>

</BODY>
</HTML>