File manager - Edit - /home/autoph/public_html/voc/home/dashboard.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> <?php include 'core/database/connect.php'; error_reporting(0); $toDate = date_create() ->format("Y/m/d"); if(isset($_POST['Display'])){ $brandName = mysql_real_escape_string($_POST['brandName']); $MyUserID = mysql_real_escape_string($_POST['MyUserID']); $UserCompanyName =mysql_real_escape_string($_POST['UserCompanyName']); $myCompanyID = mysql_result(mysql_query("SELECT `company` FROM `vts_users` WHERE `u_id`='$MyUserID'"),0); $userFName = mysql_result(mysql_query("SELECT `u_fname` FROM `vts_users` WHERE `u_id`='$MyUserID'"),0); $userLName = mysql_result(mysql_query("SELECT `u_lname` FROM `vts_users` WHERE `u_id`='$MyUserID'"),0); //echo "My Lastname is:" .$userLName; $myLabel = $brandName; $getData = mysql_query("SELECT * FROM `db_vehicle_inventory` WHERE `sold`='0' AND `returned`='0' AND `incoming_unit` = '0' AND `company`='$UserCompanyName' AND `brand`='$brandName'"); }else{ //GROUP WIDE $myLabel ="Autohub Wide"; $getData = mysql_query("SELECT * FROM `db_vehicle_inventory` WHERE `sold`='0' AND `returned`='0' AND `incoming_unit` = '0'"); } while($row=mysql_fetch_array($getData)){ $olddate = $row['date_received']; $now = time(); // or your date as well' $your_date = strtotime($olddate); $datediff = $now - $your_date; $totalCount= round($datediff / (60 * 60 * 24)); if($totalCount < 91){ $lessNinety = $lessNinety + 1; $lessNinetyAmount = $lessNinetyAmount + $row['price']; } if ($totalCount > 90 && $totalCount < 181){ $betweenNinetyOneEighty = $betweenNinetyOneEighty + 1; $betweenNinetyOneEightyAmount = $betweenNinetyOneEightyAmount + $row['price']; } if ($totalCount > 180 ){ $oldestUnit = $oldestUnit + 1; $oldestUnitAmount = $oldestUnitAmount + $row['price']; } $total = $oldestUnit + $lessNinety + $betweenNinetyOneEighty; $totalB = $lessNinetyAmount + $betweenNinetyOneEightyAmount + $oldestUnitAmount; } $EarlyCount = number_format(($lessNinety / $total * 100),2,'.',','); $MidCount = number_format(($betweenNinetyOneEighty / $total * 100),2,'.',','); $LateCount = number_format(($oldestUnit / $total * 100),2,'.',','); $EarlyCountB = number_format(($lessNinetyAmount / $totalB * 100),2,'.',','); $MidCountB = number_format(($betweenNinetyOneEightyAmount / $totalB * 100),2,'.',','); $LateCountB = number_format(($oldestUnitAmount / $totalB * 100),2,'.',','); ?> <script> window.onload = function () { var options = { title: { text: "UNIT AGING REPORT" }, subtitles: [{ text:"By Inventory" }], 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 $EarlyCountB;?>, label: "Below 90"}, { y: <?php echo $MidCountB;?>, label: "90-180 Days"}, { y: <?php echo $LateCountB;?>, label: "Above 180 days"}, ] }] }; $("#chartContainer").CanvasJSChart(options); //STOCK INVENTORY ANALYSIS BY MODEL var options = { animationEnabled: true, title: { text: "STOCK INVENTORY ANALYSIS" }, subtitles: [{ text:"By Brand" }], data: [ { // Change type to "doughnut", "line", "splineArea", etc. type: "column", toolTipContent: "<b>{label}</b>: Php{y}", showInLegend: "true", legendText: "AUTOHUB BRANDS", indexLabelFontSize: 12, indexLabel: "{y}", dataPoints: [ <?php $getDataA = mysql_query("SELECT DISTINCT(b_name) FROM `vts_brands` WHERE `b_status`='1' ORDER BY `b_name` ASC"); 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 } ] } ] }; //================================= $("#InventoryChart").CanvasJSChart(options); var options = { title: { text: "UNIT AGING REPORT" }, subtitles: [{ text:"By Amount" }], animationEnabled: true, data: [{ type: "bar", startAngle: 40, toolTipContent: "<b>{label}</b>: Php{y}", showInLegend: "true", legendText: "AUTOHUB BRANDS", indexLabelFontSize: 16, indexLabel: "{label} - {y}%", dataPoints: [ { y: <?php echo $EarlyCountB;?>, label: "<?php echo "Php ". number_format($lessNinetyAmount,2,'.',',');?>" }, { y: <?php echo $MidCountB;?>, label: "<?php echo "Php ". number_format($betweenNinetyOneEightyAmount,2,'.',',');?>" }, { y: <?php echo $LateCountB;?>, label: "<?php echo "Php " . number_format($oldestUnitAmount,2,'.',',');?>" }, ] }] }; $("#chartByPesovalue").CanvasJSChart(options); } </script> </head> <body> <div style="display:none;width:100%;position:relative;height:40px;background:yellow;padding:8px;" id="AccountActive">Account has been activated</div> <p style="text-align:left;font-weight:Bahnschrift Light;font-size:24px;font-weight:normal;padding:3px;margin:0px;">DASHBOARD VIEW</p><br> <div style='border:0px solid red;width:99%;height:815px;min-height:600px;float:left;margin:5px;min-width:600px;background:white'> <div style='vertical-align:top;height:55px;margin:0px;width:100%;border-bottom:1px solid gray;padding:5px;font-family:Verdana;font-weight:normal;color:red;font-size:30px;text-align:center'> <?php echo "UNIT AGING ANALYSIS - ".strtoupper($myLabel);?><br><br> <div style='float:right;font-family:Verdana;font-size:15px;'> <a href=' ' class='hideClick hidden' > ♲ </a><!--REFRESH/RELOAD WINDOW--> <a href=' ' class='hideClick hidden' > ✉ </a> <!--EXTRACT LIST OF COMPANY AND EXPORT TO EXCEL--> <a href='autohub.php?id=x&d=x' class='hideClick hidden' style='font-weight:bold'> ✕ </a> </div> </div> <div id="chartContainer" style="height: 370px; width: 40%;margin:5px;border:0px solid gray;float:left;border-bottom:1px solid gray"></div> <div id="chartByPesovalue" style="height: 370px; width: 40%;margin:5px;border:0px solid gray;float:right;border-bottom:1px solid gray"></div> <div id="InventoryChart" style="height: 400px; width: 90%;margin:5px;margin-top:100px;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