File manager - Edit - /home/autoph/public_html/connect/home/PRF/PRF_DASHBOARD_001.php
Back
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <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'; //$connect_error = 'Sorry, we\'re experiencing connection problem. Please try again later... Thank you!'; //mysql_connect('localhost','root','aee1024') or die ($connect_error); //mysql_select_db('db_vts') or die($connect_error); error_reporting(0); $compID= $_GET['secondPassComID']; $dateTime = $myDate . " ".$toTime; $myEmpID = $user_data['u_id']; $toDate = date_create() ->format("Y-m-d"); $daDate = explode('-',$toDate); $dasYear = $daDate[0]; //One $janS = $dasYear."-01-01"; $janE = $dasYear."-01-31"; $febS = $dasYear."-01-01"; $febE = $dasYear."-02-28"; $marS = $dasYear."-03-01"; $marE = $dasYear."-03-31"; $aprS = $dasYear."-04-01"; $aprE = $dasYear."-04-30"; $mayS = $dasYear."-05-01"; $mayE = $dasYear."-05-31"; $junS = $dasYear."-06-01"; $junE = $dasYear."-06-30"; $julS = $dasYear."-07-01"; $julE = $dasYear."-07-31"; $augS = $dasYear."-08-01"; $augE = $dasYear."-08-31"; $sepS = $dasYear."-09-01"; $sepE = $dasYear."-09-30"; $octS = $dasYear."-10-01"; $octE = $dasYear."-10-31"; $novS = $dasYear."-11-01"; $novE = $dasYear."-11-30"; $decS = $dasYear."-12-01"; $decE = $dasYear."-12-31"; if(isset($_POST['done'])){ //GROUP WIDE $getData = mysql_query("SELECT * FROM `prf_request_detl` WHERE `deleted` = 0 AND `item_status` < 10 and `item_status`!=0"); while($row=mysql_fetch_array($getData)){ $olddate = $row['date_created']; $endDate = $toDate; if($endDate != ""){ $myEndDate = strtotime($endDate); }else{ $myEndDate = time(); } $slaStart = strtotime($olddate); $datediff = $myEndDate - $slaStart; $totalCount = round($datediff / (60 * 60 * 24)); //$totalCount= round($datediff / (60 * 60 * 24)); echo $totalCount."<br>"; if($totalCount < 31){ $green = $green + 1; } if ($totalCount > 31 && $totalCount < 61){ $orange = $orange + 1; } if ($totalCount > 60 && $totalCount < 91){ $red = $red + 1; } if ($totalCount > 90){ $fullred = $fullred + 1; } $total = $green + $orange + $red + $fullred; } $EarlyCount = number_format(($green / $total * 100),2,'.',','); $MidCount = number_format(($orange / $total * 100),2,'.',','); $LateCount = number_format(($red / $total * 100),2,'.',','); $SuperLateCount = number_format(($fullred / $total * 100),2,'.',','); $forCanvass = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status`='4' AND `deleted` = 0"),0); $forApproval = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status`='5' AND `deleted` = 0 || `item_status`='6' AND `deleted` = 0"),0); $forDelivery = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status`='9' AND `deleted` = 0"),0); }else{ //GROUP WIDE $getData = mysql_query("SELECT * FROM `prf_request_detl` WHERE `deleted` = 0 AND `item_status` < 10 and `item_status`!=0"); while($row=mysql_fetch_array($getData)){ $olddate = $row['date_created']; $endDate = $toDate; if($endDate != ""){ $myEndDate = strtotime($endDate); }else{ $myEndDate = time(); } $slaStart = strtotime($olddate); $datediff = $myEndDate - $slaStart; $totalCount = round($datediff / (60 * 60 * 24)); //$totalCount= round($datediff / (60 * 60 * 24)); //echo $totalCount."<br>"; if($totalCount < 31){ $green = $green + 1; } if ($totalCount > 31 && $totalCount < 61){ $orange = $orange + 1; } if ($totalCount > 60 && $totalCount < 91){ $red = $red + 1; } if ($totalCount > 90){ $fullred = $fullred + 1; } $total = $green + $orange + $red + $fullred; } $EarlyCount = number_format(($green),2,'.',','); $MidCount = number_format(($orange),2,'.',','); $LateCount = number_format(($red),2,'.',','); $SuperLateCount = number_format(($fullred),2,'.',','); $forCanvass = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status`=4 AND `deleted` = 0"),0); $forApproval = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status`=5 AND `deleted` = 0 || `item_status`=6 AND `deleted` = 0"),0); $forDelivery = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status`=9 AND `deleted` = 0"),0); } ?> <script> //window.onload = function (){ //alert('test'); //LoadGraph(); //StopLoadGraph(); //} var idVar = setInterval(() => { LoadGraph(); }, 400); function StopLoadGraph() { clearInterval(idVar); } function LoadGraph() { CanvasJS.addColorSet("greenShades", [//colorSet Array "#2baeec", //lightblue "#fc712c", //orange "#93b0f9", //lightblue "#20ea4b", //green "#ef220b", //orange "#93b0f9", //lightblue "#ef9c5b", //orange "#55c05b", //green "#f19197" // red ]); CanvasJS.addColorSet("greenShadesB", [//colorSet Array "#05c80b", //green "#ef990b", //orange "#f19197", // red "#816ff2", // purple "#5fe4bc", // purple "#f37f05", // purple "#f30f92", // purple "#f1b2db", // purple "#ef220b", //orange "#ef9c5b", //orange "#55c05b", //green "#e84b8e", // red "#f5d823", // yellow "#f3d284", // yellow "#f9b5db", // purple "#f9c5ba", // purple "#93b0f9", //lightblue "#33b4f1" //lightblue ]); var options = { colorSet: "greenShadesB", title: { text: "ACTIVE REQUEST", fontFamily: "Yu Gothic", fontSize:18, fontWeight: "bold" }, subtitles: [{ fontFamily: "Yu Gothic Light", fontSize:12, text:"By Status" }], animationEnabled: false, animationDuration: 100, data: [{ type: "doughnut", startAngle: 40, toolTipContent: "<b>{label}</b>: {y}", showInLegend: "true", legendText: "{label}", indexLabelFontSize: 12, indexLabel: "{label} - {y}", dataPoints: [ { y: <?php echo $forCanvass;?>, label: "For Canvass"}, { y: <?php echo $forApproval;?>, label: "For Approval"}, { y: <?php echo $forDelivery;?>, label: "For Delivery"}, ] }] }; $("#activeSLA").CanvasJSChart(options); //================================= //================================= var options = { colorSet: "greenShades", title: { text: "COMPLIANCE RATE", fontFamily: "Yu Gothic", fontSize:16, fontWeight: "bold" }, subtitles: [{ fontFamily: "Yu Gothic Light", fontSize:12, text:"Turn-Around-Time" }], animationEnabled: false, animationDuration: 1500, backgroundColor: "#fff", data: [{ type: "stackedBar", startAngle: 40, toolTipContent: "<b>{label}</b>", showInLegend: "true", legendText: "AUTOHUB WIDE", indexLabelFontSize: 12, indexLabel: "{y}", dataPoints: [ { y: <?php echo $EarlyCount;?>, label: "1-30 Days"}, { y: <?php echo $MidCount;?>, label: "31-60 Days" }, { y: <?php echo $LateCount;?>, label: "61-90 Above" }, { y: <?php echo $SuperLateCount;?>, label: "91 Above" }, ] }] }; $("#slaAnalysis").CanvasJSChart(options); //STOCK INVENTORY ANALYSIS BY MODEL var options = { colorSet: "greenShades", animationEnabled: false, animationDuration: 2000, backgroundColor: "#fff", title: { text: "REQUEST SUMMARY", fontFamily: "Yu Gothic", fontSize:16, fontWeight: "bold" }, subtitles: [{ fontFamily: "Yu Gothic Light", fontSize:13, text:"By Company" }], data: [ { // Change type to "doughnut", "line", "splineArea", etc. area, stepLine,scatter, bubble , stackedColumn, stackedBar, stackedArea,stackedColumn100,doughnut type: "line", toolTipContent: "{label}", showInLegend: "true", legendText: "COMPANY", indexLabelFontSize: 10, indexLabel: "{y}", dataPoints: [ <?php if(isset($_POST['done'])){ $SearchTextEnd = mysql_escape_string($_POST['SearchTextEnd']); $SearchTextStart = mysql_escape_string($_POST['SearchTextStart']); $getDataA = mysql_query("SELECT * FROM `vts_company` WHERE 1 ORDER BY `comp_code` ASC"); $totalCountItem = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status` < 10 AND `item_status` != 0 AND `deleted`=0"),0); while($row=mysql_fetch_array($getDataA)){ $clCompID = $row['comp_id']; $countBrand = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `comp_id`='$clCompID' AND `item_status` < 10 AND `item_status` != 0 AND `deleted`=0"),0); $countBrandx = number_format((($countBrand /$totalCountItem) *100),2,'.',','); echo "{ label: \"".$row['comp_code']."\", y: ".$countBrand."},"; } }else{ $getDataA = mysql_query("SELECT * FROM `vts_company` WHERE 1 ORDER BY `comp_code` ASC"); $totalCountItem = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status` < 10 AND `item_status` != 0 AND `deleted`=0"),0); while($row=mysql_fetch_array($getDataA)){ $clCompID = $row['comp_id']; $countBrand = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `comp_id`='$clCompID' AND `item_status` < 10 AND `item_status` != 0 AND `deleted`=0"),0); $countBrandx = number_format((($countBrand /$totalCountItem) *100),2,'.',','); echo "{ label: \"".$row['comp_code']."\", y: ".$countBrand."},"; } } ?> //<?php echo "{ label: \"apple\", y: 10 },";?> //{ label: "orange", y: 15 }, //{ label: "banana", y: 25 }, //{ label: "mango", y: 30 }, //{ label: "grape", y: 28 } ] } ] }; //================================= $("#slaCount").CanvasJSChart(options); //============================================================= var chart = new CanvasJS.Chart("expenseData", { animationEnabled: true, theme: "light2", title:{ fontFamily: "Yu Gothic Light", fontSize:18, text: "EXPENSE SUMMARY" }, subtitles: [{ fontFamily: "Yu Gothic Light", fontSize:16, text:"<?php echo 'Year '.$dasYear;?>" }], data: [{ type: "column", indexLabelFontSize: 14, dataPoints: [ <?php $getCom=mysql_query("SELECT * FROM `vts_company` WHERE `comp_status`= 1"); while($eRow=mysql_fetch_array($getCom)){ $comCount=0; $comCount = mysql_result(mysql_query("SELECT SUM(invoice_amount) FROM `prf_request_detl` WHERE `deleted`=0 AND `po_code`!='' AND `comp_id`='".$eRow['comp_id']."'"),0); if($comCount ==''){$comCount=0;} echo "{ label: \"".$eRow['comp_code']."\", y: ".$comCount."},"; } ?> //{ y: 450 }, //{ y: 414}, //{ y: 520, indexLabel: "\u2191 highest",markerColor: "red", markerType: "triangle" }, //{ y: 460 }, //{ y: 450 }, //{ y: 500 }, //{ y: 480 }, //{ y: 480 }, //{ y: 410 , indexLabel: "\u2193 lowest",markerColor: "DarkSlateGrey", markerType: "cross" }, //{ y: 500 }, //{ y: 480 }, //{ y: 510 } ] }] }); chart.render(); //============================================================= StopLoadGraph(); }; </script> </head> <body> <div class='DashboardTileA'> <div class='DashboardTileCountA'> <?php include_once 'core/init.php'; protected_page(); $OBLADM = $user_data['OBL_ADM']; $userID=$user_data['u_id']; $comID=$user_data['company']; $unVerifyRequest = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status` < 4 AND `deleted`=0"),0); echo $unVerifyRequest; ?> </div> <div class='DashboardTileCountAA'> <div class='DashboardTileCountAb'> INCOMING </div> <div class='DashboardTileCountAbb'> View Details </div> </div> </div> <div class='DashboardTileB'> <div class='DashboardTileCountA'> <?php include_once 'core/init.php'; protected_page(); $OBLADM = $user_data['OBL_ADM']; $userID=$user_data['u_id']; $comID=$user_data['company']; $forCanvassItem = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status` = 4 AND `deleted`=0"),0); echo $forCanvassItem; ?> </div> <div class='DashboardTileCountAA'> <div class='DashboardTileCountAb'> FOR CANVASS </div> <div class='DashboardTileCountAbb'> View Details </div> </div> </div> <div class='DashboardTileD'> <div class='DashboardTileCountA'> <?php include_once 'core/init.php'; protected_page(); $OBLADM = $user_data['OBL_ADM']; $userID=$user_data['u_id']; $comID=$user_data['company']; $forPOItem = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status` = 9 AND `deleted`=0 "),0); echo $forPOItem; ?> </div> <div class='DashboardTileCountAA'> <div class='DashboardTileCountAb'> FOR DELIVERY </div> <div class='DashboardTileCountAbb'> View Details </div> </div> </div> <div class='DashboardTileC'> <div class='DashboardTileCountA'> <?php include_once 'core/init.php'; protected_page(); $OBLADM = $user_data['OBL_ADM']; $userID=$user_data['u_id']; $comID=$user_data['company']; $forPOItem = mysql_result(mysql_query("SELECT COUNT(id) FROM `prf_request_detl` WHERE `item_status` BETWEEN 5 AND 8 AND `deleted`=0"),0); echo $forPOItem; ?> </div> <div class='DashboardTileCountAA'> <div class='DashboardTileCountAb'> PO APPROVAL </div> <div class='DashboardTileCountAbb'> View Details </div> </div> </div> <!--#######################################################################################################################################--> <BR> <div style='border:0px solid red;width:100%;height:815px;min-height:600px;float:left;margin:5px;background:white'> <div style='vertical-align:top;height:55px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Yu Gothic;font-weight:normal;color:gray;font-size:30px;text-align:center'> <?php echo "PURCHASE REQUEST";?><br><br> </div> <div id="activeSLA" style="height: 370px; width: 40%;margin:5px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> <div id="slaAnalysis" style="height: 370px; width: 40%;margin:5px;border:0px solid gray;float:right;border-bottom:1px solid gray"></div> <div id="slaCount" style="background:#edfabe;height: 400px; width:100%;margin:5px;margin-top:50px;margin-bottom:50px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> <div id="expenseData" style="background:#fefce9;height:400px; width:100%;margin:5px;margin-top:50px;margin-bottom:50px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> </div> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings