135 lines
9.7 KiB
PHP
135 lines
9.7 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="bg-gray-900 opacity-50 hidden fixed inset-0 z-10" id="sidebarBackdrop"></div>
|
|
<div id="main-content" class="h-full w-full bg-gray-50 relative overflow-y-auto">
|
|
<main>
|
|
<div class="pt-6 px-4">
|
|
<breadcrumb
|
|
:items="[{ 'title': 'Laporan Keseluruhan', 'icon': 'fas fa-users', 'url': '{{ route('reports') }}' }, { 'title': 'Outstanding', 'icon': 'fas fa-users' }]">
|
|
</breadcrumb>
|
|
|
|
<div class="container">
|
|
<div class="flex w-full">
|
|
<div class="xl:w-2/3 2xl:w-1/2 p-8 mx-auto">
|
|
<div class="bg-yellow-600 text-gray-200 text-lg px-6 py-4 rounded-t-lg">
|
|
<a href="{{ route('reports') }}" class="router-link-active">
|
|
<i class="fas fa-backspace text-white"></i>
|
|
</a>
|
|
<span class="text-center mx-auto text-white font-bold">Outstanding</span>
|
|
</div>
|
|
<form method="get" id="formoutstanding" action="{{ route('reports.outstanding.index') }}">
|
|
<input type="hidden" id="formAction" name="action" value="search"> <!-- Hidden field to store action -->
|
|
<div class="rounded bg-white shadow p-6">
|
|
<div class="pb-6">
|
|
<label class="font-semibold text-gray-700 block pb-1">Tarikh Hingga</label>
|
|
<div class="flex space-x-2">
|
|
<input name="endDate" type="date"
|
|
value="{{ request()->endDate ?? $endDate }}"
|
|
class="border border-2 rounded px-4 py-2 w-full" placeholder="Hingga">
|
|
|
|
<button type="submit" onclick="setAction('search')" 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 ml-5">
|
|
<i class="fas fa-magnifying-glass mr-2"></i> Search
|
|
</button>
|
|
|
|
<button type="submit" onclick="setAction('excel')" class="border border-yellow-600 text-yellow-600 py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300 ml-2">
|
|
<i class="fas fa-file-excel mr-2"></i> Excel
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div kodcaw="operasi">
|
|
<table class="min-w-full leading-normal">
|
|
<thead class="text-center">
|
|
<tr>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">No</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Kod Cawangan</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Cawangan</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Bil Pembiayaan (BRG KES)</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Jumlah Pembiayaan (RM)</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Bil Pembiayaan (SAG LAMA)</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Jumlah Pembiayaan (RM)</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Bil Pembiayaan (SAG BARU)</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Jumlah Pembiayaan (RM)</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Jumlah Bilangan</th>
|
|
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Jumlah Pembiayaan (RM)</th>
|
|
<!-- <th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-xs font-semibold text-gray-600 uppercase tracking-wider">Action</th> -->
|
|
</tr>
|
|
</thead>
|
|
@php
|
|
$totalbilgadaikes = 0; // KES
|
|
$totalbilgadai = 0; // LAMA
|
|
$totalbilgadai2 = 0; // BARU
|
|
$totalpinjamankes = 0; // KES
|
|
$totalpinjaman = 0; // LAMA
|
|
$totalpinjaman2 = 0; // BARU
|
|
|
|
$totalAllGadaian = 0; // SEMUA
|
|
$totalAllPinjaman = 0; // SEMUA
|
|
@endphp
|
|
<tbody>
|
|
@forelse ($outstanding as $outs)
|
|
@php
|
|
$totalbilgadaikes += $outs['total_gadaian_kes'];
|
|
$totalpinjamankes += $outs['sum_pinjaman_kes'];
|
|
$totalbilgadai += $outs['total_gadaian'];
|
|
$totalpinjaman += $outs['sum_pinjaman'];
|
|
$totalbilgadai2 += $outs['total_gadaian2'];
|
|
$totalpinjaman2 += $outs['sum_pinjaman2'];
|
|
|
|
$totalAllGadaian += $outs['total_gadaian_all'];
|
|
$totalAllPinjaman += $outs['sum_pinjaman_all'];
|
|
@endphp
|
|
<tr>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $loop->iteration }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $outs['kodcaw'] }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $outs['details_caw'] }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $outs['total_gadaian_kes'] }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ number_format($outs['sum_pinjaman_kes'], 2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $outs['total_gadaian'] }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ number_format($outs['sum_pinjaman'], 2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $outs['total_gadaian2'] }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ number_format($outs['sum_pinjaman2'], 2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ $outs['total_gadaian_all'] }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">{{ number_format($outs['sum_pinjaman_all'], 2) }}</td>
|
|
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="8" class="px-5 py-5 border-b border-gray-200 bg-white text-sm text-center text-gray-500">Data not available</td>
|
|
</tr>
|
|
@endforelse
|
|
<tr class="font-semibold bg-gray-50">
|
|
<td colspan="3" class="px-5 py-5 border-b border-gray-200 text-sm">Jumlah Keseluruhan</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ $totalbilgadaikes }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ number_format($totalpinjamankes,2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ $totalbilgadai }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ number_format($totalpinjaman,2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ $totalbilgadai2 }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ number_format($totalpinjaman2,2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ $totalAllGadaian }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm">{{ number_format($totalAllPinjaman,2) }}</td>
|
|
<td class="px-5 py-5 border-b border-gray-200 text-sm"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
@include('layouts.footer')
|
|
</div>
|
|
@endsection
|
|
|
|
<script>
|
|
function setAction(action) {
|
|
document.getElementById('formAction').value = action;
|
|
document.getElementById('formoutstanding').submit();
|
|
}
|
|
</script>
|