<?php
header("Content-type: text/html; charset=windows-1256");

session_start();
if($_SESSION['dbName']==""){
header("location:../index.php");
}

include("config.inc.php");

$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");


$querylog="SELECT FC_RetailReport as loginaccess, print as printaccess, ExporttoExcel from ".$_SESSION['dbLabel'].".login where user_account='".$_SESSION['useraccount']."' 	and Upper(Login_Schema) = Upper('".$_SESSION['dbName']."')	";
$resultlog=mysql_query($querylog,$connection) or die(mysql_error());
while($rows=mysql_fetch_array($resultlog)){
	extract($rows);
}

if ($loginaccess=='' or $loginaccess==0)
	header("location:menu.php");
	
if ($ExporttoExcel==1)
	$ExporttoExcelStatus= 'button';
else
	$ExporttoExcelStatus= 'hidden';		

//Item Groups List
$querygroup=" select distinct group_code,group_name ".
			" from grouping where group_code in (select group_code from ".$_SESSION['dbLabel'].".loginstk where user_account='".$_SESSION['useraccount']."') ".
			" order by group_code";
$resultgroup = mysql_query($querygroup,$connection) or die(mysql_error());
$groupexist   = mysql_num_rows($resultgroup);
if ($groupexist == 0)
	$querygroup="select distinct group_code,group_name from grouping order by group_code";
$resultfromgroup=mysql_query($querygroup,$connection) or die(mysql_error());
$resulttogroup=mysql_query($querygroup,$connection) or die(mysql_error());

//Item SubGroups List
$querysubgroup= " select distinct subgroup_code, subgroup_name ".
				" from subgroup where subgroup_code in (select subgroup_code from ".$_SESSION['dbLabel'].".loginstk where user_account='".$_SESSION['useraccount']."') ".
				" order by subgroup_code";
$resultsubgroup = mysql_query($querysubgroup,$connection) or die(mysql_error());
$subgroupexist   = mysql_num_rows($resultsubgroup);
if ($subgroupexist == 0)
	$querysubgroup="select distinct subgroup_code,subgroup_name from subgroup order by subgroup_code";
$resultfromsubgroup=mysql_query($querysubgroup,$connection) or die(mysql_error());
$resulttosubgroup=mysql_query($querysubgroup,$connection) or die(mysql_error());



print <<< HERE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

HERE;



//User Accounts List
$queryusers=" select distinct user_account, user_name ".
			" from ".$_SESSION['dbLabel'].".users ".
			" order by user_account ";
$resultusers = mysql_query($queryusers,$connection) or die(mysql_error());


//CashRegister List
$querycashregister= " select distinct cashregister_name as code, cashregister_name as name ".
					" from cashregister ".
					" order by cashregister_name ";
$resultcashregister = mysql_query($querycashregister,$connection) or die(mysql_error());

//Salesmen List
$querysalesman= " select distinct ledger_number as code, ledger_name as name ".
				" from salesmen ".
				" order by ledger_number ";
$resultsalesman = mysql_query($querysalesman,$connection) or die(mysql_error());

//Drivers List
$querydrivers= " select distinct ledger_number as code, ledger_name as name ".
			   " from clients where upper(client_type) = 'DRIVER' ".
			   " order by ledger_name ";
$resultdrivers = mysql_query($querydrivers,$connection) or die(mysql_error());


$querysetup ="select base1, base2 from setup ";
$resultsetup=mysql_query($querysetup,$connection) or die(mysql_error());
$rowsetup=mysql_fetch_row($resultsetup);

//Read From Module Table
$querymodule=" Select ifNull(Module_Project,0) As Module_Project, ifNull(Module_Costcenter,0) As Module_CostCenter ".
             " From Module";
$resultmodule=mysql_query($querymodule,$connection) or die(mysql_error());
while($rowmodule=mysql_fetch_array($resultmodule)){
	extract($rowmodule);
}


