<?php
include("./config.php");
include ("./tests.php");
$PHPSESSID = session_id();
$table= "myorders";
$sel_item_totalprice = $sel_item_qty * $sel_item_price;
$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 'mydata'...Please press 'Create Database' to create new database.");
$get_itemtot = "SELECT SUM(SEL_ITEM_TOTALPRICE) FROM $table 
		WHERE USER_ID =  '$PHPSESSID'";
$itemtot_result = mysql_query($get_itemtot);

$itemtot = mysql_result($itemtot_result,0,"SUM(SEL_ITEM_TOTALPRICE)");
$fmt_itemtot = sprintf("%0.2f",$itemtot);
$item_count = "SELECT SUM(SEL_ITEM_QTY) FROM $table
WHERE USER_ID =  '$PHPSESSID'";
$item_result = mysql_query($item_count); 
	
$item_count_total = mysql_result($item_result,0,"SUM(SEL_ITEM_QTY)");	
if ($wcurrency == "NO")
{
	if ($itemtot < $min_cost)
	 {
		$shipping = $shipcost;
	} else 
	{
	$shipping = 0;
	}
}
else
	$shipping = 0;
if ($item_count_total < 1)
{
	$shipping = 0;
	$item_count_total = 0;
}
$sub_total = number_format(($fmt_itemtot + $shipping),2);
$table = "setting";
$usql = "SELECT * from $table";
$rest = @mysql_query($usql)
	or die("Unable to extract number of online users....");
