<html>
<head>
<title>
Log In Authentication
</title>
<script language="JavaScript">
function newWindow(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}
</script>
</head>
<body>
<?php
/***************************************************************************
 *			logins.php                   	                   *
 *                     	          				           *
 *   File Info:		  Login User                                       *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
$dummy = "false";
$emptys = "false";

@session_start();
@header("Cache-control: private"); // IE 6 fix

if ((!session_is_registered("empty")) and ($_session["empty"] == NULL))
{
	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 "<center><p align = justify>If you see this message for the first time....EZ Shopper needs to reinitialise itself. Please click on any of the Shopping Cart Menu items or click on Store Home to perform this action.<br><br>You will see this message once every time a new browser window is started.</p></center></tr></table>";
	}
	include_once("./redirect-me.php");
} else {
 if ($_SERVER['REQUEST_METHOD'] == "POST") 
  {
        # escape data and set variables
  
        $username = addslashes($_POST["username"]);
        $passwrd=addslashes($_POST["passwrd"]);
}
# if either form field is empty return to the log in page
if (($username == NULL) or ($passwrd == NULL))
{
include ("config.php");
include ("./tests.php");


if ($_SESSION["admin"] == NULL)
{

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

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

	// only show items when there are items to show !!!
	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"];
		}
		$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><center><img src=images/mouses.gif border=0><font face = Verdana size =4 color=navy>Logging In</font></center></td></tr><TR>
       <TD align=center><img src=./images/bullets.gif border=0><font face=Times New Roman size=2><b> User Name and Password cannot be empty!</b></font></td></tr><tr><td align=center>Please input your username and password again.</center></font></td></tr><tr><td align=center>........................................................................................</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>";
$emptys = "true";
}
}

if ($emptys == "false"){
include ("config.php");
include ("./tests.php");

$table = "users";
$conn = @mysql_connect($server,$user,$password)
	or die("Unable to connect to SQL database...");
$pass = md5($passwrd);
$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 where username = '$username' and passwrd = '$pass'";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
$number = mysql_numrows($rs);
 if ((session_is_registered("admin")) and ($_SESSION["admin"] == "admin"))
{
	$date_added = date("jS M, Y");
	$username=$_SESSION['admin'];
	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>";

	echo "<tr><td><center><table width=400 border=0><tr><td><img src=images/welcome-admin.gif></center></font></b><center><FONT face=Verdana color=#666666 
            size=1>$date_added Administrator's panel...<a href='index.php'><img src=./images/adpanel.gif border=0 alt=Panel></a></center></td></tr></table></center>
       <form method=POST action=upd_user.php>
	<input type=hidden name=username value='$username'>
	<center><input type=submit name=submit value='Update user details'></center>
	</form><center><img src=./images/lines.gif border=0 width=300></center></td></tr>";
	echo "<tr><td><center><table width=60% cellpadding=0 cellspacing=0 border=0 bgcolor=$backcolor align = center><tr><td align=center><font face =verdana size=2 color=navy><b>Adminstrator Functions</b></font></td></tr><tr><td><br></td></tr><tr><td align = left><li><a href = ./upd_setting.php><img src =./images/edit.gif border=0><FONT face=Verdana color=#666666 
            size=2>Update & maintain settings</font></a></td></tr><tr><td align = left><li><a href = ./email.php><img src =./images/mailto.gif border=0><FONT face=Verdana color=#666666 
            size=2>Email customers and contacts</font></a></td></tr>";
	echo"<td align = left><li><a href = ./site-stats.php><img src =./images/window.gif border=0><FONT face=Verdana color=#666666 
            size=2>View site statistics</font></a></td>";

session_start();
 if ((session_is_registered("empty")) and ($empty == "true"))
{
echo "</td></tr><tr><td align = left><li><a href= javascript:newWindow('./redundant.php','acePopup',400,400,'')><img src =./images/search.gif border=0><FONT face=Verdana color=#666666 
            size=2>Show all redundant orders!!!</font></a>";
}
else
{
echo "</td></tr><tr><td align = left><li><a href= ./redundant.php><img src =./images/search.gif border=0><FONT face=Verdana color=#666666 
            size=2>Show all redundant orders!!!</font></a>";
}

echo "</td></tr><br>
	<td align = left><li><a href = ./orders_mng.php><img src =./images/private.gif border=0><FONT face=Verdana color=#666666 
            size=2>Manage & Control Orders</font></a></td>";
	echo"<tr><td align = left><li><a href= ./customers.php><img src =./images/search.gif border=0><FONT face=Verdana color=#666666 
            size=2>Show all users/customers!!!</font></a></td></tr>";
	echo "<tr><td align = left><li><a href=./shipping_mng.php><img src =./images/private.gif border=0><FONT face=Verdana color=#666666 
            size=2>Manage & Control Shipping</font></a></td></tr>";
echo "<tr><td align = left><li><a href=./backup.php><img src =./images/private.gif border=0><FONT face=Verdana color=#666666 
            size=2>Backup all database files</font></a></td></tr>";
echo "<tr><td align = left><li><a href=./prodstocks.php><img src =./images/window.gif border=0><FONT face=Verdana color=#666666 
            size=2>Add/Edit/Delete Products & Stocks</font></a></td></tr>";
echo "<tr><td align = left><li><a href=./categorys.php><img src =./images/window.gif border=0><FONT face=Verdana color=#666666 
            size=2>Add/Edit/Delete Categories</font></a></td></tr>";
if ($shipopt == "YES")
echo "<tr><td align = left><li><a href=./shipopts.php><img src =./images/window.gif border=0><FONT face=Verdana color=#666666 
            size=2>Edit/Delete Shipping Options</font></a></td></tr>";
echo "<tr><td align = left><li><a href=./admin.php><img src =./images/bullets.gif border=0><FONT face=Verdana color=#666666 
            size=2>Administrator's map menu</font></a></td></tr><tr><td><br></td></tr>";

echo "</table></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>";

if ($shipopt == "YES")
	echo "<br><font face=verdana size=2 color = navy><img src=./images/bullets.gif border=0> You can add shipping option when you add a new category.</font>";
	echo "<br><br<br><br>";
	$dummy = "true";
	
}

 if ((session_is_registered("admin")) && ($dummy == "false"))
  {
	$admin = $_SESSION['admin'];
	$username=$admin;
	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><center><img src=images/mouses.gif border=0><font face = Verdana size =4 color=navy>Logging In</font></center></td></tr>
<tr><td align=center>........................................................................................</td></tr>";
    	echo "<tr><td align=center><font face = Verdana size = 2>User '$admin' - Already logged in</font></td></tr><tr><td align=center>........................................................................................</td></tr>";
	
	echo "<tr><td align=center><a href=view_user.php?=$username><img src = images/view-user-log.gif border=0></a></centre>";
        echo "<tr><td align=center><a href=upd_user.php?=$username><img src = images/update-user-det.gif border=0></a></td></tr>";
	echo "<tr><td align=center><a href=view_history.php?=$username><img src = images/view-account-hist.gif border=0></a></td></tr>";
	echo "<tr><td><br></td></tr><tr><td align=center><b><font face = Verdana size = 2 color = navy>$footer</font></b></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>";
      $dummy = "true";
  }
if ($number != 0 && $dummy == "false")
{
	if ($username != "admin")
	$msg = "<tr><td align=center><strong><font face = Verdana size = 2>Welcome <font color=#666666>'$username'</font> - your log in was successful!</font></td></tr><font face=Times New Roman size=2><br>
</font><font face = Times New Roman size = 2 color = $highlight><tr><td align=center></font><font face = Verdana size = 3 color = #CCCCCC>........................................................................................</font></td></tr><tr><td align=center>
<font face = Verdana size = 2 color = $highlight>You log in details will be added to your user history</font></center></strong></td></tr></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>";

	if ($username == "admin")
	$msgs = "<tr><td align=center><strong><font face = Verdana size = 2>Welcome <font color=#666666>'$username'</font> - your log in was successful!</font></td></tr><font face=Times New Roman size=2><br></font><font face = Times New Roman size = 2 color = $highlight><tr><td align=center></font><font face = Verdana size = 3 color=#CCCCCC>........................................................................................</font></td></tr><tr><td align=center>
<font face = Verdana size = 2 color = $highlight>You log in details will be added to your user history</font></center></strong></td></tr>";
	$admin = $username;
	if ($admin == "admin")
	{
	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><center><img src=images/mouses.gif border=0><font face = Verdana size =4 color=navy>Logging In</font></center></td></tr>
<tr><td align=center>........................................................................................</td></tr>";
	echo("<tr><td><img src=images/peeps.gif border=0><font face=Verdana size=2>Now registering your user name and password - Click image to access the administrator's panel to change settings/edit/add/delete database records.</strong></font><center></td></tr><tr><td align=center><a href = login.php><img src = images/ADMIN.gif border=0></a></td></tr>");
	echo $msgs;
	}
	if (!session_is_registered("admin"))
    		session_register('admin');
	$_SESSION['admin'] = $admin;
	if ($username != "admin")
	{
		$table = "setting";
	$usql = "SELECT online from $table";
	$rest = @mysql_query($usql,$conn)
		or die("Unable to extract number of online users....");
	while ($row = mysql_fetch_array($rest))
	{
		$users = $row["online"];
	}
	$users += 1;
	$wsql = "UPDATE $table set online = '$users'";
	$upduser = @mysql_query($wsql,$conn)
		or die("Unable to update number of users online");
	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><center><img src=images/mouses.gif border=0><font face = Verdana size =4 color=navy>Logging In</font></center></td></tr>";

	echo "<tr><td align=center><a href=view_user.php?=$username><img src = images/view-user-log.gif border=0></a></td></tr>";
        echo "<tr><td align=center><a href=upd_user.php?=$username><img src = images/update-user-det.gif border=0></a></td></tr>";
	echo "<tdr><td align=center><a href=view_history.php?=$username><img src = images/view-account-hist.gif border=0></a></td></tr>";

	}
	# if user is administrator or user, then insert a new record
	if ($_SESSION["admin"] != "admin")
	{
		$table = "userlogs";
		$date_added = date("Y-m-d");
		$timeins = date("H:i dS F");
		$timein = "Time: $timeins";
		$viewer = getenv("HTTP_USER_AGENT");
		$browser = "Other Browser";
		if (preg_match("/MSIE/i","$viewer"))
		{
			$browser = "Internet Explorer";
		}
		else if (preg_match("/Netscape/i","$viewer"))
		{
			$browser = "Netscape";
		}
		else if (preg_match("/Opera/i","$viewer"))
		{
			$browser = "Opera";
		}
		if ($REMOTE_ADDR != null)
		{
			$ip = "$REMOTE_ADDR";
		}
		else
		{
			$ip = "n/a";
		}
		if ($HTTP_REFERER != null)
		{
			$referer = "$HTTP_REFERER";
		}
		else
		{
			$referer = "n/a";
		}
		$browse = $browser;
		$sqlnew = "INSERT INTO $table (sessid,username,timein,timeout,ip,referer,browser,date_added) values( \"$PHPSESSID\",'$admin','$timein','n/a','$ip','$referer','$browse','$date_added')";
		
		# create user log
		 if ((session_is_registered("admin")) and ($_SESSION["admin"] != "admin"))
		{
			$results=mysql_query($sqlnew,$conn)
				or die("Unable to excute the SQL query!!! Possibly SQL command already executed");
			if ($results)
			{
				if ($_SESSION["admin"] != "admin")
				echo("<tr><td align=center></font><font face = Verdana size = 2 color = #CCCCCC>........................................................................................</font></td></tr>"); 
				
			}
		}
	}
	if ($admin == "admin")
	{
	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
{
	if ($dummy == "false"){
	$table = "products";
	$sql = "SELECT * from $table";
	$products = mysql_query($sql,$conn);
	$prods = mysql_num_rows($products);

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

	// only show items when there are items to show !!!
	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"];
		}
		$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><center><img src=images/mouses.gif border=0><font face = Verdana size =4 color=navy>Logging In</font></center></td></tr>
<tr><td align=center>........................................................................................</td></tr>
<TR><TD align=center><font face = Verdana size = 2 color=darkgreen><b>Could not log you in!</b></font><br><br>
  <font size=1 face=Verdana>To try again please click <a href='reglog.php'>here</a>.<br>If this problem persists please close all browser windows.</font></center></font></td></tr><tr><td align=center>........................................................................................</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>";
	 }
}}	
?>
<?php 
echo($msg); 
}
?>
</body>
</html>