$querylog=" select ifNull(FI_RepRestrictProject,0) As FI_RepRestrictProject, ifNull(FI_RepRestrictCostcenter,0) As FI_RepRestrictCostcenter, ".
		  " ifNull(FI_RepRestrictWarehouse,0) As FI_RepRestrictWarehouse, ifNull(FI_ShowCostPrice,0) As FI_ShowCostPrice ".
          " from ".$_SESSION['dbLabel'].".login where user_account='".$_SESSION['useraccount']."' and Upper(Login_Schema) = Upper('".$_SESSION['dbName']."') ";
$resultlog=mysql_query($querylog) or die(mysql_error());
while($rows=mysql_fetch_array($resultlog)){
	extract($rows);
}

//Projects List
$queryproject=" select distinct project.project_code, project_name ".
              " from project left join ".$_SESSION['dbLabel'].".loginstk on project.project_code like concat(ifnull(loginstk.project_code,project.project_code),'%') ".
			  " where user_account='".$_SESSION['useraccount']."' ".
			  " and (loginstk.project_code is not null and loginstk.project_code != '') ".
			  " order by project.project_code";
$projectresult = mysql_query($queryproject,$connection) or die(mysql_error());
$projectexist  = mysql_num_rows($projectresult);	
if ($projectexist == 0 || $FI_RepRestrictProject == 0)
    $queryproject=" select distinct project_code, project_name from project order by project_code ";	  

$resultfromproject=mysql_query($queryproject,$connection) or die(mysql_error());
$resulttoproject  =mysql_query($queryproject,$connection) or die(mysql_error());


//Costcenter List
$querycostcent=" select distinct costcent.costcent_code, costcent_name ".
               " from costcent left join ".$_SESSION['dbLabel'].".loginstk on costcent.costcent_code like concat(ifnull(loginstk.costcent_code,costcent.costcent_code),'%') ".
			   " where user_account='".$_SESSION['useraccount']."' ".
			   " and (loginstk.costcent_code is not null and loginstk.costcent_code != '') ".
			   " order by costcent.costcent_code";
$costcentresult = mysql_query($querycostcent,$connection) or die(mysql_error());
$costcentexist  = mysql_num_rows($costcentresult);		  
if ($costcentexist == 0 || $FI_RepRestrictCostcenter == 0)
    $querycostcent=" select distinct costcent_code, costcent_name from costcent order by costcent_code ";			  
	
$resultfromcostcent=mysql_query($querycostcent,$connection) or die(mysql_error());
$resulttocostcent  =mysql_query($querycostcent,$connection) or die(mysql_error());


//Get Default Project
$querydflproject="select project_code as defaultproject from ".$_SESSION['dbLabel'].".loginstk where user_account='".$_SESSION['useraccount']."' and default_project=1 ";
$resultdflproject=mysql_query($querydflproject,$connection) or die(mysql_error());
while($rows=mysql_fetch_array($resultdflproject)){
	extract($rows);
}
	
//Get Default Coscenter
$querydflcostcent="select costcent_code as defaultcostcent from ".$_SESSION['dbLabel'].".loginstk where user_account='".$_SESSION['useraccount']."' and default_costcenter=1 ";
$resultdflcostcent=mysql_query($querydflcostcent,$connection) or die(mysql_error());
while($rows=mysql_fetch_array($resultdflcostcent)){
	extract($rows);
}


//Warehouse List
$querywarehouse=" select distinct warehouse.warehouse_code, warehouse_name ".
				" from warehouse where warehouse_code in (select warehouse_code from ".$_SESSION['dbLabel'].".loginstk ".
				"                                         where user_account='".$_SESSION['useraccount']."' ".
				"                                         and (loginstk.warehouse_code is not null and loginstk.warehouse_code != '') ) ".
				" order by warehouse.warehouse_code";
$resultwh = mysql_query($querywarehouse,$connection) or die(mysql_error());
$whexist   = mysql_num_rows($resultwh);
if ($whexist == 0 || $FI_RepRestrictWarehouse == 0)
	$querywarehouse="select warehouse_code,warehouse_name from warehouse order by warehouse_code";
	
$resultfromwarehouse=mysql_query($querywarehouse,$connection) or die(mysql_error());
//$resulttowarehouse  =mysql_query($querywarehouse,$connection) or die(mysql_error());


if ((!isset($fromproject)) && $Module_Project == 1 && $FI_RepRestrictProject == 1)
	$fromproject = $defaultproject;
