/
home
/
sjslayjy
/
public_html
/
assets
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startPush('plugin-styles'); ?> <!-- <?php echo Html::style('/assets/plugins/plugin.css'); ?> --> <style type="text/css"> .table th, .table td { white-space: break-spaces !important; } .table-responsive.small-text > table > tbody > tr > td {font-size: 12px !important;} </style> <?php $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row grid-margin"> <div class="col-lg-6"> <h4 class="card-title">Spares Parts At Engineers</h4> </div> <div class="col-lg-3"> <small>Select Warehouse</small> <select class="form-control mr" onchange="get_ware_house(this)"> <?php $__currentLoopData = $warehouses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($warehouse); ?>"><?php echo e($warehouse); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> <div class="col-lg-3"> <small>Select Engineer</small> <select class="form-control mr select2" id="engineer" onchange="getSpareParts(this)"> <option value=""> -- Select Engineer --</option> <?php $__currentLoopData = $engineers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $engineer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($engineer->LoginID); ?>"><?php echo e($engineer->StaffCode); ?> - <?php echo e($engineer->StaffName); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th> Spare Code </th> <th> Description </th> <th> Fresh</th> <th> Repaird </th> <th> Faulty </th> <th> Total </th> </tr> </thead> <tbody id="spare_list"> </tbody> </table> </div> </div> </div> </div> <div class="row grid-margin"> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <h4>Fresh Spare</h4> <div class="table-responsive small-text"> <table class="table table-striped"> <thead> <tr> <th> Spare </th> <th> Qty </th> <th> Rate</th> <th> Total</th> </tr> </thead> <tbody id="fresh_spare_list"> </tbody> </table> </div> </div> </div> </div> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <h4>Repaired Spare</h4> <div class="table-responsive small-text"> <table class="table table-striped"> <thead> <tr> <th> Spare </th> <th> Qty </th> <th> Rate</th> <th> Total</th> </tr> </thead> <tbody id="repaired_spare_list"> </tbody> </table> </div> </div> </div> </div> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <h4>Faulty Spare</h4> <div class="table-responsive small-text"> <table class="table table-striped"> <thead> <tr> <th> Spare </th> <th> Qty </th> <th> Rate</th> <th> Total</th> </tr> </thead> <tbody id="faulty_spare_list"> </tbody> </table> </div> </div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startPush('plugin-scripts'); ?> <?php echo Html::script('/assets/plugins/chartjs/chart.min.js'); ?> <?php echo Html::script('/assets/plugins/jquery-sparkline/jquery.sparkline.min.js'); ?> <?php $__env->stopPush(); ?> <?php $__env->startPush('custom-scripts'); ?> <?php echo Html::script('/assets/js/dashboard.js'); ?> <script type="text/javascript"> $(document).ready(function(){ $(".select2").select2(); }); function get_ware_house(t){ var warehouse = $(t).val(); if(warehouse !=""){ var url = window.location.origin+"/circle-store/get-engineer-of-warehouse" var data = {}; data._token = "<?php echo e(csrf_token()); ?>"; data.warehouse = warehouse; $('#loaderAction').show(); $.ajax({ type: "POST", url: url, data: data, success:function(res){ if(res.success == true){ var html = '<option value=""> -- Select Engineer --</option>'; $.each(res.engineers,function(key,val){ html +=`<option value="`+val.LoginID+`">`+val.LoginID+` - `+val.StaffName+`</option>`; }); $('#engineer').html(html); }else{ swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); }else{ swal("Please Select warehouse !", { icon: "error", }); } } function getSpareParts(t){ var engineer_id = $(t).val(); if(engineer_id != ""){ var url = window.location.origin+"/circle-store/get-spare-part-at-engineer" var mydata = {}; mydata._token = "<?php echo e(csrf_token()); ?>"; mydata.engineer_id = engineer_id; $.ajax({ type: "POST", url: url, data: mydata, success:function(res){ console.log(res); if(res.success == true){ var html = ""; $.each(res.spares,function(key,spare_part){ html +=`<tr class="row_`+spare_part.id+`"> <td>`+spare_part.spare_code+`</td> <td>`+spare_part.description+`</td> <td><label class="badge badge-success">`+spare_part.fresh_qty+`</label></td> <td><label class="badge badge-warning">`+spare_part.repaired_qty+`</label></td> <td><label class="badge badge-danger">`+spare_part.faulty_qty+`</label></td> <td><label class="badge">`+(spare_part.fresh_qty+spare_part.repaired_qty+spare_part.faulty_qty)+`</label></td> </tr>`; }); $('#spare_list').html(html); var fhtml = ''; $.each(res.fresh_items,function(key,fspare){ fhtml +=`<tr class="frow_`+fspare.id+`"> <td>`+fspare.spare_code+`</td> <td>`+fspare.available_qty+`</td> <td>`+fspare.rate+`</td> <td>`+(fspare.available_qty*fspare.rate)+`</td> </tr>`; }); $('#fresh_spare_list').html(fhtml); var rhtml = ''; $.each(res.repaired_items,function(key,rspare){ rhtml +=`<tr class="rrow_`+rspare.id+`"> <td>`+rspare.spare_code+`</td> <td>`+rspare.available_qty+`</td> <td>`+rspare.rate+`</td> <td>`+(rspare.available_qty*rspare.rate)+`</td> </tr>`; }); $('#repaired_spare_list').html(rhtml); var flhtml = ''; $.each(res.faulty_items,function(key,flspare){ flhtml +=`<tr class="frow_`+flspare.id+`"> <td>`+flspare.spare_code+`</td> <td>`+flspare.available_qty+`</td> <td>`+flspare.rate+`</td> <td>`+(flspare.available_qty*flspare.rate)+`</td> </tr>`; }); $('#faulty_spare_list').html(flhtml); }else{ swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); }else{ } } </script> <?php $__env->stopPush(); ?> <?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/assets/resources/views/circle-store/spare-at-engineers.blade.php ENDPATH**/ ?>