<html>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="Microsoft FrontPage 5.0" name=GENERATOR>
<head>
<title>EZ Shopper E-Store By 128 Concepts</title>
<style>A{text-decoration:none;}</style>
<style type="text/css">
<!--
.links {color: #000000}
.links:hover {color: #000080; text-decoration: none}
-->
</style>
<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>
<body>
<?php
/***************************************************************************
 *			stores.php                        	           *
 *                     	          				           *
 *   File Info:		  EZ Shopper Store page                            *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include("./tests.php");
include("./config.php");
#include("./your-header.inc");

########## change $welcome and $welcomes to match description of your online store #############

$welcome = "Welcome to our online store";
$welcomes = "--- Edit the file stores.php and change $welcomes to input your own store description ---";


######################### 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);
session_start();
if ($pos >= 0 && $_SESSION["empty"] == NULL)
{
	include_once("./your-header.inc");
	if ($noshow == "YES")
	{
	echo "<b><br><br><br><br><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></b><br>";
	}
	include_once("./redirect-me.php");
}
else{

$date_added = date("jS M Y");
session_start();
			
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=450 border=0>
       <TBODY>
       <TR>
       <TD><p align=center><font face=verdana size=2>$welcome</p></font></td></tr><tr><td><p align=justify><font face=verdana size=1>$welcomes</font></p></TD></tr><tr><td><p align = justify><font face=verdana size=1>We currently can only ship orders to customers residing in United Kingdom. We expect in the near future to ship to customers outside of United Kingdom.</font></p></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>";

echo "<center><img src=images/upd-cart.gif border=0><FONT face=Verdana color=#3a6b93 size=2>  Click on the product category to view products.</font></center><br>";

if ($_SESSION["empty"] != NULL)
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=450 border=0>
       <TBODY>
       <TR>
       <TD><p align=center><b><font face=verdana size=2 color=navy><a href = javascript:newWindow('./welcome.php','acePopup',600,450,'scrollbars=yes')>Welcome</a>  - $date_added</font></b></p></font></td></tr>";
else
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=450 border=0>
       <TBODY>
       <TR>
       <TD><p align=center><b><font face=verdana size=2 color=navy>Welcome - $date_added</font></b></p></font></td></tr><tr><td><img src=images/upd-cart.gif border=0><FONT face=Verdana color=#3a6b93 size=2>  Click on the product category to view products.</font></td></tr>";	
if ($usecat != "YES"){
$form="";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Accessories> Accessories</a></td><td width=45% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Books%20&%20Magazines>Books</a></td></tr><tr>";
$form.="<td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href =./shop_showcat.php?=Battery/Charger%20Products> Battery/Charger</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Bathroom%20Products> Bathroom Products</a></td></tr><tr>";
$form.="<td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Bedroom%20Products> Bedroom Products</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Bikes/Accessories> Bikes/Accessories</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href =./shop_showcat.php?=Camera/Photography>Cameras/Photography</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href =./shop_showcat.php?=Car/Accessories> Car/Accessories</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=CD/Accessories> CD/Accessories</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Office%20&%20Stationary> Office/Stationary</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Computers/Accessories>Computers etc</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Clothing%20&%20Fashion> Clothing etc</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Cooking%20&%20Food> Cooking and Food</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=DVDs/Accessories> DVDs/Accessories</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Electrical%Products> Electrical Products</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Furniture%20&%20Fittings> Furniture & Fittings</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Garden%20Products> Garden Products</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Home%20&%20Household> Household</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Jewellery> Jewellery</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Kitchen> Kitchen</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Lighting> Lighting</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Personal%20Hygiene> Personal/Hygiene</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Security%20Products> Security Products</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Telephone/Mobiles%20Products> Mobiles/Telephone</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Television/Hi%20Fi%20Products> Television/Hi Fi</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Tools/DIY> Tools/DIY</a></td></tr>";
$form.="<tr><td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Travel> Travel</a></td>";
$form.="<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href = ./shop_showcat.php?=Video%20Products> Video Products</a></td></tr><tr>";
$form.="<td width=34% bordercolorlight=#FFFFFF><img src =images/bullet.gif width = 10><img src =images/folder.gif><a href =./shop_showcat.php?=Watches%20Products> Watches Products</a></td></tr>";
$form.="</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>";
echo $form;
}
else
{
$table = "category";
$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 category";
$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
$number = mysql_num_rows($rs);

# display categories

if ($number > 0)
{
	

  	while ($row = mysql_fetch_array($rs))
	{
		$category = $row["category"]; 	// category 
		$cpics = $row["cpic"];		// category picture
		$cpic = strtolower($cpics);		// convert all characters to lower case.

		##### display default category picture if cannot find picture or $cpic = ./images/folder.gif #####

		if ((@fopen($cpic,"r") == NULL) or ($cpic == "./images/folder.gif"))
		echo "<tr>
    		<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/spacer.gif border=0><img src =images/folder.gif><a href = \"./shop_showcat.php?=$category\">  <font face=verdana size=2>$category</font></a></td>
   		</tr>";
		else
		echo "<tr>
    		<td width=45% bordercolor=#FFFFFF bordercolorlight=#FFFFFF><img src =images/spacer.gif border=0><img src =$cpic width=32 height=32><a href = \"./shop_showcat.php?=$category\"> <font face=verdana size=2>$category</font></a></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 "<tr><td align =center>--- No Product Categories ---</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>";
}
}
}
?>
</body>
</head>
</html>