while ($row = mysql_fetch_array($rest))
{
	$users = $row["online"];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>

<style type="text/css">
<!--
H2
{font-family: Verdana, Tahoma, Arial;
 font-size: 12pt;
 font-weight: bold}

BODY
{font-family: Verdana, Tahoma, Arial;
 font-size: 8pt;
 font-weight: normal;}

SELECT 
{background-color: #FFFFFF; 
 color: #000000;
 font-size: 8pt;
 font-family: Verdana, Tahoma, Arial;
 font-weight: normal;}

textarea, .TEXTBOX, .FILE
{background-color: #FFFFFF; 
 border: #7F9DB9 1px solid; 
 color: black; 
 font-family: Verdana, Tahoma, Arial; 
 font-size: 8pt; 
 font-weight: normal;}

.SUBMIT
{background-color: #cadeee; 
 border: #7F9DB9 1px solid; 
 color: black; 
 font-family: Verdana, Tahoma, Arial; 
 font-size: 8pt; 
 font-weight: bold;}

TABLE, TR, TD                
{font-family:Verdana, Tahoma, Arial;
 font-size: 8pt; 
 color:#000000}

a:link, a:visited, a:active  
{text-decoration:underline; 
 color:#000000}
a:hover 
{text-decoration:none;
 color:#CC0000}
-->		
</style>

</head>

<BODY text=#000000  leftMargin=0 topMargin=0 rightMargin=0 bottommargin=0>
<TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" style="border-collapse: collapse" bordercolor="#FFFFFF" height="1" bgcolor="#FFFFFF">
        <TR><form method="post" action="login.php"> 
             <TD bgcolor="#FFFFFF" width="185" height="15" rowspan="3">
	<p align="center">
          <img border="0" src="images/EZ-LOGO.GIF" align="left" width="223" height="71"><p>&nbsp;<p align="center">
          &nbsp;</TD>
            <TD bgcolor="#FFFFFF" width="144" height="91" rowspan="3">
          &nbsp;</TD>
            <TD bgcolor="#FFFFFF" width="64" height="34" bordercolor="#FFFFFF">
	 <p align="center">
          <img border="0" src="images/USERNAME.GIF" width="62" height="25"></TD>
            <TD bgcolor="#FFFFFF" width="133" height="34" bordercolor="#FFFFFF">
          <p align="center">
          <input class=FORMTEXT name="username" size="19" style="border-style: solid; border-width: 1"></TD>
          </TR>
        <tr>
            <TD bgcolor="#FFFFFF" width="64" height="35" bordercolor="#FFFFFF">
          <p align="center">
          <img border="0" src="images/PASSWORD.GIF" width="58" height="27"></TD>
            <TD bgcolor="#FFFFFF" width="133" height="35" bordercolor="#FFFFFF">
          <p align="center">
          <input class=FORMTEXT name="passwrd" size="19" style="border-style: solid; border-width: 1" type="password"></TD>
          </tr>
              
        <tr>
            <TD bgcolor="#FFFFFF" width="197" height="22" colspan="2" bordercolor="#FFFFFF">
	    <input type = image src="images/logon1.gif" hspace="6" width="27" height="18" align="left"></form><a href="logout.php">
            <img border="0" src="images/logoff1.gif" hspace="1" width="55" height="18" align="right"></a><a href=newpass.php><FONT face=Verdana color=#3a6b93 size=2>Register User</font></TD>
            </a>
          </tr>
        <TR>
          <TD bgcolor="#FFFFFF" width="537" height="12" colspan="4">
          <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="101%" id="AutoNumber1" height="1">
            <tr>
              <td width="102%" height="1">
              <p align="center">
              </td>
            </tr>
            <tr>
              <td width="100%" height="1">
              </td>
            </tr>
          </table>
          </TD>
          </TR></TABLE>
      <TABLE id=AutoNumber1 style="BORDER-COLLAPSE: collapse" 
      borderColor=#111111 cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TR>
          <TD width="5%" height=29>
            <P style="MARGIN-LEFT: 10px" align=center>
            <IMG height=23 hspace=0 
            src="images/home.gif" width=24 border=0></P></TD>
          <TD width="12%" height=29><U><FONT face=Verdana color=#666666 
            size=1>
          <A 
            href="store.php" style="text-decoration: none">Store 
            Home</A></FONT></U></TD>
          <TD width="4%" height=29>
            <P align=center>
            <IMG height=19 src="images/shopbag3.gif" 
            width=23 align=left border=0></P></TD>
          <TD width="8%" height=29><U><FONT face=Verdana color=#666666 
            size=1>
          <A 
            href="shop_viewcart.php" style="text-decoration: none">Basket</A></FONT></U></TD>
          <TD width="3%" height=29>
            <P align=left>
            <IMG height=18 src="images/go.gif" width=18 
            border=0></P></TD>
          <TD width="11%" height=29><U><FONT face=Verdana color=#666666 
            size=1>
          <A 
            href="shop_checkout.php" style="text-decoration: none">Checkout</A></FONT></U></TD>
          <TD align=middle width="4%" height=29>
          <IMG height=15 
            src="images/peeps.gif" width=24 align=left border=0><FONT 
            face=Verdana color=#3a6b93 size=1></FONT></TD>
          <TD align=middle width="17%" height=29>
            <P align=left><FONT face=Verdana color=#3a6b93 size=1>Users Online: <?php echo($users);?></FONT></P></TD>
          <TD align=middle width="5%" height=29>
            <P align=left>
            <IMG height=21 src="images/checkout.gif" 
            width=33 align=left border=0></P></TD>
          <TD align=middle width="10%" height=29>
            <P align=left><FONT face=Verdana color=#3a6b93 size=1>Items: <?php echo($item_count_total);?></FONT></P></TD>
          <TD align=middle width="3%" height=29>
            <P align=left><FONT face=Verdana color=#3a6b93 
            size=1>&nbsp;</FONT><IMG height=16 
            src="images/shopbag2.gif" width=15 align=absMiddle 
            border=0>&nbsp; </P></TD>
          <TD align=middle width="41%" height=29>
            <P align=left><FONT face=Verdana color=#3a6b93 size=1>Basket: <?php if ($wcurrency == "NO") echo $currency; else echo $wcurrency;?><?php echo(" $sub_total");?></FONT></P></TD></TR>
        </TABLE><BR>
