update
This commit is contained in:
@ -145,28 +145,65 @@ class ReportsController extends Controller
|
|||||||
// ORDER BY agg.id, trip_id
|
// ORDER BY agg.id, trip_id
|
||||||
// ", [$from_date, $to_date, $vid, $vid]);
|
// ", [$from_date, $to_date, $vid, $vid]);
|
||||||
|
|
||||||
$list = DB::select("WITH TotalMileage AS (
|
// $list = DB::select("WITH TotalMileage AS (
|
||||||
SELECT id, SUM(mileage) AS total_mileage, count(*) total_trip
|
// SELECT id, SUM(mileage) AS total_mileage, count(*) total_trip
|
||||||
FROM trips
|
// FROM trips
|
||||||
WHERE start BETWEEN ? AND ?
|
// WHERE start BETWEEN ? AND ?
|
||||||
GROUP BY id
|
// GROUP BY id
|
||||||
)
|
// )
|
||||||
SELECT
|
// SELECT
|
||||||
t.*,
|
// t.*,
|
||||||
tm.total_mileage, total_trip,
|
// tm.total_mileage, total_trip,
|
||||||
vt.name as type_name,
|
// vt.name as type_name,
|
||||||
ROW_NUMBER() OVER (PARTITION BY t.id ORDER BY t.start) AS trip_id
|
// ROW_NUMBER() OVER (PARTITION BY t.id ORDER BY t.start) AS trip_id
|
||||||
FROM trips t
|
// FROM trips t
|
||||||
JOIN TotalMileage tm ON t.id = tm.id
|
// JOIN TotalMileage tm ON t.id = tm.id
|
||||||
LEFT JOIN t_vehicles tvt ON tvt.id = t.vhc_id
|
// LEFT JOIN t_vehicles tvt ON tvt.id = t.vhc_id
|
||||||
LEFT JOIN t_vehicles_cats vt ON vt.id = tvt.cat_id
|
// LEFT JOIN t_vehicles_cats vt ON vt.id = tvt.cat_id
|
||||||
WHERE
|
// WHERE
|
||||||
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)
|
||||||
and if(? , t.pool_code = ? , 1=1)
|
// and if(? , t.pool_code = ? , 1=1)
|
||||||
", [$from_date, $to_date, $from_date, $to_date, $vid, $vid, $vt, $vt, $poolcode, $poolcode]);
|
// ", [$from_date, $to_date, $from_date, $to_date, $vid, $vid, $vt, $vt, $poolcode, $poolcode]);
|
||||||
|
$sql = "WITH TotalMileage AS (
|
||||||
|
SELECT id, SUM(mileage) AS total_mileage, count(*) total_trip
|
||||||
|
FROM trips
|
||||||
|
WHERE start BETWEEN ? AND ?
|
||||||
|
GROUP BY id
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
t.*,
|
||||||
|
tm.total_mileage, total_trip,
|
||||||
|
vt.name as type_name,
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY t.id ORDER BY t.start) AS trip_id
|
||||||
|
FROM trips t
|
||||||
|
JOIN TotalMileage tm ON t.id = tm.id
|
||||||
|
LEFT JOIN t_vehicles tvt ON tvt.id = t.vhc_id
|
||||||
|
LEFT JOIN t_vehicles_cats vt ON vt.id = tvt.cat_id
|
||||||
|
WHERE
|
||||||
|
t.start BETWEEN ? AND ?
|
||||||
|
and (? IS NULL or t.id = ?)
|
||||||
|
and (? IS NULL or vt.id = ?)
|
||||||
|
and (? IS NULL or t.pool_code = ?)
|
||||||
|
";
|
||||||
|
|
||||||
|
$vid = $vid ?: null;
|
||||||
|
$vt = $vt ?: null;
|
||||||
|
$poolcode = $poolcode ?: null;
|
||||||
|
|
||||||
|
$list = DB::select($sql, [
|
||||||
|
$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'){
|
||||||
$apiResp = Responses::success("success list vehicles report");
|
$apiResp = Responses::success("success list vehicles report");
|
||||||
@ -311,9 +348,11 @@ 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";
|
||||||
$listNopol = DB::select($q);
|
$listNopol = DB::select($q);
|
||||||
|
$listpool = DB::table('t_conf_pool')->where('dlt', null)->get();
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'listNopol' => $listNopol,
|
'listNopol' => $listNopol,
|
||||||
|
'listpool' => $listpool
|
||||||
];
|
];
|
||||||
|
|
||||||
$log = [
|
$log = [
|
||||||
@ -342,6 +381,7 @@ class ReportsController extends Controller
|
|||||||
$from_date = $req->input('from_date') - Helper::TIMEFIX;
|
$from_date = $req->input('from_date') - Helper::TIMEFIX;
|
||||||
$to_date = $req->input('to_date') - Helper::TIMEFIX;
|
$to_date = $req->input('to_date') - Helper::TIMEFIX;
|
||||||
$vid = $req->input('vid');
|
$vid = $req->input('vid');
|
||||||
|
$poolcode = $req->input('poolcode');
|
||||||
|
|
||||||
// Create a period between the two timestamps
|
// Create a period between the two timestamps
|
||||||
$period = CarbonPeriod::create(
|
$period = CarbonPeriod::create(
|
||||||
@ -363,25 +403,57 @@ class ReportsController extends Controller
|
|||||||
$qString = "(" . implode(' UNION ALL ', $subQueryParts) . ")";
|
$qString = "(" . implode(' UNION ALL ', $subQueryParts) . ")";
|
||||||
// dd("qString", $qString);
|
// dd("qString", $qString);
|
||||||
try {
|
try {
|
||||||
$list = DB::select("SELECT
|
// $list = DB::select("SELECT
|
||||||
tv.name,
|
// tv.name,
|
||||||
tv.nopol1,
|
// tv.nopol1,
|
||||||
t.crt_d,
|
// t.crt_d,
|
||||||
t.speed,
|
// t.speed,
|
||||||
tgta.fulladdress,
|
// tgta.fulladdress,
|
||||||
tvd.speed_limit,
|
// tvd.speed_limit,
|
||||||
tvd.pool_code,
|
// tvd.pool_code,
|
||||||
tvd.dc_code
|
// tvd.dc_code
|
||||||
FROM
|
// FROM
|
||||||
$qString t
|
// $qString t
|
||||||
INNER JOIN t_vehicles tv ON tv.id = t.vhc_id
|
// INNER JOIN t_vehicles tv ON tv.id = t.vhc_id
|
||||||
INNER JOIN t_vehicles_detail tvd ON tvd.vid = tv.id
|
// INNER JOIN t_vehicles_detail tvd ON tvd.vid = tv.id
|
||||||
LEFT JOIN t_gps_tracks_address tgta ON tgta.master_id = t.id
|
// LEFT JOIN t_gps_tracks_address tgta ON tgta.master_id = t.id
|
||||||
WHERE
|
// WHERE
|
||||||
if(? , tv.id = ? , 1=1)
|
// if(? , tv.id = ? , 1=1)
|
||||||
AND t.speed > tvd.speed_limit
|
// AND t.speed > tvd.speed_limit
|
||||||
ORDER BY t.crt_d;
|
// AND if(? , tvd.pool_code = ? , 1=1)
|
||||||
", [$vid, $vid]);
|
// ORDER BY t.crt_d;
|
||||||
|
// ", [$vid, $vid, $poolcode, $poolcode]);
|
||||||
|
|
||||||
|
$vid = $vid ?: null;
|
||||||
|
$poolcode = $poolcode ?: null;
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
tv.name,
|
||||||
|
tv.nopol1,
|
||||||
|
t.crt_d,
|
||||||
|
t.speed,
|
||||||
|
tgta.fulladdress,
|
||||||
|
tvd.speed_limit,
|
||||||
|
tvd.pool_code,
|
||||||
|
tvd.dc_code
|
||||||
|
FROM
|
||||||
|
$qString t
|
||||||
|
INNER JOIN t_vehicles tv ON tv.id = t.vhc_id
|
||||||
|
INNER JOIN t_vehicles_detail tvd ON tvd.vid = tv.id
|
||||||
|
LEFT JOIN t_gps_tracks_address tgta ON tgta.master_id = t.id
|
||||||
|
WHERE
|
||||||
|
(? IS NULL OR tv.id = ?)
|
||||||
|
AND t.speed > tvd.speed_limit
|
||||||
|
AND (? IS NULL OR tvd.pool_code = ?)
|
||||||
|
ORDER BY t.crt_d
|
||||||
|
";
|
||||||
|
|
||||||
|
$list = DB::select($sql, [
|
||||||
|
$vid,
|
||||||
|
$vid,
|
||||||
|
$poolcode,
|
||||||
|
$poolcode,
|
||||||
|
]);
|
||||||
|
|
||||||
// // RETURN 1 - LIST
|
// // RETURN 1 - LIST
|
||||||
// if($req->type != 'report'){
|
// if($req->type != 'report'){
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
@if ($user_role == \App\Models\Users::ROLE_VENDOR || $user_role == \App\Models\Users::ROLE_ADMIN)
|
@if ($user_role == \App\Models\Users::ROLE_VENDOR || $user_role == \App\Models\Users::ROLE_ADMIN)
|
||||||
@can('vehicle.create')
|
@can('vehicle.create')
|
||||||
<!-- <div class="col text-end">
|
<!-- <div class="col text-end">
|
||||||
<button id="btnMdlNewVhc" class="btn btn-sm btn-danger">Add New Vehicle</button>
|
<button id="btnMdlNewVhc" class="btn btn-sm btn-danger">Add New Vehicle</button>
|
||||||
</div> -->
|
</div> -->
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
{{-- <div class="col-auto text-end ps-0">
|
{{-- <div class="col-auto text-end ps-0">
|
||||||
@ -37,73 +37,90 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<!-- filter -->
|
<!-- filter -->
|
||||||
<div class="row">
|
<div class="row g-3 align-items-end">
|
||||||
<div class="col-2">
|
|
||||||
<div class="form-group">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<label class="text-muted">From</label>
|
<div class="form-group">
|
||||||
<!-- default today -->
|
<label class="form-label text-muted mb-1">From</label>
|
||||||
<!-- <input class="form-control" id="tgl0" value="20-08-2025 00:00"> -->
|
<input class="form-control" id="tgl0" value="{{ date('d-m-Y 00:00') }}">
|
||||||
<input class="form-control" id="tgl0" value="{{ date('d-m-Y 00:00') }}">
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="text-muted">To</label>
|
<label class="form-label text-muted mb-1">To</label>
|
||||||
<input class="form-control" id="tgl1" value="{{ date('d-m-Y 23:59') }}">
|
<input class="form-control" id="tgl1" value="{{ date('d-m-Y 23:59') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
|
||||||
<div class="form-group">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<label class="text-muted">License Plate</label>
|
<div class="form-group">
|
||||||
<select name="license_plate" class="form-control" id="filterNopol">
|
<label class="form-label text-muted mb-1">License Plate</label>
|
||||||
<option value="">-- All --</option>
|
<select name="license_plate" class="form-control" id="filterNopol">
|
||||||
@foreach ($listNopol as $nopol)
|
<option value="">-- All --</option>
|
||||||
<option value="{{ $nopol->id }}">{{ $nopol->nopol1 }}</option>
|
@foreach ($listNopol as $nopol)
|
||||||
@endforeach
|
<option value="{{ $nopol->id }}">{{ $nopol->nopol1 }}</option>
|
||||||
</select>
|
@endforeach
|
||||||
</div>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-1 d-flex align-items-end">
|
</div>
|
||||||
<button class="btn btn-primary" id="submitFilter">Submit</button>
|
|
||||||
</div>
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="col-5 d-flex align-items-end">
|
<div class="form-group">
|
||||||
<button class="btn btn-sm btn-danger ms-auto" id="btnDownloadReport">Download Report</button>
|
<label class="form-label text-muted mb-1">Pool</label>
|
||||||
</div>
|
<select name="poolcode" class="form-control" id="poolcode">
|
||||||
</div>
|
<option value="">-- All --</option>
|
||||||
</div>
|
@foreach ($listpool as $listpools)
|
||||||
<div class="table-responsive p-3">
|
<option value="{{ $listpools->pool_code }}">{{ $listpools->pool_name }}</option>
|
||||||
<table id="tVehicleTrips" class="table table-hover dataTable w-100">
|
@endforeach
|
||||||
<thead>
|
</select>
|
||||||
<tr class="">
|
</div>
|
||||||
<!-- <th class="">Vehicle ID</th> -->
|
</div>
|
||||||
<!-- <th class="text-center">Action</th> -->
|
|
||||||
<!-- <th class="">Vehicle Name</th> -->
|
<div class="col-12 col-lg-4 d-flex gap-2 justify-content-lg-end">
|
||||||
<th class="">License Plate Number</th>
|
<button class="btn btn-primary w-100 w-lg-auto" id="submitFilter">
|
||||||
<th class="">Dist. Cat.</th>
|
<i class="fa fa-search me-1"></i> Submit
|
||||||
<th class="">Pool</th>
|
</button>
|
||||||
<th class="">Time</th>
|
<button class="btn btn-danger w-100 w-lg-auto" id="btnDownloadReport">
|
||||||
<th class="">Speed (kph)</th>
|
<i class="fa fa-download me-1"></i> Download Report
|
||||||
<th class="">Location</th>
|
</button>
|
||||||
</tr>
|
</div>
|
||||||
</thead>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="table-responsive p-3">
|
||||||
|
<table id="tVehicleTrips" class="table table-hover dataTable w-100">
|
||||||
|
<thead>
|
||||||
|
<tr class="">
|
||||||
|
<!-- <th class="">Vehicle ID</th> -->
|
||||||
|
<!-- <th class="text-center">Action</th> -->
|
||||||
|
<!-- <th class="">Vehicle Name</th> -->
|
||||||
|
<th class="">License Plate Number</th>
|
||||||
|
<th class="">Dist. Cat.</th>
|
||||||
|
<th class="">Pool</th>
|
||||||
|
<th class="">Time</th>
|
||||||
|
<th class="">Speed (kph)</th>
|
||||||
|
<th class="">Location</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- modal -->
|
<!-- modal -->
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('customjs')
|
@section('customjs')
|
||||||
<script src="{{ asset('assets/js/load-image.all.min.js') }}"></script>
|
<script src="{{ asset('assets/js/load-image.all.min.js') }}"></script>
|
||||||
<!-- DataTables Buttons + JSZip (for Excel export) -->
|
<!-- DataTables Buttons + JSZip (for Excel export) -->
|
||||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
'use strict';
|
'use strict';
|
||||||
const State = {
|
const State = {
|
||||||
file_jimp_worker: "{{ asset('assets/js/worker/jimp.js') }}",
|
file_jimp_worker: "{{ asset('assets/js/worker/jimp.js') }}",
|
||||||
@ -119,130 +136,133 @@
|
|||||||
Wrapper.init();
|
Wrapper.init();
|
||||||
Wrapper.event();
|
Wrapper.event();
|
||||||
// DTable.activate();
|
// DTable.activate();
|
||||||
},
|
},
|
||||||
init: ()=>{
|
init: () => {
|
||||||
$('#tgl0, #tgl1').datetimepicker({
|
$('#tgl0, #tgl1').datetimepicker({
|
||||||
format:'d-m-Y H:i',
|
format: 'd-m-Y H:i',
|
||||||
defaultTime:'00:00',
|
defaultTime: '00:00',
|
||||||
closeOnDateSelect: true,
|
closeOnDateSelect: true,
|
||||||
// mask:true
|
// mask:true
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
event: function() {
|
event: function() {
|
||||||
$('#submitFilter').on('click', function() {
|
$('#submitFilter').on('click', function() {
|
||||||
DTable.reload();
|
DTable.reload();
|
||||||
});
|
});
|
||||||
// Trigger export on external button click
|
// Trigger export on external button click
|
||||||
$('#btnDownloadReport').on('click', function() {
|
$('#btnDownloadReport').on('click', function() {
|
||||||
DTable.table.button('.buttons-excel').trigger();
|
DTable.table.button('.buttons-excel').trigger();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const DTable = {
|
const DTable = {
|
||||||
table: null,
|
table: null,
|
||||||
lastAjax: null, // keep track of the last ajax request
|
lastAjax: null, // keep track of the last ajax request
|
||||||
activate: function() {
|
activate: function() {
|
||||||
DTable.reload();
|
DTable.reload();
|
||||||
},
|
},
|
||||||
reload: function() {
|
reload: function() {
|
||||||
// Abort the last request if it's still running
|
// Abort the last request if it's still running
|
||||||
if (DTable.lastAjax) {
|
if (DTable.lastAjax) {
|
||||||
DTable.lastAjax.abort();
|
DTable.lastAjax.abort();
|
||||||
}
|
}
|
||||||
if (DTable.table) {
|
if (DTable.table) {
|
||||||
// If table already exists → reload
|
// If table already exists → reload
|
||||||
DTable.table.ajax.reload();
|
DTable.table.ajax.reload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DTable.table = $('#tVehicleTrips').DataTable({
|
DTable.table = $('#tVehicleTrips').DataTable({
|
||||||
searching: false, // 🔹 remove search box
|
searching: false, // 🔹 remove search box
|
||||||
ordering: false, // 🔹 disable sorting for all columns
|
ordering: false, // 🔹 disable sorting for all columns
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: false,
|
serverSide: false,
|
||||||
bLengthChange: true,
|
bLengthChange: true,
|
||||||
deferRender: true,
|
deferRender: true,
|
||||||
ajax: function(data, callback, settings) {
|
ajax: function(data, callback, settings) {
|
||||||
// Abort previous
|
// Abort previous
|
||||||
if (DTable.lastAjax) {
|
if (DTable.lastAjax) {
|
||||||
DTable.lastAjax.abort();
|
DTable.lastAjax.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fire new request
|
// Fire new request
|
||||||
DTable.lastAjax = $.ajax({
|
DTable.lastAjax = $.ajax({
|
||||||
url: `{{ route('api_report_abnormalities_list') }}?
|
url: `{{ route('api_report_abnormalities_list') }}?
|
||||||
cptid=${AppState.current_company}
|
cptid=${AppState.current_company}
|
||||||
&from_date=${moment($('#tgl0').val(), "DD-MM-YYYY HH:mm").unix()}
|
&from_date=${moment($('#tgl0').val(), "DD-MM-YYYY HH:mm").unix()}
|
||||||
&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() || ''}
|
||||||
type: 'GET',
|
&poolcode=${$('#poolcode').val() || ''}`,
|
||||||
success: function(json) {
|
type: 'GET',
|
||||||
callback(json);
|
success: function(json) {
|
||||||
},
|
callback(json);
|
||||||
error: function(xhr, status, error) {
|
},
|
||||||
if (status !== 'abort') {
|
error: function(xhr, status, error) {
|
||||||
console.error("AJAX error:", error);
|
if (status !== 'abort') {
|
||||||
}
|
console.error("AJAX error:", error);
|
||||||
},
|
}
|
||||||
complete: function() {
|
},
|
||||||
DTable.lastAjax = null;
|
complete: function() {
|
||||||
}
|
DTable.lastAjax = null;
|
||||||
});
|
}
|
||||||
},
|
});
|
||||||
|
},
|
||||||
deferRender: true,
|
deferRender: true,
|
||||||
columns: [
|
columns: [
|
||||||
// { data: 'id', visible: false }, // vhc_id
|
// { data: 'id', visible: false }, // vhc_id
|
||||||
// {
|
// {
|
||||||
// data: 'name',
|
// data: 'name',
|
||||||
// className: 'text-start text-nowrap',
|
// className: 'text-start text-nowrap',
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
data: 'nopol1',
|
data: 'nopol1',
|
||||||
className: 'text-start',
|
className: 'text-start',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'dc_code',
|
data: 'dc_code',
|
||||||
className: 'text-start',
|
className: 'text-start',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'pool_code',
|
data: 'pool_code',
|
||||||
className: 'text-start',
|
className: 'text-start',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: "crt_d",
|
data: "crt_d",
|
||||||
className: 'text-nowrap',
|
className: 'text-nowrap',
|
||||||
render: (data, type, row, meta) => {
|
render: (data, type, row, meta) => {
|
||||||
return moment.unix(data + AppState.TIMEFIX).format('DD MMM YYYY HH:mm:ss');
|
return moment.unix(data + AppState.TIMEFIX).format(
|
||||||
}
|
'DD MMM YYYY HH:mm:ss');
|
||||||
},
|
}
|
||||||
{ data: "speed", className: 'text-end'},
|
},
|
||||||
{
|
{
|
||||||
data: "fulladdress",
|
data: "speed",
|
||||||
render: (data, type, row, meta) => {
|
className: 'text-end'
|
||||||
return Helper.shortenText(decodeURIComponent(data || ''), 255)
|
},
|
||||||
},
|
{
|
||||||
},
|
data: "fulladdress",
|
||||||
],
|
render: (data, type, row, meta) => {
|
||||||
paging: false,
|
return Helper.shortenText(decodeURIComponent(data || ''), 255)
|
||||||
buttons: [
|
},
|
||||||
{
|
},
|
||||||
extend: 'excelHtml5',
|
],
|
||||||
title: () => {
|
paging: false,
|
||||||
return `
|
buttons: [{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
title: () => {
|
||||||
|
return `
|
||||||
Abnormality Trip Report -
|
Abnormality Trip Report -
|
||||||
${moment($('#tgl0').val(), "DD-MM-YYYY HH:mm").format('DD MMM YYYY HH:mm')}
|
${moment($('#tgl0').val(), "DD-MM-YYYY HH:mm").format('DD MMM YYYY HH:mm')}
|
||||||
to
|
to
|
||||||
${moment($('#tgl1').val(), "DD-MM-YYYY HH:mm").format('DD MMM YYYY HH:mm')}`
|
${moment($('#tgl1').val(), "DD-MM-YYYY HH:mm").format('DD MMM YYYY HH:mm')}`
|
||||||
},
|
},
|
||||||
className: 'd-none', // hide default button
|
className: 'd-none', // hide default button
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: ':visible:not(:first-child)' // 🔹 exclude first column
|
columns: ':visible:not(:first-child)' // 🔹 exclude first column
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,8 @@
|
|||||||
@if ($user_role == \App\Models\Users::ROLE_VENDOR || $user_role == \App\Models\Users::ROLE_ADMIN)
|
@if ($user_role == \App\Models\Users::ROLE_VENDOR || $user_role == \App\Models\Users::ROLE_ADMIN)
|
||||||
@can('vehicle.create')
|
@can('vehicle.create')
|
||||||
<!-- <div class="col text-end">
|
<!-- <div class="col text-end">
|
||||||
<button id="btnMdlNewVhc" class="btn btn-sm btn-danger">Add New Vehicle</button>
|
<button id="btnMdlNewVhc" class="btn btn-sm btn-danger">Add New Vehicle</button>
|
||||||
</div> -->
|
</div> -->
|
||||||
@endcan
|
@endcan
|
||||||
|
|
||||||
{{-- <div class="col-auto text-end ps-0">
|
{{-- <div class="col-auto text-end ps-0">
|
||||||
@ -41,21 +41,22 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<!-- filter -->
|
<!-- filter -->
|
||||||
<div class="row g-3 align-items-end">
|
<div class="row g-3 align-items-end">
|
||||||
<div class="col-md-2">
|
|
||||||
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label text-muted mb-1">From</label>
|
<label class="form-label text-muted mb-1">From</label>
|
||||||
<input type="text" class="form-control" id="tgl0" value="{{ date('d-m-Y 00:00') }}">
|
<input type="text" class="form-control" id="tgl0" value="{{ date('d-m-Y 00:00') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label text-muted mb-1">To</label>
|
<label class="form-label text-muted mb-1">To</label>
|
||||||
<input type="text" class="form-control" id="tgl1" value="{{ date('d-m-Y 23:59') }}">
|
<input type="text" class="form-control" id="tgl1" value="{{ date('d-m-Y 23:59') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label text-muted mb-1">License Plate</label>
|
<label class="form-label text-muted mb-1">License Plate</label>
|
||||||
<select name="license_plate" class="form-control" id="filterNopol">
|
<select name="license_plate" class="form-control" id="filterNopol">
|
||||||
@ -67,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label text-muted mb-1">Vehicle Category</label>
|
<label class="form-label text-muted mb-1">Vehicle Category</label>
|
||||||
<select name="vehicle_type" class="form-control" id="vehicleType">
|
<select name="vehicle_type" class="form-control" id="vehicleType">
|
||||||
@ -79,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-6 col-md-3 col-lg-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label text-muted mb-1">Pool</label>
|
<label class="form-label text-muted mb-1">Pool</label>
|
||||||
<select name="poolcode" class="form-control" id="poolcode">
|
<select name="poolcode" class="form-control" id="poolcode">
|
||||||
@ -91,14 +92,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4 d-flex justify-content-end gap-2">
|
<div class="col-12 col-lg-2 d-flex gap-2 justify-content-lg-end">
|
||||||
<button class="btn btn-primary" id="submitFilter">
|
<button class="btn btn-primary w-100 w-lg-auto" id="submitFilter">
|
||||||
<i class="fa fa-search me-1"></i> Submit
|
<i class="fa fa-search me-1"></i> Submit
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-danger" id="btnDownloadReport">
|
<button class="btn btn-danger w-100 w-lg-auto" id="btnDownloadReport">
|
||||||
<i class="fa fa-download me-1"></i> Download Report
|
<i class="fa fa-download me-1"></i> Download Report
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive p-3">
|
<div class="table-responsive p-3">
|
||||||
@ -124,73 +126,73 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<!-- <tbody>
|
<!-- <tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>24-679</td>
|
<td>24-679</td>
|
||||||
<td>24-679</td>
|
<td>24-679</td>
|
||||||
<td>26</td>
|
<td>26</td>
|
||||||
<td>442.3</td>
|
<td>442.3</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>24-682</td>
|
<td>24-682</td>
|
||||||
<td>24-682</td>
|
<td>24-682</td>
|
||||||
<td>28</td>
|
<td>28</td>
|
||||||
<td>312.7</td>
|
<td>312.7</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>24-877</td>
|
<td>24-877</td>
|
||||||
<td>24-877</td>
|
<td>24-877</td>
|
||||||
<td>15</td>
|
<td>15</td>
|
||||||
<td>276.4</td>
|
<td>276.4</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>A.16-347</td>
|
<td>A.16-347</td>
|
||||||
<td>A.16-347</td>
|
<td>A.16-347</td>
|
||||||
<td>37</td>
|
<td>37</td>
|
||||||
<td>543.2</td>
|
<td>543.2</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>AL2025-B21</td>
|
<td>AL2025-B21</td>
|
||||||
<td>AL2025-B21</td>
|
<td>AL2025-B21</td>
|
||||||
<td>18</td>
|
<td>18</td>
|
||||||
<td>295.4</td>
|
<td>295.4</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>B.16-542</td>
|
<td>B.16-542</td>
|
||||||
<td>B.16-542</td>
|
<td>B.16-542</td>
|
||||||
<td>32</td>
|
<td>32</td>
|
||||||
<td>478.2</td>
|
<td>478.2</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>B.24-264</td>
|
<td>B.24-264</td>
|
||||||
<td>B.24-264</td>
|
<td>B.24-264</td>
|
||||||
<td>24</td>
|
<td>24</td>
|
||||||
<td>188.4</td>
|
<td>188.4</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>B.24-274</td>
|
<td>B.24-274</td>
|
||||||
<td>B.24-274</td>
|
<td>B.24-274</td>
|
||||||
<td>33</td>
|
<td>33</td>
|
||||||
<td>440.1</td>
|
<td>440.1</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ford Ranger</td>
|
<td>Ford Ranger</td>
|
||||||
<td>26-199</td>
|
<td>26-199</td>
|
||||||
<td>30</td>
|
<td>30</td>
|
||||||
<td>631.4</td>
|
<td>631.4</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Nissan AD</td>
|
<td>Nissan AD</td>
|
||||||
<td>B.10-517</td>
|
<td>B.10-517</td>
|
||||||
<td>27</td>
|
<td>27</td>
|
||||||
<td>375.9</td>
|
<td>375.9</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Triton</td>
|
<td>Triton</td>
|
||||||
<td>A.29-127</td>
|
<td>A.29-127</td>
|
||||||
<td>26</td>
|
<td>26</td>
|
||||||
<td>508.2</td>
|
<td>508.2</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody> -->
|
</tbody> -->
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -202,17 +204,17 @@
|
|||||||
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDetailTrip"
|
<div class="modal fade" data-bs-backdrop="static" data-bs-keyboard="false" id="mdlDetailTrip"
|
||||||
aria-labelledby="mdlDetailTripLabel" aria-hidden="true">
|
aria-labelledby="mdlDetailTripLabel" aria-hidden="true">
|
||||||
<!-- <div class="modal-dialog modal-dialog modal-dialog-centered modal-dialog-scrollable modal-xl">
|
<!-- <div class="modal-dialog modal-dialog modal-dialog-centered modal-dialog-scrollable modal-xl">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="mdlDetailTripLabel">-----</h5>
|
<h5 class="modal-title" id="mdlDetailTripLabel">-----</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
</div> -->
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user