//set colour change for each row
$rowcolour=1;
//set table font size
$fontsize=3;
// Include the header file
include ("../include/header.php");
require("../include/sqlcon.php");
$sql = new MySQL_class;
$sql->Create("triumphstag_db");
$sql1 = new MySQL_class;
$sql1->Create("triumphstag_db");
echo("
");
$date2=(time() - 2592000);
$deletedate= (date ("d F Y h:iA",$date2));
//echo(" Please note that entries automatically delete after 30 days
\n");
echo("Anything entered before $deletedate will have been deleted (30 days)
\n");
$sql1->Delete("delete from stagdatasupplierdeals where datestamp < $date2 AND id >1");
$sql1->Query("Select id,part,price,location from stagdatasupplierdeals");
$totalentries = $sql1->rows;
Echo ("There are a total of $totalentries Current Offers & Deals
");
//********************List the entries **********************************
//echo("Current Offers & Deals
");
//echo("");
echo("");
echo(" | ID | Company Name | Part | Price | Location | Date Entered |
");
$sql->Query("SELECT id,part,price,location,datestamp,name from stagdatasupplierdeals order by $sort");
for ($i = 0; $i < $sql->rows; $i++) {
$sql->Fetch($i);
$id = $sql->data[0];
$part= $sql->data[1];
$price= $sql->data[2];
$location = $sql->data[3];
$date = $sql->data[4];
$compname = $sql->data[5];
$date1 = (date ("d F Y ",$date));
if ($date >(time() - 604800)) {
$icon = "";
} else {
$icon="";
}
//assemble each row of the table
//check row colour and alternate
if (1==$rowcolour){
$bgcolour="bgcolor='#FFFFFF' bordercolor='#FFFFFF'";
$rowcolour=0;
} else {
$bgcolour="bgcolor='#F4F4F4' bordercolor='#F4F4F4'";
$rowcolour=1;
}
echo (" $icon | $id | $compname | $part | $price | $location | $date1 |
");
}
echo ("
");
//*************** add a link to show Stags for sale out of the registry *********************
?>