/
home
/
sjslayjy
/
public_html
/
scm
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Dashboard'); ?> <?php $__env->startSection('style'); ?> <?php echo e(Html::style("//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css")); ?> <style type="text/css"> h4{ font-weight: bold; font-size:14px; } .onhover:hover{ transform: scale(1.05); box-shadow: 0 10px 20px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06); cursor:pointer; } .fy{ height: 23px; font-size: 11px; float: right; margin-top: 10px; } .wmq{ display: flex; justify-content: center; align-items: center;" } .topbox{ display:flex; justify-content: flex-start; } .card1{ border: 1px solid #ddd; border-radius: 4px; padding-bottom: 257px; } /*div{*/ /* border:1px solid red;*/ /*}*/ /*style="padding:0px;margin:0px;"*/ </style> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="page-content"> <div class="row"> <div class="col-md-2"> <select class="form-control" id="session_top" onchange="handleSession(this)"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="col-md-2"> <select class="form-control" onchange="handleQuarter(this)"> <option>Select Quarter</option> <option value="1">Quarter I</option> <option value="2">Quarter II</option> <option value="3">Quarter III</option> <option value="4">Quarter IV</option> </select> </div> </div> <div class="row" style="padding:5px;padding-botton:2px;"> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#72C6EF,#004E8F);opacity:0.9"> <div class="caption text-center" onclick="generateExcel('open_pr_count')"> <h4>Open PR Count</h4> <h4 class="text-warning" id="open_pr_count"><?php echo e($open_pr_count); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#ffe259,#ffa751);opacity:0.9;"> <div class="caption text-center hover-clickable" onclick="generateExcel('total_pr_count')"> <h4>Total PR Count</h4> <h4 class="text-warning" id="total_pr_count"><?php echo e($total_pr_count); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#D31027,#EA384D);opacity:0.9;" onclick="generateExcel('total_un_app_pr_count')"> <div class="caption text-center"> <h4>Un-App PR Count</h4> <h4 class="text-warning" id="up_app_pr_count"><?php echo e($total_un_app_pr_count); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#DA22FF,#9733EE);opacity:0.9;"> <div class="caption text-center"> <h4>Total PR Amount</h4> <h4 class="text-warning" id="total_pr_amount"><?php echo e($total_pr_amount); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#EDE574,#E1F5C4);opacity:0.9;"> <div class="caption text-center"> <h4>MRN/PO Count</h4> <h4 class="text-warning" id="mrn_by_po_count"><?php echo e($total_mrn_count); ?> (<?php echo e($mrn_by_po_count); ?>%)</h4> </div> </div> </div> <!--second row--> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#FF512F,#F09819);opacity:0.9;" onclick="generateExcel('open_po_count')"> <div class="caption text-center"> <h4>Open PO Count</h4> <h4 class="text-warning"><?php echo e($open_po_count); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover" style="background: linear-gradient(#D70652,#FF025E);opacity:0.9;"> <div class="caption text-center"> <h4>Total PO Count</h4> <h4 class="text-warning"><?php echo e($total_po_count); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover"> <div class="caption text-center"> <h4>Un-App PO Count</h4> <h4 class="text-warning"><?php echo e($total_un_app_po_count); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover"> <div class="caption text-center"> <h4>Total PO Amount</h4> <h4 class="text-warning"><?php echo e($total_po_amount); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover"> <div class="caption text-center"> <h4>Total MRN Amt.</h4> <h4 class="text-warning"><?php echo e($total_mrn_amount); ?></h4> </div> </div> </div> <div class="col-sm-6 col-md-2"> <div class="thumbnail onhover"> <div class="caption text-center"> <h4>Total Suppliers</h4> <h4 class="text-warning"><?php echo e($total_supliers); ?></h4> </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="card1"> <div class="row" style="padding: 0px 7px;"> <div class="col-sm-9"> <h4>Total Purchase w.r.t Item Category</h4> </div> <div class="col-sm-3"> <select class="fy" id="item_cat_fy" onchange="assign_null('item_cat_fy'); po_itemCategoryWise(this.val)"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row" style="padding: 6px 7px;"> <div class="col-sm-4 wmq"> <input type="week" name="week" id="item_cat_week" min="2021-W12" onchange="assign_null('item_cat_week'); po_itemCategoryWise(this.val);" style="height: 23px;font-size: 11px"> </div> <div class="col-sm-4 wmq"> <select id="item_cat_month" name="month" style="height: 23px;font-size: 11px;" onchange="assign_null('item_cat_month'); po_itemCategoryWise(this.val)"> <option value="">Select Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> <div class="col-sm-4 wmq"> <select id="item_cat_quarterly" name="quarterly" style="height: 23px;font-size: 11px;margin-right:8px" onchange="assign_null('item_cat_quarterly'); po_itemCategoryWise(this.val)"> <option value="">Select Quarterly</option> <option value="1">Quarter 1</option> <option value="2">Quarter 2</option> <option value="3">Quarter 3</option> <option value="4">Quarter 4</option> </select> </div> </div> <div class="row" style="margin-top:7px;"> <div class="col-sm-12"> <div id="pieChart1" style="width: 100%;"></div> </div> </div> </div> </div> <div class="col-md-4"> <div class="card1"> <div class="row" style="padding: 0px 7px;"> <div class="col-sm-9"> <h4>Total Purchase w.r.t Department</h4> </div> <div class="col-sm-3"> <select class="fy" id="department_fy" onchange="assign_null_department('department_fy'); po_department(this.val)"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row" style="padding: 6px 7px;"> <div class="col-sm-4 wmq"> <input type="week" name="week" id="department_week" min="2021-W12" onchange="assign_null_department('department_week'); po_department(this.val);" style="height: 23px;font-size: 11px"> </div> <div class="col-sm-4 wmq"> <select id="department_month" name="month" style="height: 23px;font-size: 11px;" onchange="assign_null_department('department_month'); po_department(this.val)"> <option value="">Select Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> <div class="col-sm-4 wmq"> <select id="department_quarterly" name="quarterly" style="height: 23px;font-size: 11px;margin-right:8px" onchange="assign_null_department('department_quarterly'); po_department(this.val)"> <option value="">Select Quarterly</option> <option value="1">Quarter 1</option> <option value="2">Quarter 2</option> <option value="3">Quarter 3</option> <option value="4">Quarter 4</option> </select> </div> </div> <div class="row" style="margin-top:7px;"> <div class="col-sm-12"> <div id="pieChart2" style="width: 100%;"></div> </div> </div> </div> </div> <div class="col-md-4"> <div class="card1"> <div class="row" style="padding: 0px 7px;"> <div class="col-sm-9"> <h4>Total Purchase w.r.t Circle</h4> </div> <div class="col-sm-3"> <select class="fy" id="circle_fy" onchange="assign_null_circle('circle_fy'); po_circle(this.val)"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row" style="padding: 6px 7px;"> <div class="col-sm-4 wmq"> <input type="week" name="week" id="circle_week" min="2021-W12" onchange="assign_null_circle('circle_week'); po_circle(this.val);" style="height: 23px;font-size: 11px"> </div> <div class="col-sm-4 wmq"> <select id="circle_month" name="month" style="height: 23px;font-size: 11px;" onchange="assign_null_circle('circle_month'); po_circle(this.val)"> <option value="">Select Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> <div class="col-sm-4 wmq"> <select id="circle_quarterly" name="quarterly" style="height: 23px;font-size: 11px;margin-right:8px" onchange="assign_null_circle('circle_quarterly'); po_circle(this.val)"> <option value="">Select Quarterly</option> <option value="1">Quarter 1</option> <option value="2">Quarter 2</option> <option value="3">Quarter 3</option> <option value="4">Quarter 4</option> </select> </div> </div> <div class="row" style="margin-top:7px;"> <div class="col-sm-12"> <div id="pieChart3" style="width: 100%;"></div> </div> </div> </div> </div> </div> <div class="row" style="margin-top: 23px;"> <div class="col-md-4"> <div class="card1"> <div class="row" style="padding: 0px 7px;"> <div class="col-sm-9"> <h4>Top 5 Suppliers</h4> </div> <div class="col-sm-3"> <select class="fy" id="supplier_fy" onchange="assign_null_supplier('supplier_fy'); po_supplierWise()"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row" style="padding: 6px 7px;"> <div class="col-sm-4 wmq"> <input type="week" name="week" id="supplier_week" min="2021-W12" onchange="assign_null_supplier('supplier_week'); po_supplierWise();" style="height: 23px;font-size: 11px"> </div> <div class="col-sm-4 wmq"> <select id="supplier_month" name="month" style="height: 23px;font-size: 11px;" onchange="assign_null_supplier('supplier_month'); po_supplierWise()"> <option value="">Select Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> <div class="col-sm-4 wmq"> <select id="supplier_quarterly" name="quarterly" style="height: 23px;font-size: 11px;margin-right:8px" onchange="assign_null_supplier('supplier_quarterly'); po_supplierWise()"> <option value="">Select Quarterly</option> <option value="1">Quarter 1</option> <option value="2">Quarter 2</option> <option value="3">Quarter 3</option> <option value="4">Quarter 4</option> </select> </div> </div> <div class="row" style="margin-top:7px;"> <div class="col-sm-12"> <div id="barChart1" style="width: 100%;"></div> </div> </div> </div> </div> <div class="col-md-4"> <div class="card1"> <div class="row" style="padding: 0px 7px;"> <div class="col-sm-9"> <h4>Top 5 Items</h4> </div> <div class="col-sm-3"> <select class="fy" id="item_fy" onchange="assign_null_supplier('supplier_fy'); po_itemWise()"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row" style="padding: 6px 7px;"> <div class="col-sm-4 wmq"> <input type="week" name="week" id="item_week" min="2021-W12" onchange="assign_null_supplier('supplier_week'); po_itemWise();" style="height: 23px;font-size: 11px"> </div> <div class="col-sm-4 wmq"> <select id="item_month" name="month" style="height: 23px;font-size: 11px;" onchange="assign_null_supplier('supplier_month'); po_itemWise()"> <option value="">Select Month</option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> <div class="col-sm-4 wmq"> <select id="item_quarterly" name="quarterly" style="height: 23px;font-size: 11px;margin-right:8px" onchange="assign_null_supplier('supplier_quarterly'); po_itemWise()"> <option value="">Select Quarterly</option> <option value="1">Quarter 1</option> <option value="2">Quarter 2</option> <option value="3">Quarter 3</option> <option value="4">Quarter 4</option> </select> </div> </div> <div class="row" style="margin-top:7px;"> <div class="col-sm-12"> <div id="barChart2" style="width: 100%;"></div> </div> </div> </div> </div> <div class="col-md-4"> <div class="card1"> <div class="row" style="padding: 0px 7px;"> <div class="col-sm-9"> <h4>Purchase Analysis</h4> </div> <div class="col-sm-3"> <select class="fy" id="item_fy" onchange="assign_null_supplier('supplier_fy'); po_itemWise()"> <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $session): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($session->session); ?>">FY <?php echo e($session->session); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="row" style="margin-top:7px;"> <div class="col-md-12"> <div id="slineChart" style="width: 100%;"></div> </div> </div> </div> </div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <?php $__env->startSection('script'); ?> <?php echo e(Html::script("https://code.jquery.com/ui/1.12.1/jquery-ui.js")); ?> <?php echo e(Html::script("assets/js/jquery-ui.custom.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.ui.touch-punch.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.easypiechart.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.sparkline.index.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.flot.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.flot.pie.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.flot.resize.min.js")); ?> <!-- ace scripts --> <?php echo e(Html::script("assets/js/ace-elements.min.js")); ?> <?php echo e(Html::script("assets/js/ace.min.js")); ?> <script src="https://www.amcharts.com/lib/4/core.js"></script> <script src="https://www.amcharts.com/lib/4/charts.js"></script> <script src="https://www.amcharts.com/lib/4/themes/animated.js"></script> <script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script> <script type="text/javascript"> po_itemCategoryWise(); po_department(); po_circle(); po_supplierWise(); po_itemWise(); purchase_analysis(); /*---------Category Start----------*/ function assign_null(id){ if(id=="item_cat_week"){ $("#item_cat_month").val(''); $("#item_cat_quarterly").val(''); } if(id=="item_cat_month"){ $("#item_cat_week").val(''); $("#item_cat_quarterly").val(''); } if(id=="item_cat_quarterly"){ $("#item_cat_week").val(''); $("#item_cat_month").val(''); } if(id=="item_cat_fy"){ $("#item_cat_week").val(''); $("#item_cat_month").val(''); $("#item_cat_quarterly").val(''); } } function po_itemCategoryWise() { var data = {}; data.item_cat_fy = $("#item_cat_fy").val(); data.item_cat_week = $("#item_cat_week").val(); data.item_cat_month = $("#item_cat_month").val(); data.item_cat_quarterly = $("#item_cat_quarterly").val(); data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); data.type = 'po_categoryWise'; $.ajax({ type: "POST", url: "<?php echo e(url('user/get/total_pr_categorywise')); ?>", data: data, success:function(res){ console.log((res)); if(res.length!=0){ if(res.length<=5){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} var temObj = { y: res[i].category_count, category: res[i].category_name, color: col, legendText: res[i].category_name } pieChartValues.push(temObj); } }else if(res.length>=6){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} if(i<5){ var temObj = { y: res[i].category_count, category: res[i].category_name, color: col, legendText: res[i].category_name } pieChartValues.push(temObj); }else if(i==5){ var temCount=0; for (var j = 5; j < res.length; j++) { temCount += res[j].category_count; } var temObj = { y: temCount, category: "Others", color: "#F1E368", legendText: "Others" } pieChartValues.push(temObj); } } } renderPieChart1(pieChartValues); }else{ alert("Record Not Found"); } } }); } function renderPieChart1(values) { var chart = new CanvasJS.Chart("pieChart1", { backgroundColor: "white", colorSet: "colorSet2", height:250, width:350, legend: { horizontalAlign: "left", verticalAlign: "top", }, animationEnabled: true, data: [{ indexLabelFontSize: 12, indexLabelFontFamily: "Monospace", indexLabelFontWeight:"bold", indexLabelPlacement: "outside", type: "pie", radius: 70, toolTipContent: "{category}: <strong>#percent%</strong>", indexLabel: "{category}-#percent%", showInLegend: true, dataPoints: values }] }); chart.render(); } /*---------Category End----------*/ /*---------Department Start----------*/ function assign_null_department(id){ if(id=="department_week"){ $("#department_month").val(''); $("#department_quarterly").val(''); } if(id=="department_month"){ $("#department_week").val(''); $("#department_quarterly").val(''); } if(id=="department_quarterly"){ $("#department_week").val(''); $("#department_month").val(''); } if(id=="department_fy"){ $("#department_week").val(''); $("#department_month").val(''); $("#department_quarterly").val(''); } } function po_department() { var data = {}; data.department_fy = $("#department_fy").val(); data.department_week = $("#department_week").val(); data.department_month = $("#department_month").val(); data.department_quarterly = $("#department_quarterly").val(); data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); data.type = 'po_departmentWise'; $.ajax({ type: "POST", url: "<?php echo e(url('user/get/total_purchase_department_wise')); ?>", data: data, success:function(res){ console.log((res)); if(res.length!=0){ if(res.length<=5){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} var temObj = { y: res[i].department_count, department: res[i].department_name, color: col, legendText: res[i].department_name } pieChartValues.push(temObj); } }else if(res.length>=6){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} if(i<5){ var temObj = { y: res[i].department_count, department: res[i].department_name, color: col, legendText: res[i].department_name } pieChartValues.push(temObj); }else if(i==5){ var temCount=0; for (var j = 5; j < res.length; j++) { temCount += res[j].department_count; } var temObj = { y: temCount, department: "Others", color: "#F1E368", legendText: "Others" } pieChartValues.push(temObj); } } } renderPieChart2(pieChartValues); }else{ alert("Record Not Found"); } } }); } function renderPieChart2(values) { var chart = new CanvasJS.Chart("pieChart2", { backgroundColor: "white", colorSet: "colorSet2", height:250, width:350, legend: { horizontalAlign: "left", verticalAlign: "top", }, animationEnabled: true, data: [{ indexLabelFontSize: 12, indexLabelFontFamily: "Monospace", indexLabelFontWeight:"bold", indexLabelPlacement: "outside", type: "pie", radius: 70, toolTipContent: "{department}: <strong>#percent%</strong>", indexLabel: "{department}-#percent%", showInLegend: true, dataPoints: values }] }); chart.render(); } /*---------Department End----------*/ /*---------Circle Start----------*/ function assign_null_circle(id){ if(id=="circle_week"){ $("#circle_month").val(''); $("#circle_quarterly").val(''); } if(id=="circle_month"){ $("#circle_week").val(''); $("#circle_quarterly").val(''); } if(id=="circle_quarterly"){ $("#circle_week").val(''); $("#circle_month").val(''); } if(id=="circle_fy"){ $("#circle_week").val(''); $("#circle_month").val(''); $("#circle_quarterly").val(''); } } function po_circle() { var data = {}; data.circle_fy = $("#circle_fy").val(); data.circle_week = $("#circle_week").val(); data.circle_month = $("#circle_month").val(); data.circle_quarterly = $("#circle_quarterly").val(); data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); data.type = 'po_circleWise'; $.ajax({ type: "POST", url: "<?php echo e(url('user/get/total_purchase_circle_wise')); ?>", data: data, success:function(res){ console.log((res)); if(res.length!=0){ if(res.length<=5){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} var temObj = { y: res[i].circle_count, circle: res[i].circle_name, color: col, legendText: res[i].circle_name } pieChartValues.push(temObj); } }else if(res.length>=6){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} if(i<5){ var temObj = { y: res[i].circle_count, circle: res[i].circle_name, color: col, legendText: res[i].circle_name } pieChartValues.push(temObj); }else if(i==5){ var temCount=0; for (var j = 5; j < res.length; j++) { temCount += res[j].circle_count; } var temObj = { y: temCount, circle: "Others", color: "#F1E368", legendText: "Others" } pieChartValues.push(temObj); } } } renderPieChart3(pieChartValues); }else{ alert("Record Not Found"); } } }); } function renderPieChart3(values) { var chart = new CanvasJS.Chart("pieChart3", { backgroundColor: "white", colorSet: "colorSet2", height:250, width:350, legend: { horizontalAlign: "left", verticalAlign: "top", }, animationEnabled: true, data: [{ indexLabelFontSize: 12, indexLabelFontFamily: "Monospace", indexLabelFontWeight:"bold", indexLabelPlacement: "outside", type: "pie", radius: 70, toolTipContent: "{circle}: <strong>#percent%</strong>", indexLabel: "{circle}-#percent%", showInLegend: true, dataPoints: values }] }); chart.render(); } /*---------Circle End----------*/ /*---------Suppliers Start----------*/ function assign_null_supplier(id){ if(id=="supplier_week"){ $("#supplier_month").val(''); $("#supplier_quarterly").val(''); } if(id=="supplier_month"){ $("#supplier_week").val(''); $("#supplier_quarterly").val(''); } if(id=="supplier_quarterly"){ $("#supplier_week").val(''); $("#supplier_month").val(''); } if(id=="supplier_fy"){ $("#supplier_week").val(''); $("#supplier_month").val(''); $("#supplier_quarterly").val(''); } } function po_supplierWise() { var data = {}; data.supplier_fy = $("#supplier_fy").val(); data.supplier_week = $("#supplier_week").val(); data.supplier_month = $("#supplier_month").val(); data.supplier_quarterly = $("#supplier_quarterly").val(); data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); data.type = 'po_supplierWise'; $.ajax({ type: "POST", url: "<?php echo e(url('user/get/top_five_suppliers')); ?>", data: data, success:function(res){ console.log((res)); if(res.length!=0){ if(res.length<=5){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} var temObj = { y: res[i].po_amount, supplier: res[i].vendor_name, color: col, legendText: res[i].vendor_name } pieChartValues.push(temObj); } }else if(res.length>=6){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} if(i<5){ var temObj = { y: res[i].po_amount, supplier: res[i].vendor_name, color: col, legendText: res[i].vendor_name } pieChartValues.push(temObj); }else if(i==5){ var temCount=0; for (var j = 5; j < res.length; j++) { temCount += res[j].po_amount; } var temObj = { y: temCount, supplier: "Others", color: "#F1E368", legendText: "Others" } pieChartValues.push(temObj); } } } renderBarChart1(pieChartValues); }else{ alert("Record Not Found"); } } }); } function po_itemWise() { var data = {}; data.item_fy = $("#item_fy").val(); data.item_week = $("#item_week").val(); data.item_month = $("#item_month").val(); data.item_quarterly = $("#item_quarterly").val(); data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); data.type = 'po_itemWise'; $.ajax({ type: "POST", url: "<?php echo e(url('user/get/top_five_items')); ?>", data: data, success:function(res){ console.log((res)); if(res.length!=0){ if(res.length<=5){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} var temObj = { y: res[i].po_amount, supplier: res[i].vendor_name, color: col, legendText: res[i].vendor_name } pieChartValues.push(temObj); } }else if(res.length>=6){ var pieChartValues = []; for (var i = 0; i< res.length; i++) { var col; if(i==0){col="#2968B0";}else if(i==1){col="#DA7221";} else if(i==2){col="#DC4B41";} else if(i==3){col="#159286";} else if(i==4){col="#2A87D9";} if(i<5){ var temObj = { y: res[i].po_amount, supplier: res[i].vendor_name, color: col, legendText: res[i].vendor_name } pieChartValues.push(temObj); }else if(i==5){ var temCount=0; for (var j = 5; j < res.length; j++) { temCount += res[j].po_amount; } var temObj = { y: temCount, supplier: "Others", color: "#F1E368", legendText: "Others" } pieChartValues.push(temObj); } } } renderBarChart2(pieChartValues); }else{ alert("Record Not Found"); } } }); } function renderBarChart1(values) { var chart = new CanvasJS.Chart("barChart1", { backgroundColor: "white", colorSet: "colorSet2", height:250, width:350, legend: { horizontalAlign: "left", verticalAlign: "top", fontSize:12 }, animationEnabled: true, data: [{ indexLabelFontSize: 12, indexLabelFontFamily: "Monospace", indexLabelFontWeight:"bold", indexLabelPlacement: "outside", type: "bar", toolTipContent: "{supplier}: <strong>₹{y}</strong>", indexLabel: "{supplier}-₹{y}", showInLegend: true, legendText:"₹{y}", dataPoints: values }] }); chart.render(); } function renderBarChart2(values) { var chart = new CanvasJS.Chart("barChart2", { backgroundColor: "white", colorSet: "colorSet2", height:250, width:430, legend: { horizontalAlign: "left", verticalAlign: "top", fontSize:12 }, animationEnabled: true, data: [{ indexLabelFontSize: 12, indexLabelFontFamily: "Monospace", indexLabelFontWeight:"bold", indexLabelPlacement: "outside", type: "bar", toolTipContent: "{supplier}: <strong>{y}</strong>", indexLabel: "{supplier}-{y}", showInLegend: true, legendText:"{y}", dataPoints: values }] }); chart.render(); } /*---------Suppliers end----------*/ function purchase_analysis() { var data = {}; data.item_fy = $("#item_fy").val(); data.item_week = $("#item_week").val(); data.item_month = $("#item_month").val(); data.item_quarterly = $("#item_quarterly").val(); data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); data.type = 'purchase_analysis'; $.ajax({ type: "POST", url: "<?php echo e(url('user/get/purchase-analysis')); ?>", data: data, success:function(res){ console.log((res)); if(res.length!=0){ mlist = [ "Jan", "Feb", "March", "April", "May", "June", "July", "August", "Sep", "Oct", "Nov", "Dec" ]; if(res.year_wise_po1) { var pieChartValues1 = []; var pieChartValues2 = []; $.each(mlist, function(key, val){ var temObj = { label: val, y: 12 } pieChartValues1.push(temObj); }); // $.each(res.year_wise_po1, function(key, value){ // var temObj = { // label: mlist[value['month']], // y: value['po_count'] // } // console.log(temObj); // pieChartValues1.push(temObj); // }); $.each(mlist, function(key, val){ console.log(val); var temObj = { label: val, y: 12 } pieChartValues2.push(temObj); }); // $.each(res.year_wise_po1, function(key, value){ // var temObj = { // label: mlist[value['month']], // y: value['po_count'] // } // console.log(temObj); // pieChartValues2.push(temObj); // }); } renderSlineChart(pieChartValues1, pieChartValues2); }else{ alert("Record Not Found"); } } }); } function renderSlineChart(year_data1, year_data2) { var chart = new CanvasJS.Chart("slineChart", { theme: "light2", // "light1", "light2", "dark1", "dark2" animationEnabled: true, axisX: { lineColor: "black", labelFontColor: "black" }, axisY2: { gridThickness: 0, title: "% Purchase", suffix: "%", titleFontColor: "black", labelFontColor: "black" }, height:250, width:400, legend: { cursor: "pointer", itemmouseover: function(e) { e.dataSeries.lineThickness = e.chart.data[e.dataSeriesIndex].lineThickness * 2; e.dataSeries.markerSize = e.chart.data[e.dataSeriesIndex].markerSize + 2; e.chart.render(); }, itemmouseout: function(e) { e.dataSeries.lineThickness = e.chart.data[e.dataSeriesIndex].lineThickness / 2; e.dataSeries.markerSize = e.chart.data[e.dataSeriesIndex].markerSize - 2; e.chart.render(); }, itemclick: function (e) { if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) { e.dataSeries.visible = false; } else { e.dataSeries.visible = true; } e.chart.render(); } }, toolTip: { shared: true }, data: [{ type: "spline", name: "2021", markerSize: 11, axisYType: "secondary", xValueFormatString: "YYYY", yValueFormatString: "#,##0.0\"%\"", showInLegend: true, dataPoints: year_data1 }, { type: "spline", name: "2022", markerSize: 11, axisYType: "secondary", xValueFormatString: "YYYY", yValueFormatString: "#,##0.0\"%\"", showInLegend: true, dataPoints: year_data2 } ] }); chart.render(); } function handleSession(t) { var session = $(t).val(); var data = {}; data.type = 'session'; // data.quarter = quarter; data.session = session; data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); $.ajax({ type: "POST", url: "<?php echo e(url('user/get/dashboard-session-data')); ?>", data: data, success:function(res){ $('#open_pr_count').text(res.open_pr_count); $('#total_pr_count').text(res.total_pr_count); $('#total_pr_amount').text(res.total_pr_amount); $('#total_un_app_pr_count').text(res.total_un_app_pr_count); $('#open_po_count').text(res.open_po_count); $('#total_po_amount').text(res.total_po_amount); $('#total_un_app_po_count').text(res.total_un_app_po_count); $('#total_mrn_amount').text(res.total_mrn_amount); $('#total_mrn_count').text(res.total_mrn_count); $('#total_po_count').text(res.total_po_count); } }); } function handleQuarter(t) { var quarter = $(t).val(); var session = $('#session_top').val(); var data = {}; data.type = 'quarter'; data.quarter = quarter; data.session = session; data._token = document.querySelector('meta[name="_token"]').getAttribute('content'); $.ajax({ type: "POST", url: "<?php echo e(url('user/get/dashboard-data')); ?>", data: data, success:function(res){ $('#open_pr_count').text(res.open_pr_count); $('#total_pr_count').text(res.total_pr_count); $('#total_pr_amount').text(res.total_pr_amount); $('#total_un_app_pr_count').text(res.total_un_app_pr_count); $('#open_po_count').text(res.open_po_count); $('#total_po_amount').text(res.total_po_amount); $('#total_un_app_po_count').text(res.total_un_app_po_count); $('#total_mrn_amount').text(res.total_mrn_amount); $('#total_mrn_count').text(res.total_mrn_count); $('#total_po_count').text(res.total_po_count); } }); } function generateExcel(file_name) { var url = `<?php echo e(url('user/get/`+file_name+`')); ?>`; var request = new XMLHttpRequest(); request.open('POST', url, true); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); request.responseType = 'blob'; request.onload = function(e) { if (this.status === 200) { var blob = this.response; if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, file_name); } else{ var downloadLink = window.document.createElement('a'); var contentTypeHeader = request.getResponseHeader("Content-Type"); downloadLink.href = window.URL.createObjectURL(new Blob([blob], { type: contentTypeHeader })); downloadLink.download = file_name; document.body.appendChild(downloadLink); downloadLink.click(); document.body.removeChild(downloadLink); } } }; request.send(); } </script> <?php $__env->stopSection(); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('dashboard.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/sjslayjy/public_html/scm/resources/views/dashboard/index.blade.php ENDPATH**/ ?>