Add filter cawangan, change trigger cron update button style

This commit is contained in:
Afiq Hamzah
2024-10-06 10:12:45 +08:00
parent 20d29e7891
commit 176e509389
3 changed files with 47 additions and 19 deletions
@@ -24,21 +24,33 @@ class OnlineTransactionTrailController extends Controller
$isGroupedByNorujukan = $request->groupedByNorujukan === 'on' ? true : false;
$status = $request->status ?? '';
$selectedStatus = $request->selectedStatus ?? '';
$selectedBranch = $request->selectedBranch ?? '';
$billplzBillId = $request->billplzBillId ?? '';
$statuses = [
'PAID',
'NOT PAID',
'UNSUCCESSFUL',
];
$transactionTrail = Http::arrahn()
->get('/api/transaction/online/trail', [
'startDate' => $startDate,
'endDate' => $endDate,
'status' => $status,
'status' => $selectedStatus,
'branch' => $selectedBranch,
'billplzBillId' => $billplzBillId,
'norujukan' => $norujukan,
'isGroupedByNorujukan' => $isGroupedByNorujukan,
])
->json();
$branches = Http::arrahn()->get('/api/cawangan')->json();
return view('online.trail.index', compact('transactionTrail', 'startDate', 'endDate', 'norujukan', 'status', 'billplzBillId' ));
return view('online.trail.index', compact('transactionTrail', 'startDate', 'endDate', 'norujukan', 'selectedStatus', 'statuses', 'billplzBillId', 'branches', 'selectedBranch'));
}
}
@@ -5,7 +5,10 @@
'endDate' => '',
'norujukan' => '',
'billplzBillId' => '',
'status' => 'PAID',
'statuses' => [],
'selectedStatus' => 'PAID',
'branches' => [],
'selectedBranch' => '',
])
<div class="px-4">
@@ -44,7 +47,7 @@
<button
class="bg-yellow-600 text-white font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300 mr-8 mt-16"
class="border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300 mr-8 mt-16"
onclick="triggerCronUpdate()"
type="button"
>
@@ -86,21 +89,31 @@
style="background-color: rgb(249, 250, 251);">
Status
</span>
<select id="status" name="status"
@php
$paymentStatuses = [
'PAID',
'NOT PAID',
'UNSUCCESSFUL',
];
@endphp
<select id="selectedStatus" name="selectedStatus"
class="border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2 bg-white text-gray-700 focus:outline-none focus:border-yellow-500 flex-grow">
<option value="" {{ $status === '' ? 'selected' : '' }}>ALL
<option value="" {{ $selectedStatus === '' ? 'selected' : '' }}>ALL
</option>
@foreach ($paymentStatuses as $paymentStatus)
<option value="{{ $paymentStatus }}"
{{ $status == $paymentStatus ? 'selected' : '' }}>
{{ $paymentStatus }}</option>
@foreach ($statuses as $status)
<option value="{{ $status }}" {{ $selectedStatus == $status ? 'selected' : '' }}>
{{ $status }}
</option>
@endforeach
</select>
</div>
<div id="select-wrapper" class="flex">
<span
class="text-gray-600 border-2 rounded-l px-4 py-2 whitespace-no-wrap inline-flex items-center"
style="background-color: rgb(249, 250, 251);">
Cawangan
</span>
<select id="selectedBranch" name="selectedBranch"
class="border-2 border-l-0 rounded-r px-4 py-2 w-80r mr-2 bg-white text-gray-700 focus:outline-none focus:border-yellow-500 flex-grow">
<option value="" {{ $selectedBranch === '' ? 'selected' : '' }}>ALL</option>
@foreach ($branches as $branch)
<option value="{{ $branch['kodcaw'] }}" {{ $branch['kodcaw'] == $selectedBranch ? 'selected' : '' }}>
{{ $branch['details_caw'] }}
</option>
@endforeach
</select>
</div>
+4 -1
View File
@@ -14,7 +14,10 @@
:endDate="$endDate"
:norujukan="$norujukan"
:billplzBillId="$billplzBillId"
:status="$status"
:statuses="$statuses"
:selectedStatus="$selectedStatus"
:branches="$branches"
:selectedBranch="$selectedBranch"
/>
@if (Session::has('errormessage'))