if ((!isset($toproject)) && $Module_Project == 1 && $FI_RepRestrictProject == 1)
	$toproject = $defaultproject;
if ((!isset($fromcostcent)) && $Module_CostCenter == 1 && $FI_RepRestrictCostcenter == 1)	
	$fromcostcent = $defaultcostcent;	
if ((!isset($tocostcent)) && $Module_CostCenter == 1 && $FI_RepRestrictCostcenter == 1)	
	$tocostcent = $defaultcostcent;


if (empty($fromdate))	
	$fromdate = displayToday();
if (empty($todate))	
	$todate = displayToday();
	
$ShowCostMode  = '';
if($FI_ShowCostPrice == 0)  {
	$ShowCostMode  = 'disabled';	
}
	
print <<< HERE

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" media="all" href="css-v2/style.css">

<script language="JavaScript" src="CalendarPopup.js" ></script><!-- Date only with year scrolling -->
<script type="text/javascript" language="javascript">
<!--


all = 0;  // 0 means 'no', 1 means 'yes'


function showlistitem(str){

	window.open('select_item.php?item='+str,'mywindow','width=900,height=550,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');
}

function settrans(vop){

window.open('List_cashregistertrans.php?op='+vop);

}

function printPrev(printaccess,print,vexport)
{
	width = screen.width - 10;
	height = screen.height - 66;
	var str='';
  	
 
  
	for (var i=0; i < document.form1.groupby.length; i++)
	{
		if (document.form1.groupby[i].checked)
		{
			var vargroupby = document.form1.groupby[i].value;
		}
	}
	
	    
  
	varfromdate     = document.form1.fromdate.value;
	vartodate       = document.form1.todate.value;
	varfromuser     = document.form1.fromuser.value;
	varfromcashreg  = document.form1.fromcashreg.value;
	 
	vReportName = 'Rep_RetailViewer.php';
	 
	str = vReportName+'?fromdate='+varfromdate+'&todate='+vartodate+'&fromuser='+varfromuser
		 +'&fromcashreg='+varfromcashreg+'&export='+vexport+'&groupby='+vargroupby;
		
	window.open(str);
 
}


function ShowSummary() {
    var x= document.form1;
	
	for (var i=0; i < x.groupby.length; i++)
	{
		if (x.groupby[i].checked)
		{
		  var vargroupby = x.groupby[i].value;
		}
	}
	
	if (x.detailreport.checked) {
		if (vargroupby != 2 && vargroupby != 6) {
			x.showsummary.disabled = false;
		}	
		x.showgroups.disabled = false;
		
		x.showunpost.disabled = true;
		x.showunpost.checked  = false;
		x.custperitem.disabled  = true;
		x.custperitem.checked   = false;
		x.perwarehouse.disabled = true;
		x.perwarehouse.checked  = false;
		x.salessummary.disabled = true;
		x.salessummary.checked  = false;
		
		if (vargroupby == 2) {
			x.showcost.disabled = false;
			
			for (var i=0; i < x.costoption.length; i++)
			{
				x.costoption[i].disabled = false;
			}
		}	
	}  
	else { 
		x.showsummary.disabled = true;
		x.showsummary.checked  = false;
		x.showgroups.disabled = true;
		x.showgroups.checked  = false;
		x.showcost.disabled = true;
		x.showcost.checked  = false;
		x.custperitem.disabled  = false;
		x.custperitem.checked   = false;
		x.perwarehouse.disabled = false;
		x.perwarehouse.checked  = false;
		x.salessummary.disabled  = false;
		x.salessummary.checked   = false;
		
		for (var i=0; i < x.costoption.length; i++)
		{
			x.costoption[i].disabled = true;
		}
		
		if (vargroupby != 2 && vargroupby != 6) {
			x.showunpost.disabled = false;
			x.showunpost.checked  = false;
		}
	}
	
}

function SelectCustomerList() {
	var x= document.form1;

	if (x.custperitem.checked) {
		x.detailreport.disabled = true;
		x.detailreport.checked  = false;
		x.perwarehouse.disabled = true;
		x.perwarehouse.checked  = false;
		x.salessummary.disabled  = true;
		x.salessummary.checked   = false;
	} else {
		x.detailreport.disabled = false;
		x.detailreport.checked  = false;
		x.perwarehouse.disabled = false;
		x.perwarehouse.checked  = false;
		x.salessummary.disabled  = false;
		x.salessummary.checked   = false;
	}
}

function SelectSalesPerWarehouse() {
	var x= document.form1;

	if (x.perwarehouse.checked) {
		x.detailreport.disabled = true;
		x.detailreport.checked  = false;
		x.custperitem.disabled  = true;
		x.custperitem.checked   = false;
		x.salessummary.disabled  = true;
		x.salessummary.checked   = false;
	} else {
		x.detailreport.disabled = false;
		x.detailreport.checked  = false;
		x.custperitem.disabled  = false;
		x.custperitem.checked   = false;
		x.salessummary.disabled  = false;
		x.salessummary.checked   = false;
	}
}

function SelectSalesSummary() {
	var x= document.form1;

	if (x.salessummary.checked) {
		x.detailreport.disabled = true;
		x.detailreport.checked  = false;
		x.custperitem.disabled  = true;
		x.custperitem.checked   = false;
		x.perwarehouse.disabled  = true;
		x.perwarehouse.checked   = false;
		x.showslipdetail.disabled  = false;
		x.showslipitems.disabled  = false;
	} else {
		x.detailreport.disabled = false;
		x.detailreport.checked  = false;
		x.custperitem.disabled  = false;
		x.custperitem.checked   = false;
		x.perwarehouse.disabled  = false;
		x.perwarehouse.checked   = false;
		x.showslipdetail.disabled  = true;
		x.showslipdetail.checked   = false;
		x.showslipitems.disabled  = true;
		x.showslipitems.checked   = false;
	}
}

function ShowGroups() {
	var x= document.form1;
	
	if (x.showgroups.checked) {
	    x.showdetail.disabled = true;
		x.showdetail.checked  = false;
	}  
	else { 
		x.showdetail.disabled = false;
	}

}

function ShowDetail() {
    var x= document.form1;
	
	for (var i=0; i < x.groupby.length; i++)
	{
		if (x.groupby[i].checked)
		{
		  var vargroupby = x.groupby[i].value;
		}
	}
	
	if (vargroupby == 2 || vargroupby == 6 || x.showgroups.checked) { 
	    x.showdetail.disabled = true;
		x.showdetail.checked  = false;
		x.showunpost.disabled = true;
		x.showunpost.checked  = false;
		
		x.detailreport.disabled = false;
		x.perwarehouse.disabled = false;
		x.salessummary.disabled = false;
		x.showgroups.disabled   = false;
		
		if (x.detailreport.checked) {
			x.showsummary.disabled = true;
			x.showsummary.checked  = false;
		}  
	}
	else if (vargroupby == 8) { 
		x.showdetail.disabled = true;
		x.showdetail.checked  = false;
		x.showunpost.disabled = false;
		x.showunpost.checked  = false;
		
		x.detailreport.disabled = true;
		x.detailreport.checked  = false;
		x.showgroups.disabled   = true;
		x.showgroups.checked    = false;
		x.showsummary.disabled  = true;
		x.showsummary.checked   = false;
		x.perwarehouse.disabled = true;
		x.perwarehouse.checked  = false;
	}
	else { 
	    x.showdetail.disabled = false;
		x.showdetail.checked  = false;
		
		x.detailreport.disabled = false;
		x.perwarehouse.disabled = false;
		x.salessummary.disabled = false;
		x.showgroups.disabled   = false;
		
		if (x.detailreport.checked) {
			x.showsummary.disabled = false;
			x.showsummary.checked  = true;
		} else {
			x.showunpost.disabled = false;
			x.showunpost.checked  = false;
		}
	}
	
	if (vargroupby == 2 && x.showdetail.checked) {
		x.showcost.disabled = false;
		
		for (var i=0; i < x.costoption.length; i++)
		{
			x.costoption[i].disabled = false;
		}

	} else {
		x.showcost.disabled = true;
		x.showcost.checked  = false;
		
		for (var i=0; i < x.costoption.length; i++)
		{
			x.costoption[i].disabled = true;
		}
	}	
	
}

