File manager - Edit - /home/autoph/public_html/voc/home/FGP_dasboard_service_feedback.php
Back
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script> <script src="https://canvasjs.com/assets/script/jquery.canvasjs.min.js"></script> <script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script> <?php include 'core/database/connect.php'; error_reporting(0); $toDate = date_create() ->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']; $Qave = ($Qa + $Qb + $Qc + $Qd + $Qe + $Qf + $Qg + $Qh + $Qi) / 9; if($Qave < 5 ){ $Poor = $Poor + 1; } if($Qave > 5 && $Qave < 6){ $Fair = $Fair + 1; } if($Qave >= 6 && $Qave < 8){ $Good = $Good + 1; } if($Qave > 8 && $Qave < 9){ $VeryGood = $VeryGood + 1; } if($Qave > 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($row=mysql_fetch_array($getLoungeData)){ $counter = $counter + 1; $Qa = $row['Qa']; $Qb = $row['Qb']; $Qc = $row['Qc']; $Qd = $row['Qd']; $Qave = ($Qa + $Qb + $Qc + $Qd ) / 4; if($LQave < 5 ){ $LPoor = $LPoor + 1; } if($LQave > 5 && $LQave < 6){ $LFair = $LFair + 1; } if($LQave >= 6 && $LQave < 8){ $LGood = $LGood + 1; } if($LQave > 8 && $LQave < 9){ $LVeryGood = $LVeryGood + 1; } if($LQave > 9){ $LOutstanding = $LOutstanding + 1; } } $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,'.',','); ?> <script> window.onload = function () { var options = { title: { text: "SERVICE FEEDBACK" }, subtitles: [{ text:"<?php echo $myLabel;?>" }], animationEnabled: true, data: [{ type: "pie", startAngle: 40, toolTipContent: "<b>{label}</b>: {y}%", showInLegend: "true", legendText: "{label}", indexLabelFontSize: 16, indexLabel: "{label} - {y}%", dataPoints: [ { y: <?php echo $pooRating;?>, label: "Poor"}, { y: <?php echo $fairRating;?>, label: "Fair"}, { y: <?php echo $goodRating;?>, label: "Very Good"}, { y: <?php echo $vsRating;?>, label: "Excellent"}, { y: <?php echo $outRating;?>, label: "Outstanding "}, ] }] }; $("#serviceContainer").CanvasJSChart(options); //################################################################################### var options = { title: { text: "LOUNGE AREA" }, subtitles: [{ text:"<?php echo $myLabel;?>" }], animationEnabled: true, data: [{ type: "pie", startAngle: 40, toolTipContent: "<b>{label}</b>: {y}%", showInLegend: "true", legendText: "{label}", indexLabelFontSize: 16, indexLabel: "{label} - {y}%", dataPoints: [ { y: <?php echo $LpooRating;?>, label: "Poor"}, { y: <?php echo $LfairRating;?>, label: "Fair"}, { y: <?php echo $LgoodRating;?>, label: "Very Good"}, { y: <?php echo $LvsRating;?>, label: "Excellent"}, { y: <?php echo $LoutRating;?>, label: "Outstanding "}, ] }] }; $("#loungeContainer").CanvasJSChart(options); //##################################################################################################################### var options = { animationEnabled: true, title: { text: "YTD SERVICE FEEDBACK" }, subtitles: [{ text:"<?php echo $myLabel;?>" }], data: [ { // Change type to "doughnut", "line", "splineArea", etc. type: "column", toolTipContent: "<b>{label}</b>: {y}", showInLegend: "true", legendText: "COMPANY WIDE", indexLabelFontSize: 12, indexLabel: "{y}", dataPoints: [ <?php //$cuYear =Explode(":", date('H:i:s')); $cYear = explode("-",$toDate); $activeYear = $cYear[0]; $months = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); foreach ($months as $month) { switch ($month){ case 'Jan': $startMonthQ = $activeYear.'-01-01'; $endMonthQ = $activeYear.'-01-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Feb': $startMonthQ = $activeYear.'-02-01'; $endMonthQ = $activeYear.'-02-29'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Mar': $startMonthQ = $activeYear.'-03-01'; $endMonthQ = $activeYear.'-03-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Apr': $startMonthQ = $activeYear.'-04-01'; $endMonthQ = $activeYear.'-04-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'May': $startMonthQ = $activeYear.'-05-01'; $endMonthQ = $activeYear.'-05-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Jun': $startMonthQ = $activeYear.'-06-01'; $endMonthQ = $activeYear.'-06-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Jul': $startMonthQ = $activeYear.'-07-01'; $endMonthQ = $activeYear.'-07-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Aug': $startMonthQ = $activeYear.'-08-01'; $endMonthQ = $activeYear.'-08-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Sep': $startMonthQ = $activeYear.'-09-01'; $endMonthQ = $activeYear.'-09-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Oct': $startMonthQ = $activeYear.'-10-01'; $endMonthQ = $activeYear.'-10-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Nov': $startMonthQ = $activeYear.'-11-01'; $endMonthQ = $activeYear.'-11-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Dec': $startMonthQ = $activeYear.'-12-01'; $endMonthQ = $activeYear.'-12-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonthQ' AND '$endMonthQ'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; } //$countData = $countData + 1; } //while($row=mysql_fetch_array($getDataA)){ //$aBrand = $row['b_name']; //$countBrand = mysql_result(mysql_query("SELECT COUNT(id) FROM `db_vehicle_inventory` WHERE `sold`=0 AND `returned`=0 AND `brand`='$aBrand' "),0); //echo "{ label: \"".$aBrand."\", y: ".$countBrand."},"; //} ?> //<?php echo "{ label: \"apple\", y: 10 },";?> //{ label: "orange", y: 15 }, //{ label: "banana", y: 25 }, //{ label: "mango", y: 30 }, //{ label: "grape", y: 28 } ] } ] }; //================================= $("#serviceChart").CanvasJSChart(options); //##################################################################################################################### var options = { animationEnabled: true, title: { text: "YTD LOUNGE FEEDBACK" }, subtitles: [{ text:"<?php echo $myLabel;?>" }], data: [ { // Change type to "doughnut", "line", "splineArea", etc. type: "column", toolTipContent: "<b>{label}</b>: {y}", showInLegend: "true", legendText: "Yearly", indexLabelFontSize: 12, indexLabel: "{y}", dataPoints: [ <?php //$cuYear =Explode(":", date('H:i:s')); $cYear = explode("-",$toDate); $activeYear = $cYear[0]; $months = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); foreach ($months as $month) { switch ($month){ case 'Jan': $startMonth = $activeYear.'-01-01'; $endMonth = $activeYear.'-01-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Feb': $startMonth = $activeYear.'-02-01'; $endMonth = $activeYear.'-02-29'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Mar': $startMonth = $activeYear.'-03-01'; $endMonth = $activeYear.'-03-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Apr': $startMonth = $activeYear.'-04-01'; $endMonth = $activeYear.'-04-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'May': $startMonth = $activeYear.'-05-01'; $endMonth = $activeYear.'-05-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Jun': $startMonth = $activeYear.'-06-01'; $endMonth = $activeYear.'-06-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Jul': $startMonth = $activeYear.'-07-01'; $endMonth = $activeYear.'-07-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Aug': $startMonth = $activeYear.'-08-01'; $endMonth = $activeYear.'-08-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Sep': $startMonth = $activeYear.'-09-01'; $endMonth = $activeYear.'-09-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Oct': $startMonth = $activeYear.'-10-01'; $endMonth = $activeYear.'-10-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Nov': $startMonth = $activeYear.'-11-01'; $endMonth = $activeYear.'-11-30'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; case 'Dec': $startMonth = $activeYear.'-12-01'; $endMonth = $activeYear.'-12-31'; $countData = mysql_result(mysql_query("SELECT COUNT(id) FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"),0); echo "{ label: \"".$month."\", y: ".$countData."},"; break; } //$countData = $countData + 1; } //while($row=mysql_fetch_array($getDataA)){ //$aBrand = $row['b_name']; //$countBrand = mysql_result(mysql_query("SELECT COUNT(id) FROM `db_vehicle_inventory` WHERE `sold`=0 AND `returned`=0 AND `brand`='$aBrand' "),0); //echo "{ label: \"".$aBrand."\", y: ".$countBrand."},"; //} ?> //<?php echo "{ label: \"apple\", y: 10 },";?> //{ label: "orange", y: 15 }, //{ label: "banana", y: 25 }, //{ label: "mango", y: 30 }, //{ label: "grape", y: 28 } ] } ] }; //================================= $("#loungeChart").CanvasJSChart(options); //##################################################################################################################### var chart = new CanvasJS.Chart("lineMonthly", { animationEnabled: true, theme: "light2", title:{ text: "SCORE (%)" }, data: [{ type: "line", indexLabelFontSize: 16, dataPoints: [ <?php //$cuYear =Explode(":", date('H:i:s')); $cYear = explode("-",$toDate); $activeYear = $cYear[0]; $months = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); foreach ($months as $month) { $countData = 0; $dbcounter = 0; $dbSum = 0; switch ($month){ case 'Jan': $startMonth = $activeYear.'-01-01'; $endMonth = $activeYear.'-01-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Feb': $startMonth = $activeYear.'-02-01'; $endMonth = $activeYear.'-02-29'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Mar': $startMonth = $activeYear.'-03-01'; $endMonth = $activeYear.'-03-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Apr': $startMonth = $activeYear.'-04-01'; $endMonth = $activeYear.'-04-30'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'May': $startMonth = $activeYear.'-05-01'; $endMonth = $activeYear.'-05-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Jun': $startMonth = $activeYear.'-06-01'; $endMonth = $activeYear.'-06-30'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Jul': $startMonth = $activeYear.'-07-01'; $endMonth = $activeYear.'-07-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Aug': $startMonth = $activeYear.'-08-01'; $endMonth = $activeYear.'-08-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Sep': $startMonth = $activeYear.'-09-01'; $endMonth = $activeYear.'-09-30'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Oct': $startMonth = $activeYear.'-10-01'; $endMonth = $activeYear.'-10-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Nov': $startMonth = $activeYear.'-11-01'; $endMonth = $activeYear.'-11-30'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Dec': $startMonth = $activeYear.'-12-01'; $endMonth = $activeYear.'-12-31'; $getDat = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; } //$countData = $countData + 1; } //while($row=mysql_fetch_array($getDataA)){ //$aBrand = $row['b_name']; //$countBrand = mysql_result(mysql_query("SELECT COUNT(id) FROM `db_vehicle_inventory` WHERE `sold`=0 AND `returned`=0 AND `brand`='$aBrand' "),0); //echo "{ label: \"".$aBrand."\", y: ".$countBrand."},"; //} ?> ] }] }); chart.render(); //##################################################################################################################### var chart = new CanvasJS.Chart("lineMonthlyLounge", { animationEnabled: true, theme: "light1", title:{ text: "SCORE (%)" }, data: [{ type: "line", indexLabelFontSize: 16, dataPoints: [ <?php //$cuYear =Explode(":", date('H:i:s')); $cYear = explode("-",$toDate); $activeYear = $cYear[0]; $months = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); foreach ($months as $month) { $countData = 0; $dbcounter = 0; $dbSum = 0; switch ($month){ case 'Jan': $startMonth = $activeYear.'-01-01'; $endMonth = $activeYear.'-01-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Feb': $startMonth = $activeYear.'-02-01'; $endMonth = $activeYear.'-02-29'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Mar': $startMonth = $activeYear.'-03-01'; $endMonth = $activeYear.'-03-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Apr': $startMonth = $activeYear.'-04-01'; $endMonth = $activeYear.'-04-30'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'May': $startMonth = $activeYear.'-05-01'; $endMonth = $activeYear.'-05-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Jun': $startMonth = $activeYear.'-06-01'; $endMonth = $activeYear.'-06-30'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Jul': $startMonth = $activeYear.'-07-01'; $endMonth = $activeYear.'-07-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Aug': $startMonth = $activeYear.'-08-01'; $endMonth = $activeYear.'-08-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Sep': $startMonth = $activeYear.'-09-01'; $endMonth = $activeYear.'-09-30'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Oct': $startMonth = $activeYear.'-10-01'; $endMonth = $activeYear.'-10-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Nov': $startMonth = $activeYear.'-11-01'; $endMonth = $activeYear.'-11-30'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; case 'Dec': $startMonth = $activeYear.'-12-01'; $endMonth = $activeYear.'-12-31'; $getDat = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startMonth' AND '$endMonth'"); while($xRow = mysql_fetch_array($getDat)){ $dbcounter = $dbcounter + 1; $dbSum = $dbSum + $xRow['score']; $countData = number_format(($dbSum / $dbcounter),2,'.',',') ; } echo "{ label: \"".$month."\", y: ".$countData."},"; $countData = 0; $dbcounter = 0; $dbSum = 0; break; } //$countData = $countData + 1; } //while($row=mysql_fetch_array($getDataA)){ //$aBrand = $row['b_name']; //$countBrand = mysql_result(mysql_query("SELECT COUNT(id) FROM `db_vehicle_inventory` WHERE `sold`=0 AND `returned`=0 AND `brand`='$aBrand' "),0); //echo "{ label: \"".$aBrand."\", y: ".$countBrand."},"; //} ?> ] }] }); chart.render(); //##################################################################################################################### } </script> </head> <body> <div class="container" style='width:100%'> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#menu1">VEHICLE SERVICE</a></li> <li><a data-toggle="tab" href="#menu2">CUSTOEMR LOUNGE</a></li> </ul> <div class="tab-content" style='width:100%'> <div id="menu1" class="tab-pane fade in active" style='width:100%'> <div style='float:left;border:1px solid lightgray;width:100%;height:520px;float:left;margin:5px;min-width:600px;background:white'> <div id="serviceContainer" style="height:500px; width: 49%;margin:5px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> <div id="serviceChart" style="height:500px; width: 49%;margin:5px;margin-top:0px;margin-bottom:50px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> </div> <div style='float:left;width:100%;margin:5px;margin-top:50px;margin-bottom:20px;background:white;border:1px solid lightgray;height:530px;padding:10px'> <h2 style='margin:10px;font-family: Yu Gothic Light'>YOUR MONTHLY PERFORMANCE</h2> <div id="lineMonthly" style="height:450px; width:100%;margin:5px;margin-top:0px;margin-bottom:50px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> </div> <div style='float:left;width:100%;margin:5px;margin-top:50px;margin-bottom:20px;background:lightgray;border:1px solid gray;height:605px;padding:1px'> <h2 style='margin:10px;margin-bottom:2px;font-family: Yu Gothic Light'>SUMMARY LIST</h2> <div style='float:left;width:100%;margin:0px;margin-top:10px;margin-bottom:20px;background:white;border:1px solid gray;height:545px;padding:0px'> <div style='width:100%;margin:0px;margin-top:0px;margin-bottom:0px;background:white;border:0px solid gray;height:45px;padding:0px'> <table style='width:100%'> <thead> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>REC #</th> <th style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>DATE</th> <th style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>CS/PLATE</th> <th style='padding:7px;width:20%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>CUST. NAME</th> <th style='padding:7px;width:15%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>DEALER</th> <th style='padding:7px;width:20%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>SC NAME</th> <th style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>SERVICE DATE</th> <th style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>SCORE</th> </th> </table> </div> <div style='width:100%;margin:0px;margin-top:0px;margin-bottom:00px;background:white;border:0px solid gray;height:485px;padding:2px;overflow:vertical'> <table style='width:100%'> <?php $getServiceFB = mysql_query("SELECT * FROM `fgp_survey_db` WHERE `status`=0 AND `date` BETWEEN '$startDate' AND '$endDate' ORDER BY `date` DESC"); while($row = mysql_fetch_array($getServiceFB)){ echo "<tr>"; echo "<td style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw'>".$row['id']."</td>"; echo "<td style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw'>".$row['date']."</td>"; echo "<td style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw'>".$row['cs_plate']."</td>"; echo "<td style='padding:7px;width:20%;font-family:Yu Gothic Light;font-size:1vw'>".$row['custName']."</td>"; echo "<td style='padding:7px;width:15%;font-family:Yu Gothic Light;font-size:1vw'>".$row['dealer']."</td>"; echo "<td style='padding:7px;width:20%;font-family:Yu Gothic Light;font-size:1vw'>".$row['saName']."</td>"; echo "<td style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw'>".$row['saDate']."</td>"; echo "<td style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw'>"; $dQa = $row['Qa']; $dQb = $row['Qb']; $dQc = $row['Qc']; $dQd = $row['Qd']; $dQe = $row['Qe']; $dQf = $row['Qf']; $dQg = $row['Qg']; $dQh = $row['Qh']; $dQi = $row['Qi']; $dQave = number_format((($dQa + $dQb + $dQc + $dQd + $dQe + $dQf + $dQg + $dQh + $dQi) / 9),2,'.',','); echo $dQave ."%"; echo"</td>"; echo "</tr>"; } ?> </table> </div> </div> </div> </div> <div id="menu2" class="tab-pane fade in active" style='width:100%;margin:0px;padding:0px'> <div style='float:left;border:1px solid lightgray;width:100%;height:520px;float:left;margin:5px;min-width:600px;background:white'> <div id="loungeContainer" style="height:500px; width:49%;margin:5px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> <div id="loungeChart" style="height:500px; width:49%;margin:5px;margin-top:0px;margin-bottom:50px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> </div> <div style='float:left;width:100%;margin:5px;margin-top:50px;margin-bottom:20px;background:white;border:1px solid lightgray;height:530px;padding:10px'> <h2 style='margin:10px;font-family: Yu Gothic Light'>YOUR MONTHLY PERFORMANCE</h2> <div id="lineMonthlyLounge" style="height:450px; width:100%;margin:5px;margin-top:0px;margin-bottom:50px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> </div> <div style='float:left;width:100%;margin:5px;margin-top:50px;margin-bottom:20px;background:lightgray;border:1px solid gray;height:620px;padding:1px'> <h2 style='margin:10px;font-family: Yu Gothic Light'>SUMMARY LIST</h2> <div style='float:left;width:100%;margin:0px;margin-top:10px;margin-bottom:20px;background:white;border:1px solid gray;height:515px;padding:0px'> <div style='width:100%;margin:0px;margin-top:0px;margin-bottom:0px;background:white;border:0px solid gray;height:50px;padding:0px'> <table style='width:100%'> <thead> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>REC #</th> <th style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>DATE</th> <th style='padding:7px;width:10%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>DEALER</th> <th style='padding:7px;width:50%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>CUST. NAME</th> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>Q1</th> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>Q2</th> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>Q3</th> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>Q4</th> <th style='padding:7px;width:5%;font-family:Yu Gothic Light;font-size:1vw;background:gray;color:white'>SCORE</th> </th> </table> </div> <div style='width:100%;margin:0px;margin-top:0px;margin-bottom:00px;background:white;border:0px solid gray;height:500px;padding:2px;overflow:vertical'> <table style='width:100%'> <?php $getServiceFB = mysql_query("SELECT * FROM `fgp_lounge_db` WHERE `date` BETWEEN '$startDate' AND '$endDate' ORDER BY `date` DESC"); while($row = mysql_fetch_array($getServiceFB)){ echo "<tr>"; echo "<td style='padding:7px;width:5%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw'>".$row['id']."</td>"; echo "<td style='padding:7px;width:10%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw'>".$row['date']."</td>"; echo "<td style='padding:7px;width:10%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw;text-align:left'>".$row['dealer']."</td>"; echo "<td style='padding:7px;width:50%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw'>".$row['custName']."</td>"; echo "<td style='padding:7px;width:5%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw;text-align:center'>".$row['Qa']."</td>"; echo "<td style='padding:7px;width:5%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw;text-align:center'>".$row['Qb']."</td>"; echo "<td style='padding:7px;width:5%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw;text-align:center'>".$row['Qc']."</td>"; echo "<td style='padding:7px;width:5%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw;text-align:center'>".$row['Qd']."</td>"; echo "<td style='padding:7px;width:5%;border:0px solid gray;font-family:Yu Gothic Light;font-size:1vw;text-align:right'>".number_format(($row['score']),2,'.',',')."%</td>"; echo "</tr>"; } ?> </table> </div> </div> </div> </div> </div> </div> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings