update task uum bycaw
This commit is contained in:
@@ -122,6 +122,12 @@
|
||||
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Data Pelanggan</h2>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
class="bg-white ml-2 shadow border border-solid px-6 py-4 rounded-lg hover:bg-yellow-300 hover:transition-all mb-2 cursor-pointer">
|
||||
<a href="{{ route('reports.dataPelangganBycaw.index', ['startDate' => now()->toDateString(), 'endDate' => now()->toDateString()]) }}" class="">
|
||||
<h2 class="mx-auto text-center font-bold text-2xl uppercase">Data Pelanggan By Cawangan</h2>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
@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 --}}
|
||||
<breadcrumb
|
||||
:items="[
|
||||
{ 'title': 'Laporan Keseluruhan', 'icon': 'fas fa-users', 'url': '{{ route('reports') }}' },
|
||||
{ 'title': 'Data Pelanggan By Cawangan', 'icon': 'fas fa-users' }
|
||||
]">
|
||||
</breadcrumb>
|
||||
|
||||
<div class="container">
|
||||
|
||||
{{-- Error Alert --}}
|
||||
@if ($errors->any())
|
||||
<div class="flex justify-center mb-4">
|
||||
<div class="flex items-center p-4 text-red-800 border-t-4 border-red-300 bg-red-50 px-10"
|
||||
role="alert">
|
||||
<svg class="w-4 h-4" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
||||
viewBox="0 0 20 20">
|
||||
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Z"/>
|
||||
</svg>
|
||||
<div class="ml-3 text-sm font-medium">
|
||||
@foreach ($errors->all() as $error)
|
||||
{{ $error }}
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex w-full">
|
||||
<div class="xl:w-2/3 2xl:w-1/2 p-8 mx-auto">
|
||||
|
||||
{{-- Header --}}
|
||||
<div class="bg-yellow-600 text-gray-200 text-lg px-6 py-4 rounded-t-lg">
|
||||
<a href="{{ route('reports') }}">
|
||||
<i class="fas fa-backspace text-white"></i>
|
||||
</a>
|
||||
<span class="text-white font-bold ml-2">
|
||||
Laporan Data Pelanggan By Cawangan
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{{-- FORM --}}
|
||||
<form method="GET"
|
||||
id="formStokAudit"
|
||||
action="{{ route('reports.dataPelangganBycaw.show') }}">
|
||||
|
||||
<iframe name="downloadFrame" class="hidden"></iframe>
|
||||
|
||||
<div class="rounded bg-white shadow p-6">
|
||||
|
||||
{{-- Tahun --}}
|
||||
<div class="pb-6">
|
||||
<label class="font-semibold text-gray-700 block pb-1">
|
||||
Tahun Laporan
|
||||
</label>
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-gray-600 border rounded-l px-4 py-2 bg-gray-50">
|
||||
Tahun
|
||||
</span>
|
||||
|
||||
<select name="year"
|
||||
id="report_year"
|
||||
class="border border-l-0 rounded-r px-4 py-2 w-40 mr-4"
|
||||
required>
|
||||
<option value="">-- Pilih Tahun --</option>
|
||||
@for ($y = now()->year; $y >= 2019; $y--)
|
||||
<option value="{{ $y }}">{{ $y }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
|
||||
{{-- Hidden generate type --}}
|
||||
<input type="radio" name="generateType" id="generateTypePdf" value="pdf" hidden>
|
||||
<input type="radio" name="generateType" id="generateTypeExcel" value="excel" hidden>
|
||||
|
||||
{{-- Excel --}}
|
||||
<button type="button" id="generateExcel"
|
||||
class="border border-yellow-600 text-yellow-600 py-2 px-6
|
||||
rounded-xl hover:bg-yellow-600 hover:text-white transition-all">
|
||||
<i class="fas fa-file-excel mr-2"></i> Excel
|
||||
</button>
|
||||
|
||||
{{-- PDF --}}
|
||||
<button type="button" id="generatePdf"
|
||||
class="border border-yellow-600 text-yellow-600 py-2 px-6 ml-4
|
||||
rounded-xl hover:bg-yellow-600 hover:text-white transition-all">
|
||||
<i class="fas fa-eye mr-2"></i> View
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Pilih Cawangan --}}
|
||||
<div class="pb-6">
|
||||
<label class="font-semibold text-gray-700 block pb-2">
|
||||
Pilih Cawangan
|
||||
</label>
|
||||
|
||||
{{-- Select All --}}
|
||||
<div class="mb-2">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox" id="checkAllCawangan"
|
||||
class="rounded border-gray-300">
|
||||
<span class="ml-2 text-sm font-medium">Pilih Semua</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="cawanganContainer"
|
||||
class="grid grid-cols-2 gap-3 max-h-64 overflow-y-auto
|
||||
border rounded p-4 bg-gray-50 text-sm text-gray-500">
|
||||
Memuatkan senarai cawangan...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@include('layouts.footer')
|
||||
</div>
|
||||
|
||||
{{-- Loading Overlay --}}
|
||||
<div id="loadingOverlay"
|
||||
class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center">
|
||||
<div class="bg-white p-6 rounded-xl flex flex-col items-center">
|
||||
<svg class="animate-spin h-10 w-10 text-yellow-600 mb-4"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10"
|
||||
stroke="currentColor" stroke-width="4"></circle>
|
||||
</svg>
|
||||
<span class="text-gray-700 font-semibold">
|
||||
Sedang menjana laporan..
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('additional_scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const form = document.getElementById('formStokAudit');
|
||||
const loading = document.getElementById('loadingOverlay');
|
||||
|
||||
const container = document.getElementById('cawanganContainer');
|
||||
const checkAll = document.getElementById('checkAllCawangan');
|
||||
|
||||
let downloadFrame = null;
|
||||
let forceHideTimeout = null;
|
||||
|
||||
// =====================
|
||||
// Fetch Cawangan API
|
||||
// =====================
|
||||
fetch("{{ config('api.url') }}/api/cawangan")
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
container.innerHTML = '';
|
||||
if (!data.length) {
|
||||
container.innerHTML = '<span class="text-gray-400">Tiada cawangan</span>';
|
||||
return;
|
||||
}
|
||||
data.forEach(caw => {
|
||||
container.innerHTML += `
|
||||
<label class="flex items-center space-x-2">
|
||||
<input type="checkbox"
|
||||
name="cawangan[]"
|
||||
value="${caw.kodcaw}"
|
||||
class="cawangan-item rounded border-gray-300">
|
||||
<span>${caw.kodcaw} - ${caw.details_caw}</span>
|
||||
</label>
|
||||
`;
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
container.innerHTML = '<span class="text-red-500">Gagal load cawangan</span>';
|
||||
});
|
||||
|
||||
// =====================
|
||||
// Select All Checkbox
|
||||
// =====================
|
||||
checkAll.addEventListener('change', function () {
|
||||
document.querySelectorAll('.cawangan-item').forEach(cb => cb.checked = this.checked);
|
||||
});
|
||||
|
||||
// =====================
|
||||
// Submit Form Function
|
||||
// =====================
|
||||
function submitForm(isExcel = false) {
|
||||
|
||||
if (document.querySelectorAll('.cawangan-item:checked').length === 0) {
|
||||
alert('Sila pilih sekurang-kurangnya satu cawangan');
|
||||
return;
|
||||
}
|
||||
|
||||
// set generateType
|
||||
if (isExcel) document.getElementById('generateTypeExcel').checked = true;
|
||||
else document.getElementById('generateTypePdf').checked = true;
|
||||
|
||||
// Show loading
|
||||
loading.classList.remove('hidden');
|
||||
|
||||
// Excel via iframe
|
||||
if (isExcel) {
|
||||
if (downloadFrame) downloadFrame.remove();
|
||||
downloadFrame = document.createElement('iframe');
|
||||
downloadFrame.name = 'downloadFrame';
|
||||
downloadFrame.style.display = 'none';
|
||||
document.body.appendChild(downloadFrame);
|
||||
form.target = 'downloadFrame';
|
||||
} else {
|
||||
form.removeAttribute('target');
|
||||
}
|
||||
|
||||
form.submit();
|
||||
|
||||
// Hide overlay after max 15 sec
|
||||
forceHideTimeout = setTimeout(() => loading.classList.add('hidden'), 15000);
|
||||
}
|
||||
|
||||
// =====================
|
||||
// Button Handlers
|
||||
// =====================
|
||||
document.getElementById('generateExcel').addEventListener('click', () => submitForm(true));
|
||||
document.getElementById('generatePdf').addEventListener('click', () => submitForm(false));
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,247 @@
|
||||
<style>
|
||||
#header {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#header td, #customers th {
|
||||
|
||||
padding:4px;
|
||||
font-size:10px;
|
||||
}
|
||||
|
||||
#header tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#header tr:hover {background-color: #030101;}
|
||||
|
||||
#header th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
#scan {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
|
||||
#scan th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<style>
|
||||
#scan {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#scan td, #scan th {
|
||||
border-collapse: collapse;
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#scan tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#scan tr:hover {background-color: #ddd;}
|
||||
|
||||
#scan th {
|
||||
border-collapse: collapse;
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
#details {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#details td, #details th {
|
||||
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
}
|
||||
|
||||
#details tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#details tr:hover {background-color: #ddd;}
|
||||
|
||||
#details th {
|
||||
padding-top: 12px;
|
||||
font-style:bold;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
#sign {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#sign td, #sign th {
|
||||
|
||||
padding: 8px;
|
||||
font-size:11px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#sign tr:nth-child(even){background-color: #ffffff;}
|
||||
|
||||
#sign tr:hover {background-color: #ddd;}
|
||||
|
||||
#sign th {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
text-align: left;
|
||||
padding:4px;
|
||||
color:black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table id="header">
|
||||
<tr>
|
||||
<th rowspan="4" style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img></th>
|
||||
<th colspan="1">KOPERASI PERMODALAN KELANTAN BERHAD</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Semua Cawangan</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<table id="scan">
|
||||
<tr>
|
||||
<th colspan="6"><b>Laporan Data Pelanggan</b></th>
|
||||
<th colspan="3" style="text-align:right">
|
||||
<b>Tarikh Cetak:</b> {{ $tarikh_cetak }}
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="width:120px"><b>TAHUN LAPORAN</b></td>
|
||||
<td colspan="8">{{ $tebus_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<table id="details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Cawangan</th>
|
||||
<!-- <th>Nama Pelanggan</th> -->
|
||||
<th>No.Pelanggan</th>
|
||||
<th>Umur</th>
|
||||
<th>Jantina</th>
|
||||
<th>Pekerjaan</th>
|
||||
<th>Lokasi</th>
|
||||
<th>Tempoh Pajakan</th>
|
||||
<th>Tarikh Mula</th>
|
||||
<th>Tarikh Tamat</th>
|
||||
<th>Hari Sejak Transaksi Terakhir</th>
|
||||
<th>Bil Transaksi</th>
|
||||
<th>Bil Outstanding</th>
|
||||
<th>Bil Tebus</th>
|
||||
<th>Jumlah Pinjaman (RM)</th>
|
||||
<th>Jumlah Ujrah (RM)</th>
|
||||
<th>Tujuan Gadaian</th>
|
||||
<th>Status Aktif</th>
|
||||
<th>Cara Bayaran</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($pelanggan as $index => $row)
|
||||
<tr>
|
||||
<td>{{ $index + 1 }}</td>
|
||||
<td>{{ $row['cawangan'] }}</td>
|
||||
<!-- <td>{{ strtoupper($row['nama']) }}</td> -->
|
||||
<td>{{ $row['nopelanggan'] }}</td>
|
||||
<td>{{ $row['umur'] }}</td>
|
||||
<td>{{ $row['jantina'] }}</td>
|
||||
<td>{{ $row['pekerjaan'] }}</td>
|
||||
<td>{{ $row['daerah'] }}</td>
|
||||
<td>{{ $row['tempoh_pajakan'] }}</td>
|
||||
<td>{{ $row['tarikh_mula'] }}</td>
|
||||
<td>{{ $row['tarikh_tamat'] }}</td>
|
||||
<td>{{ $row['hari_sejak_transaksi'] }}</td>
|
||||
<td>{{ $row['bil_transaksi'] }}</td>
|
||||
<td>{{ $row['bil_outstanding'] }}</td>
|
||||
<td>{{ $row['bil_tebus'] }}</td>
|
||||
<td>{{ number_format($row['jumlah_pinjaman'], 2) }}</td>
|
||||
<td>{{ number_format($row['jumlah_ujrah'], 2) }}</td>
|
||||
<td>{{ $row['tujuan_gadai'] }}</td>
|
||||
<td>{{ $row['status_aktif'] }}</td>
|
||||
<td>{{ $row['cara_bayaran'] }}</td>
|
||||
<td>{{ $row['tarikh_lelong'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<table id="sign">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"> .................................................................. </td>
|
||||
<td> </td>
|
||||
<td colspan="2">.................................................................. </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"><B> DI SEMAK</B> </td>
|
||||
<td> </td>
|
||||
<td colspan="2"><B>DI SAHKAN </B></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user