Beach result

Detailed Analysis

[insert_php]

$username = “user”;
$password = “password”;
$hostname = “tokra.sapphire.gi”;
$dbh = mysql_connect($hostname, $username, $password) or die(“Unable to connect to MySQL”);
$selected = mysql_select_db(“dbenvironment”,$dbh) or die(“Could not select first_test”);

$mysql = “SELECT * FROM tblBeach WHERE BeachID=”.$_GET[‘beachid’];
$result = mysql_query($mysql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo $row{‘Beach’};
$ManColif =$row{‘ManColif_Value’};
$ManEcoli=$row{‘ManEcoli_Value’};
$ManFaecal=$row{‘ManFaecal_Value’};
$GuideColif=$row{‘GuideColif_Value’};
$GuideEcoli=$row{‘GuideEcoli_Value’};
$GuideFaecal=$row{‘GuideFaecal_Value’};
}

$ManColif_Result=0;
$ManEcoli_Result=0;
$ManFaecal_Result=0;
$GuideColif_Result=0;
$GuideEcoli_Result=0;
$GuideFaecal_Result=0;

[/insert_php]

Results For:


(To view previous results select the desired
year)

NB Where the laboratory has been unable to count the type of bacterial colonies the cells data is shown as blank

[insert_php]

if (isset($_POST[‘Resultyear’]))
{
$mysql3 = “SELECT *,UNIX_TIMESTAMP(Date) as resultdate FROM tblBeachResults WHERE year(Date)=”.$_POST[‘Resultyear’].” AND BeachID=”.$_GET[‘beachid’].” ORDER BY resultdate DESC”;
}
else
{
$mysql3 = “SELECT *,UNIX_TIMESTAMP(Date) as resultdate FROM tblBeachResults WHERE year(Date)=”.$mylatestyear.” AND BeachID=”.$_GET[‘beachid’].” ORDER BY resultdate DESC”;
}

$result2 = mysql_query($mysql3);
while ($row = mysql_fetch_array($result2,MYSQL_ASSOC))
{
$Colif_td_colour = “”;
$Ecoli_td_colour = “”;
$Faecal_td_colour = “”;

$mytable = $mytable.”

n”;
$mytable = $mytable.”

n”;

if (($row{‘Coliform’} >= $ManColif) && ($ManColif > 0))
{
$ManColif_Result=$ManColif_Result+1;
$Colif_td_colour = ” bgcolor=#FF3B57″;
}
if (($GuideColif <= $row{'Coliform'} && $row{'Coliform'} < $ManColif) && ($GuideColif > 0))
{
$GuideColif_Result=$GuideColif_Result+1;
$Colif_td_colour = ” bgcolor=#73C11A”;
}

if (($row{‘Ecoli’} >= $ManEcoli) && ($ManEcoli > 0))
{
$ManEcoli_Result=$ManEcoli_Result+1;
$Ecoli_td_colour = ” bgcolor=#FF3B57″;
}
if (($GuideEcoli <= $row{'Ecoli'} && $row{'Ecoli'} < $ManEcoli) && ($GuideEcoli > 0))
{
$GuideEcoli_Result=$GuideEcoli_Result+1;
$Ecoli_td_colour = ” bgcolor=#73C11A”;
}

if ($GuideFaecal <= $row{'Faecal'} ) { $GuideFaecal_Result=$GuideFaecal_Result+1; $Faecal_td_colour = " bgcolor=#73C11A"; } $mytable = $mytable."“.$row{‘Coliform’}.”

“;
$mytable = $mytable.”“.$row{‘Ecoli’}.”

“;
$mytable = $mytable.”“.$row{‘Faecal’}.”

“;

$mytable = $mytable.”

n”;

}
[/insert_php]

[insert_php]
$mysql = “SELECT * FROM tblBeach WHERE BeachID=”.$_GET[‘beachid’];
$result = mysql_query($mysql);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
[/insert_php]

[insert_php]
}

[/insert_php]

[insert_php]=$mytable[/insert_php]

Date TOTAL
COLIFORMS/100ml
E.COLI /100ml FAECAL
STREPTOCCUS /100ml
“.date(“j M Y”,$row{‘resultdate’}).”
MANDATORY STANDARD [insert_php]=$row{‘ManColif’}[/insert_php] [insert_php]=$row{‘ManEcoli’}[/insert_php] [insert_php]=$row{‘ManFaecal’}[/insert_php]
GUIDE VALUES [insert_php]=$row{‘GuideColif’}[/insert_php] [insert_php]=$row{‘GuideEcoli’}[/insert_php] [insert_php]=$row{‘GuideFaecal’}[/insert_php]
Failed Mandatory [insert_php]=$ManColif_Result[/insert_php] [insert_php]=$ManEcoli_Result[/insert_php] [insert_php]=$ManFaecal_Result[/insert_php]
Failed Guide [insert_php]=$GuideColif_Result+$ManColif_Result[/insert_php] [insert_php]=$GuideEcoli_Result+$ManEcoli_Result[/insert_php] [insert_php]=$GuideFaecal_Result+$ManFaecal_Result[/insert_php]