//set colour change for each row
$rowcolour=1;
//set table font size
$fontsize=2;
// 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");
$sql2 = new MySQL_class;
$sql2->Create("triumphstag_db");
$sql3 = new MySQL_class;
$sql3->Create("triumphstag_db");
$sql4 = new MySQL_class;
$sql4->Create("triumphstag_db");
echo("
");
//echo(" Listing all lost Stags
\n");
$sql1->Query("Select * from stagdata_where_are_they");
$totalentries = $sql1->rows;
Echo ("There are a total of $totalentries entries
");
//********************List the entries Wanted acording to Section **********************************
echo("Do you know anything about the history of these?
");
echo("");
echo("");
echo(" | ID | Contact | Registration | Comments | Click to Reply | Date Entered |
");
$sql->Query("SELECT * from stagdata_where_are_they order by $index");
for ($i = 0; $i < $sql->rows; $i++) {
$sql->Fetch($i);
$id = $sql->data[0];
$name= $sql->data[1];
$email= $sql->data[2];
$location= $sql->data[3];
// $country= $sql->data[4];
$registration=$sql->data[4];
$text=$sql->data[7];
$date = $sql->data[8];
$reg2= $sql->data[5];
$date1 = (date ("d F Y ",$date));
if ($date >(time() - 2592000)) {
$icon = "";
} else {
$icon="";
}
// get number of replies from replies table
$sql2->Query("Select * from stagdata_where_are_they_replies where id2='$id'");
$entryreply = $sql2->rows;
// now check the registry for a match
$sql3->query ("SELECT commnumber,concat(comprefix,commnumber,comsufix) as fullnum,stagpic from stagdata where regno = '$reg2' and regno <>'Not Given'");
$rows2 = $sql3->rows;
// check again on new field regno-previous (in other words on an older reg)
$sql4->query ("SELECT commnumber,concat(comprefix,commnumber,comsufix) as fullnum,stagpic from stagdata where regno_previous = '$reg2' and regno_previous <>'Not Given'");
$rows3 = $sql4->rows;
$entryreply1=$entryreply +$rows2+$rows3;
if ($entryreply1 >0) {
$replycolour='##0033FF';
}else{
$replycolour='#333333';
}
//look for registry matches
$regmatch="";
$regmatch1="";
$pic="";
$picture="";
if ($rows2==1) {
$sql3->Fetch(0);
$comm = $sql3->data[0];
$fullnum = $sql3->data[1];
$picture = $sql3->data[2];
$regmatch="** Registry Match Found see $fullnum **";
$regmatch1="+ Registry Match";
$picture=rawurlencode($picture);
// check for a picture
if (strlen($picture)>1) {
$pic = "
";
}else{
$pic="";
}
}
if ($rows3==1) {
$sql4->Fetch(0);
$comm = $sql4->data[0];
$fullnum = $sql4->data[1];
$regmatch="** Registry Match Found see $fullnum **";
$regmatch1="+ Registry Match";
// check for a picture
if (strlen($picture) > 1) {
$pic = "
";
}else{
$pic="";
}
}
//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 |
$name |
$registration |
$text $regmatch $pic |
Click to Reply or Read $entryreply replies $regmatch1 |
$date1 |
");
$pic="";
}
echo ("
");
echo("Click here to add your search (Stags only please)");
?>