format("Y-m-d");
if(isset($_GET['Display'])){
$sYear = explode("-",$_GET['startYear']);
$eYear = explode("-",$_GET['endYear']);
$SactiveYear = $sYear[0];
$EactiveYear = $eYear[0];
$SactiveMon = $sYear[1];
$EactiveMon = $eYear[1];
$SactiveDay = $sYear[2];
$EactiveDay = $eYear[2];
$startDate = $_GET['startDate'];
$endDate = $_GET['endDate'];
$myLabel =$startDate. " - ".$endDate;
$getserviceData = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startDate' AND '$endDate'");
$getLoungeData = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startDate' AND '$endDate'");
//echo "AB";
}else{
//echo "A";
$cYear = explode("-",$toDate);
$activeYear = $cYear[0];
$startDate = $activeYear.'-01-01';
$endDate = $activeYear.'-12-31';
$myLabel =$startDate. " - ".$endDate;
$getserviceData = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startDate' AND '$endDate'");
$getLoungeData = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startDate' AND '$endDate'");
}
//echo $myLabel;
while($row=mysql_fetch_array($getserviceData)){
$counter = $counter + 1;
$Qa = $row['Qa'];
$Qb = $row['Qb'];
$Qc = $row['Qc'];
$Qd = $row['Qd'];
$Qe = $row['Qe'];
$Qf = $row['Qf'];
$Qg = $row['Qg'];
$Qh = $row['Qh'];
$Qi = $row['Qi'];
$Qaves = ($Qa + $Qb + $Qc + $Qd + $Qe + $Qf + $Qg + $Qh + $Qi) / 9;
if($Qaves < 5 ){
$Poor = $Poor + 1;
}
if($Qaves > 5 && $Qaves < 6){
$Fair = $Fair + 1;
}
if($Qaves >= 6 && $Qaves < 8){
$Good = $Good + 1;
}
if($Qaves > 8 && $Qaves < 9){
$VeryGood = $VeryGood + 1;
}
if($Qaves > 9){
$Outstanding = $Outstanding + 1;
}
}
$pooRating = number_format(($Poor / $counter * 100),2,'.',',');
$fairRating = number_format(($Fair / $counter * 100),2,'.',',');
$goodRating = number_format(($Good / $counter * 100),2,'.',',');
$vsRating = number_format(($VeryGood / $counter * 100),2,'.',',');
$outRating = number_format(($Outstanding / $counter * 100),2,'.',',');
//######################################################################################################
while($Crow=mysql_fetch_array($getLoungeData)){
$counter = $counter + 1;
$Qa = $Crow['Qa'];
$Qb = $Crow['Qb'];
$Qc = $Crow['Qc'];
$Qd = $Crow['Qd'];
$Qave = $Crow['score'];
if($Qave < 75 ){
$LPoor = $LPoor + 1;
}
if($Qave > 75 && $Qave < 81){
$LFair = $LFair + 1;
}
if($Qave > 80 && $Qave < 86){
$LGood = $LGood + 1;
}
if($Qave > 85 && $Qave < 91){
$LVeryGood = $LVeryGood + 1;
}
if($Qave > 90){
$LOutstanding = $LOutstanding + 1;
}
}
//echo $Qave . "-".$LPoor."-".$LFair."-".$LGood."-".$LVeryGood."-".$LOutstanding."
";
$LpooRating = number_format((($LPoor / $counter) * 100),2,'.',',');
$LfairRating = number_format((($LFair / $counter) * 100),2,'.',',');
$LgoodRating = number_format((($LGood / $counter) * 100),2,'.',',');
$LvsRating = number_format((($LVeryGood / $counter) * 100),2,'.',',');
$LoutRating = number_format((($LOutstanding / $counter) * 100),2,'.',',');
?>