IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Generate Report</strong></h2>
</div>
<div class="body">
<?php echo Form::open(['url' => 'report-generation','method'=>'GET', 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">Comapny Name</label>
</div>
<div class="col-sm-3">
<input type="hidden" name="type" value="<?php echo e($type); ?>">
<div class="form-group">
<?php echo Form::select('idCompany',getCompanies(),null,['class' => 'form-control show-tick ms','required'=>'required']); ?>
<?php if($errors->has('idCompany')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idCompany')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
<div class="col-sm-2 form-control-label required">
<label for="classname">Branch Name</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('idBranch',[],null,['class' => 'form-control show-tick ms','required'=>'required']); ?>
<?php if($errors->has('idBranch')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idBranch')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">Car No</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('vehicleNo',['All'=>'All'],null,['class' => 'form-control select2 show-tick ms','required'=>'required']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php echo Form::submit('GENERATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php if(isset($vehicles)): ?>
<div class="row clearfix" id="report_generate_table">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Generating Report Table</strong></h2>
<p style="color:red;">Note : Please do not reload this page and fetched vehicle details available below</p>
<button style="float:right;" onclick="getDetails()" class="btn btn-raised btn-primary btn-round waves-effect" id="bt-fetch">Fetch Now</button>
</div>
<div class="body">
<table class="table table-bordered">
<thead>
<tr>
<th>S. No.</th>
<th>Vehicle Number</th>
<th>Fetch Status</th>
<th>Fetch Body</th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$('select[name="idCompany"]').on('change', function() {
var compID = $(this).val();
if (compID) {
$.ajax({
url: "<?php echo e(url('/company')); ?>" + '/' + compID + "/branches",
type: "GET",
dataType: "json",
success:function(data) {
$('select[name="idBranch"]').empty();
$('select[name="idBranch"]').append('<option value="">--- Select ---</option>');
$.each(data, function(key, value) {
$('select[name="idBranch"]').append('<option value="' + key + '">' + value + '</option>');
});
}
});
} else{
$('select[name="idBranch"]').empty();
}
});
$('select[name="idBranch"]').on('change', function() {
var branchid = $(this).val();
if (branchid) {
$.ajax({
url: "<?php echo e(url('/branch')); ?>" + '/' + branchid + "/vehicles",
type: "GET",
dataType: "json",
success:function(data) {
$('select[name="vehicleNo"]').empty();
$('select[name="vehicleNo"]').append('<option value="All">All</option>');
$.each(data, function(key, value) {
$('select[name="vehicleNo"]').append('<option value="' + key + '">' + value + '</option>');
});
}
});
} else{
$('select[name="vehicleNo"]').empty();
}
});
<?php if(isset($vehicles)): ?>
let vehicles = <?php echo json_encode($vehicles); ?>;
var currentPos = 0;
function getDetails(){
var vehicle = vehicles[currentPos];
$('#bt-fetch').hide();
$.ajax({
url: "<?php echo e(url('/generates')); ?>" + '/' + vehicle + "/<?php echo e($type); ?>",
type: "GET",
dataType: "json",
success:function(data) {
currentPos = currentPos + 1;
$('#tbody').append('<tr><td>'+currentPos+'</td><td>'+vehicle+'</td><td>Done</td><td>'+JSON.stringify(data)+'</td></tr>');
if(currentPos < vehicles.length - 1)
getDetails();
}
});
}
getDetails();
<?php endif; ?>
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/spdtg/public_html/gomygps/resources/views/reports/generate-report.blade.php ENDPATH**/ ?>
Copyright © 2021 -