function SelectSlipItems() {
	var x= document.form1;

	if (x.showslipitems.checked) {
		x.showslipdetail.checked  = true;
	} 
}

function showlistcustomer(str){

	window.open('List_Customers.php?frm=2&item='+str,'List_Customers','width=650,height=450,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');
}

function showlistVendors(str){
  
	window.open('List_Vendors.php?frm=4&item='+str,'List_Vendors','width=750,height=400,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');
}

function showlistCreditCard(str){

  window.open('List_CreditCards.php?frm=2&str='+str,'List_CreditCards','width=600,height=400,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');
}

-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Sales Viewer</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.style1 {
	color: #FF0000;
	font-family: "Times New Roman", Times, serif;
	font-size: 20px;
}
.style8 {font-size: 11px; color: #999999; font-weight: bold; }
.style11 {font-size: 11px}
body {
	margin-top: 0px;
}
-->
</style>

<link type="text/css" rel="stylesheet" href="dhtmlgoodies_calendar.css?random=20051112" media="screen"></LINK>
	<SCRIPT type="text/javascript" src="dhtmlgoodies_calendar.js?random=20060118"></script>
</head>
<body>
HERE;

echo "<form id='form1' name='form1' method='post' action='$_SERVER[PHP_SELF]'>
		<input type='hidden' name='HideMenu' value='$HideMenu'>";

echo"<table cellpadding='0' cellspacing='0' border='0'  align='center' class='layout-width'>";
if ($HideMenu != 1) include_once("header.php");
echo" <tr><td  valign='top'>";

include_once("sidemenu.php");
echo"  </td></tr>";


echo" <tr style='height:26px;'>
		<td  valign='top' id='content-top'>
			<table border='0' cellpadding='0' cellspacing='0' style='table-layout:fixed; height:26px;' class='layout-width'>
			<tr style='height:26px;'>
				<td style='width:38px; height:26px;'>&nbsp;</td>
				<td valign='middle' style='width:300px; height:26px;'><span class='title'>Sales Viewer </span></td>
				<td class='message' valign='middle' style='height:26px;'>".htmlspecialchars($message, ENT_QUOTES)."</td>
			</tr></table>
		</td>
	  </tr>";

echo"<tr>
		<td  height='34'  valign='top' id='content-top2'>
			<table border='0' cellpadding='0' cellspacing='0' class='layout-width'>
			<tr>
				<td width='30'  height='34'>&nbsp;</td>
				<td valign='middle' height='34' width='720px' align='left'>";
		
	echo" <button type='reset' id='btnClear' name='btnClear' title='Clear'><span><span>Clear</span></span></button>";
	echo" <button type='button' id='btnPreview' name='btnPreview'  onClick=\"printPrev('".$printaccess."',0,0)\"; title='Preview'><span><span>Preview</span></span></button>";
	echo" <button type='button' id='btnPrint' name='btnPrint'  onClick=\"printPrev('".$printaccess."',1,0)\"; title='Print'><span><span>Print</span></span></button>";

	if ($ExporttoExcel==1){
		echo" <button type='button' id='btnExcel' name='btnExcel' onClick=\"printPrev(0,0,1)\"; title='Export Excel'><span><span>Export Excel</span></span></button>";

	}	

echo"	</td></tr></table>";
echo"</td></tr>";				

		
echo"<tr><td id='content-body'>
<table border='0'  align='center' valign='top' width=100% class='tablecontent'>
   <tr bgcolor='#F7F7F7'><td valign='top' align='left' colspan='10'>";		
echo '  <table height="200" border="0" align="center" valign="top" width="100%" >';


echo" <tr>";	  
echo"   <td width='5%' height='19' align='left' bgcolor='#F5F5F5'><span class='style8'>Date Form</span></td> ";
echo"   <td width='10%' height='30' valign='top' bgcolor='#F5F5F5' ><span class='style8'>";
echo"      <input type='text' name='fromdate' value='$fromdate' maxlength='20' size='15'>";
echo"&nbsp;<A HREF=\"#\" onClick=\"displayCalendar(document.form1.fromdate,'dd/mm/yyyy',this); return false;\" NAME=\"anchor1\" ID=\"anchor1\"><image src='./img/cal.gif' border=0 align=center></image></A></span>



 ";


 
echo" <td width='45%' rowspan='3' valign='top' bgcolor='#F5F5F5'>&nbsp;<b><u>Type<u><br>";
//echo"  <div id='main' style='position:relative; top:0px; width:590px; height:145px; border:1px solid #999999;'>";
echo"   <div id='left' style='position:relative; top:0px; width:200px; float:left;'>";

echo"   <span class='style8'><label>";
		 
           echo "<input name='groupby' type='radio' value='1' checked  />";
		 
		echo "Insert</label></span><br>";
		
echo"   <span class='style8'><label>";
		
		   echo "<input name='groupby' type='radio' value='2' />";
		echo "Discount</label></span><br>";
echo"   <span class='style8'><label>";
		
		   echo "<input name='groupby' type='radio' value='3' />";
		echo "Refund</label></span><br>";		

echo"   <span class='style8'><label>";
			
		   echo "<input name='groupby' type='radio' value='4' />";
		echo "Delete</label></span><br>";		
		
echo"   <span class='style8'><label>";
		
		   echo "<input name='groupby' type='radio' value='5' />";
		echo "Edit</label></span><br>";		
echo" </tr>";
 
 

echo" </div>";
echo" </td>";
echo" </tr>";


echo"<tr>";
echo"    <td  height='80' valign=top><span class='style8'>To</span></td><td valign=top>  <input type='text' name='todate' value='$todate'  maxlength='20' size='15' style='margin-top:2px;'>";
echo"&nbsp;<A HREF=\"#\" onClick=\"displayCalendar(document.form1.todate,'dd/mm/yyyy',this); return false;\" NAME=\"anchor1\" ID=\"anchor1\"><image src='./img/cal.gif' border=0 align=center></image></A></span>";
echo"</td></tr>";

 

echo" <tr>";
echo"   <td colspan='3' bgcolor='#F5F5F5'>";
echo"	<table border='0' align='center' valign='top' width='100%' cellpadding='0' cellspacing='0'><tr>";
 
 

echo" <tr> ";
	  
			 

echo"   <td width='10%'  align='right' bgcolor='#F5F5F5' ><span class='style8'>User Account</span></td>";
echo"   <td width='40%' bgcolor='#F5F5F5' ><span class='style8'><select name='fromuser' id='fromuser' style='width:300px'>";
		echo"<option></option>";
		while($userf=mysql_fetch_row($resultusers)){
		echo"<option ";
			if ($fromuser==$userf[0])
				echo " selected ";
			echo" value='$userf[0]'>$userf[0] | $userf[1]</option>";
		}
		echo"</select>";
echo"</span></td>
<td width='10%'  align='right' bgcolor='#F5F5F5' ><span class='style8'>Cashregister</span></td>";
echo"   <td width='40%' bgcolor='#F5F5F5' ><span class='style8'><select name='fromcashreg' id='fromcashreg' style='width:300px'>";
		echo"<option></option>";
		while($cashregf=mysql_fetch_row($resultcashregister)){
		echo"<option ";
			if ($fromcashreg==$cashregf[0])
				echo " selected ";
			echo" value='$cashregf[0]'>$cashregf[0] | $cashregf[1]</option>";
		}
		echo"</select>";
echo"</span></td>";
echo" </tr>";



echo" </table></td></tr>";

echo" <tr>";
echo"   <td height='100' colspan='3' bgcolor='#F5F5F5'><span class='style8'>&nbsp;</span></td>";
echo" </tr>";

echo"   </table></td></tr>"; 
	echo"   </table></td></tr><tr height='30'><td align='center' id='content-bottom' ></td></tr>"; 
  echo"</table>
 
</form>
</body>
</html>";


//Return Date in DD/MM/YYYY format
function displayFromDate($data){
	return "01/01/".substr($data, 6, 4);		
}
//Return Today's Date in DD/MM/YYYY format
function displayToday(){
	return strftime("%d")."/".strftime("%m")."/".strftime("%Y");
}
	  
?>