update add pool filter on vehicle trips report
This commit is contained in:
@ -25,10 +25,12 @@ class ReportsController extends Controller
|
|||||||
$q = "SELECT id, nopol1 from t_vehicles WHERE dlt is null order by nopol1";
|
$q = "SELECT id, nopol1 from t_vehicles WHERE dlt is null order by nopol1";
|
||||||
$vehicletype = DB::table('t_vehicles_cats')->where('is_active', 1)->get();
|
$vehicletype = DB::table('t_vehicles_cats')->where('is_active', 1)->get();
|
||||||
$listNopol = DB::select($q);
|
$listNopol = DB::select($q);
|
||||||
|
$listpool = DB::table('t_conf_pools')->where('is_active')->get();
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'listNopol' => $listNopol,
|
'listNopol' => $listNopol,
|
||||||
'vehicletype' => $vehicletype
|
'vehicletype' => $vehicletype,
|
||||||
|
'listpool' => $listpool
|
||||||
];
|
];
|
||||||
|
|
||||||
$log = [
|
$log = [
|
||||||
@ -63,6 +65,7 @@ class ReportsController extends Controller
|
|||||||
$to_date = $req->input('to_date') - Helper::TIMEFIX;
|
$to_date = $req->input('to_date') - Helper::TIMEFIX;
|
||||||
$vid = $req->input('vid');
|
$vid = $req->input('vid');
|
||||||
$vt = $req->input('vt');
|
$vt = $req->input('vt');
|
||||||
|
$poolcode = $req->input('poolcode');
|
||||||
// $from_date = 1756054800;
|
// $from_date = 1756054800;
|
||||||
// $to_date = 1756745940;
|
// $to_date = 1756745940;
|
||||||
|
|
||||||
@ -161,7 +164,8 @@ class ReportsController extends Controller
|
|||||||
t.start BETWEEN ? AND ?
|
t.start BETWEEN ? AND ?
|
||||||
and if(? , t.id = ? , 1=1)
|
and if(? , t.id = ? , 1=1)
|
||||||
and if(? , vt.id = ? , 1=1)
|
and if(? , vt.id = ? , 1=1)
|
||||||
", [$from_date, $to_date, $from_date, $to_date, $vid, $vid, $vt, $vt]);
|
and if(? , t.pool_code = ? , 1=1)
|
||||||
|
", [$from_date, $to_date, $from_date, $to_date, $vid, $vid, $vt, $vt, $poolcode, $poolcode]);
|
||||||
|
|
||||||
// // RETURN 1 - LIST
|
// // RETURN 1 - LIST
|
||||||
// if($req->type != 'report'){
|
// if($req->type != 'report'){
|
||||||
|
|||||||
@ -79,6 +79,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label text-muted mb-1">Pool</label>
|
||||||
|
<select name="vehicle_type" class="form-control" id="vehicleType">
|
||||||
|
<option value="">-- All --</option>
|
||||||
|
@foreach ($listpool as $listpools)
|
||||||
|
<option value="{{ $listpools->pool_code }}">{{ $listpools->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4 d-flex justify-content-end gap-2">
|
<div class="col-md-4 d-flex justify-content-end gap-2">
|
||||||
<button class="btn btn-primary" id="submitFilter">
|
<button class="btn btn-primary" id="submitFilter">
|
||||||
<i class="fa fa-search me-1"></i> Submit
|
<i class="fa fa-search me-1"></i> Submit
|
||||||
@ -314,6 +326,7 @@
|
|||||||
&to_date=${moment($('#tgl1').val(), "DD-MM-YYYY HH:mm").unix()}
|
&to_date=${moment($('#tgl1').val(), "DD-MM-YYYY HH:mm").unix()}
|
||||||
&vid=${$('#filterNopol').val() || ''}
|
&vid=${$('#filterNopol').val() || ''}
|
||||||
&vt=${$('#vehicleType').val() || ''}
|
&vt=${$('#vehicleType').val() || ''}
|
||||||
|
&poolcode=${$('#poolcode').val() || ''}
|
||||||
`,
|
`,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
|
|||||||
Reference in New Issue
Block a user