added kak aida request untuk sttebus dan customer dalam saghilang

This commit is contained in:
Hafifie PKB
2025-01-14 12:36:37 +08:00
parent 6923efb66b
commit 1469fd9965
2 changed files with 22 additions and 7 deletions
+5 -3
View File
@@ -1741,18 +1741,20 @@ class AkaunController extends Controller
$cawangan = Http::get($request->hostname . '/api/cawangan/detail/'. $request->kodcaw)->json();
$cawangan_detail=$cawangan[0];
$hostname = $request->hostname;
if(isset($request->jenis))
{
if($request->jenis == 'pdf')
{
$pdf = PDF::loadView('akaun.laporan_saghilang', compact('polis','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait');
$pdf = PDF::loadView('akaun.laporan_saghilang', compact('hostname','polis','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait');
return $pdf->download('laporan_saghilang_' . $request->kodcaw .'_'. $mula_date .'_'. $hingga_date . '.pdf');
}else{
return view('akaun.laporan_saghilang', compact('polis','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
return view('akaun.laporan_saghilang', compact('hostname','polis','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
}
}
return view('akaun.laporan_saghilang', compact('polis','cawangan_detail','mula_date','hingga_date','tarikh_cetak','api_url'));
return view('akaun.laporan_saghilang', compact('hostname','polis','cawangan_detail','mula_date','hingga_date','tarikh_cetak','api_url'));
}
@@ -193,7 +193,7 @@
<td> </td>
</tr>
<tr>
{{-- <th style="width:20px"> <b>TARIKH:</b></th>
<th style="width:20px"> <b>TARIKH:</b></th>
<th>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $mula_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
@@ -204,7 +204,7 @@
$myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate);
@endphp</th> --}}
@endphp</th>
<td> </td>
<td> </td>
<td> </td>
@@ -218,24 +218,37 @@
<table id="details">
<tr>
<th>Bil</th>
<th>Tarikh</th>
<th>IC Pelanggan</th>
<th>Nama Pelanggan</th>
<th>Norujukan</th>
<th>Alasan</th>
<th>PC/PPC</th>
<th>Daerah</th>
<th>Negeri</th>
<th>Status Tebus</th>
<th>Tarikh Trans. Terakhir</th>
</tr>
@foreach($polis as $index=>$sh)
<tr>
<td>{{ $loop->iteration}}</td>
<td> {{ $sh['tarikh'] }}</td>
<td> {{ $sh['nokp'] }}</td>
@php
$noic = Http::withOptions(['verify' => config('app.api_verify')])->get($hostname . '/api/customers/' .$sh['nokp'] )->json();
@endphp
<td> {{ $noic['nama'] }} </td>
<td> {{ $sh['norujukan'] }}</td>
<td> {{ $sh['komen1'] }}</td>
<td> {{ $sh['teller'] }}</td>
@php
$koddaerah = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/daerah/' .$sh['koddaerah'] )->json();
$kodnegeri = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/api/negeri/' .$sh['kodnegeri'] )->json();
$koddaerah = Http::withOptions(['verify' => config('app.api_verify')])->get($hostname . '/api/daerah/' .$sh['koddaerah'] )->json();
$kodnegeri = Http::withOptions(['verify' => config('app.api_verify')])->get($hostname . '/api/negeri/' .$sh['kodnegeri'] )->json();
@endphp
<td> {{ $koddaerah['namadaerah'] }}</td>
<td> {{ $kodnegeri['negeri'] }}</td>
<td> {{ $sh['sttebus'] }}</td>
<td> {{ $sh['t_update'] }}</td>
</tr>
@endforeach
</table>