fix(print-out): perbaikan foto
This commit is contained in:
@@ -248,7 +248,7 @@ class PenilaiController extends Controller
|
||||
public function edit($id)
|
||||
{
|
||||
$permohonan = Permohonan::with('debiture')->find($id);
|
||||
return view('lpj::penilai.edit',compact('permohonan'));
|
||||
return view('lpj::penilai.edit', compact('permohonan'));
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ class PenilaiController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
if($request->hasFile('file_paparan')) {
|
||||
if ($request->hasFile('file_paparan')) {
|
||||
$file = $request->file('file_paparan');
|
||||
$path = $file->store('public/file_paparan');
|
||||
|
||||
@@ -282,10 +282,10 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('penilai.show',['id'=>$id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.');
|
||||
->route('penilai.show', ['id' => $id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->route('penilai.show',['id'=>$id])->with('error', 'Terjadi kesalahan saat memproses permohonan.');
|
||||
return redirect()->route('penilai.show', ['id' => $id])->with('error', 'Terjadi kesalahan saat memproses permohonan.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,9 +379,18 @@ class PenilaiController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return view('lpj::penilai.components.rap-penilai', compact('permohonan', 'rap', 'provinces', 'cities',
|
||||
return view('lpj::penilai.components.rap-penilai', compact(
|
||||
'permohonan',
|
||||
'rap',
|
||||
'provinces',
|
||||
'cities',
|
||||
'districts',
|
||||
'villages','forminspeksi', 'nomorLaporan', 'basicData','cekAlamat'));
|
||||
'villages',
|
||||
'forminspeksi',
|
||||
'nomorLaporan',
|
||||
'basicData',
|
||||
'cekAlamat'
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -1052,8 +1061,12 @@ class PenilaiController extends Controller
|
||||
'rap'
|
||||
));
|
||||
// return $pdf;
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
return $pdf->stream();
|
||||
return response($pdf->output(), 200)
|
||||
->header('Content-Type', 'application/pdf')
|
||||
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' .$permohonan->debiture->name . '_' . $cleanNomorLaporan .'.pdf"');
|
||||
// return $pdf->stream();
|
||||
} else {
|
||||
// $pdf = view('lpj::' . $viewLaporan, compact(
|
||||
$pdf = PDF::loadView('lpj::' . $viewLaporan, compact(
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
'foto_rute_lainnya' => [
|
||||
'key' => 'name_rute_lainnya',
|
||||
'name_prefix' => '',
|
||||
'nested' => false,
|
||||
'nested' => true,
|
||||
],
|
||||
'foto_lingkungan' => [
|
||||
'key' => 'foto_lingkungan',
|
||||
@@ -36,33 +36,91 @@
|
||||
$hasPhotos = false;
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
.photo-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
<style>
|
||||
/* General Styles */
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.photo-item {
|
||||
width: 100%; /* Adjust to fit two photos per row */
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.photo-item img {
|
||||
width: 80%;
|
||||
height: auto;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
.photo-container {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
clear: both;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.photo-row {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.photo-item {
|
||||
width: 48%;
|
||||
margin-right: 2%;
|
||||
float: left;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.photo-item:nth-child(2n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
/* Image Styling */
|
||||
.photo-item img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
object-fit: cover;
|
||||
|
||||
}
|
||||
|
||||
/* Clearfix */
|
||||
.clearfix::after {
|
||||
content: "";
|
||||
clear: both;
|
||||
display: table;
|
||||
}
|
||||
|
||||
/* Media Print */
|
||||
@media print {
|
||||
.photo-item {
|
||||
width: 48%;
|
||||
margin-right: 2%;
|
||||
float: left;
|
||||
padding: 5px;
|
||||
box-sizing: border-box;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.photo-item img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@foreach ($photoSections as $sectionKey => $sectionConfig)
|
||||
@if ($sectionKey === 'single_photos')
|
||||
<div class="photo-container">
|
||||
@php $counter = 0; @endphp
|
||||
@foreach ($sectionConfig as $photoKey => $photoName)
|
||||
@if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey]))
|
||||
@php
|
||||
$imagePath = storage_path('app/public/' . $formFoto[$photoKey]);
|
||||
$hasPhotos = true;
|
||||
@endphp
|
||||
@if ($counter % 2 == 0)
|
||||
<div class="photo-row clearfix">
|
||||
@endif
|
||||
<div class="photo-item border">
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
{{ $photoName }}
|
||||
@@ -71,6 +129,10 @@
|
||||
<img src="{{ $imagePath }}" alt="{{ $photoName }}" class="photo-image">
|
||||
@endif
|
||||
</div>
|
||||
@if ($counter % 2 == 1 || $loop->last)
|
||||
</div> <!-- Tutup baris setelah 2 item atau di akhir loop -->
|
||||
@endif
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -83,11 +145,15 @@
|
||||
@if ($sectionConfig['nested'])
|
||||
@if (isset($sectionData[$sectionConfig['key']][0]))
|
||||
<div class="photo-container">
|
||||
@php $counter = 0; @endphp
|
||||
@foreach ($sectionData[$sectionConfig['key']][0] as $index => $item)
|
||||
@php
|
||||
$imagePath = storage_path('app/public/' . $item['path']);
|
||||
$hasPhotos = true;
|
||||
@endphp
|
||||
@if ($counter % 2 == 0)
|
||||
<div class="photo-row clearfix">
|
||||
@endif
|
||||
<div class="photo-item border">
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
{{ $sectionConfig['name_prefix']
|
||||
@@ -98,11 +164,16 @@
|
||||
<img src="{{ $imagePath }}" alt="{{ $item['path'] }}" class="photo-image">
|
||||
@endif
|
||||
</div>
|
||||
@if ($counter % 2 == 1 || $loop->last)
|
||||
</div> <!-- Tutup baris setelah 2 item atau di akhir loop -->
|
||||
@endif
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="photo-container">
|
||||
@php $counter = 0; @endphp
|
||||
@foreach ($sectionData as $index => $item)
|
||||
@php
|
||||
$name = $item[$sectionConfig['key']] ?? '';
|
||||
@@ -116,6 +187,9 @@
|
||||
|
||||
@if (!empty($name) || !empty($photoPath))
|
||||
@php $hasPhotos = true; @endphp
|
||||
@if ($counter % 2 == 0)
|
||||
<div class="photo-row clearfix">
|
||||
@endif
|
||||
<div class="photo-item border">
|
||||
@if (!empty($name))
|
||||
<h2 class="text-gray-600 font-semibold text-xl">
|
||||
@@ -126,6 +200,10 @@
|
||||
<img src="{{ $imagePath }}" alt="{{ $name ?: 'Foto' }}" class="photo-image">
|
||||
@endif
|
||||
</div>
|
||||
@if ($counter % 2 == 1 || $loop->last)
|
||||
</div> <!-- Tutup baris setelah 2 item atau di akhir loop -->
|
||||
@endif
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -92,17 +92,7 @@
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.photo-item {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.photo-image {
|
||||
max-width: 80%;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@@ -421,8 +411,8 @@
|
||||
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
|
||||
<footer id="footer">
|
||||
Cabang : {{ $permohonan->debiture->branch->name ?? '' }}
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1299,8 +1299,7 @@
|
||||
PETA
|
||||
</h6>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;">
|
||||
<div class="photo-container">
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
@@ -1309,28 +1308,36 @@
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (isset($forminspeksi))
|
||||
@php $counter = 0; @endphp
|
||||
@foreach ($fotoTypes as $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<div style="border: 1px solid #ddd; padding: 10px; text-align: center;">
|
||||
@if ($counter % 2 == 0)
|
||||
<div class="photo-row clearfix">
|
||||
@endif
|
||||
<div class="photo-items" style="float: left; width: 48%; margin-right: 2%; padding: 5px; text-align: center; border: 1px solid #ddd; page-break-inside: avoid;">
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}"
|
||||
alt="{{ $type }}"
|
||||
style="max-width: 100%; height: auto; margin-bottom: 10px;">
|
||||
style="width: 50%; height: 40%; object-fit: contain; margin-bottom: 10px;">
|
||||
<p style="margin: 0; font-size: 14px;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
</div>
|
||||
@if ($counter % 2 == 1 || $loop->last)
|
||||
</div>
|
||||
@endif
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border" style="text-align: center">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
}
|
||||
|
||||
* {
|
||||
font-size: 10px;
|
||||
font-size: 8px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -1331,14 +1331,14 @@
|
||||
|
||||
<tr>
|
||||
<td style="">Harga</td>
|
||||
<td style="">
|
||||
{{ formatRupiah($lpjData['asuransi_nilai_1']) ?? '' }}</td>
|
||||
<td style="">Rp.
|
||||
{{ $lpjData['asuransi_nilai_1'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="">Nilai Pasar Wajar (Rp)</td>
|
||||
|
||||
<td style="">
|
||||
{{ formatRupiah($lpjData['asuransi_nilai_2']) ?? '' }}</td>
|
||||
<td style="">Rp.
|
||||
{{$lpjData['asuransi_nilai_2'] ?? '' }}</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
@@ -1583,6 +1583,11 @@
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
|
||||
// if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
// $labelNilai['bangunan'] = 'Luas Unit';
|
||||
// unset($labelNilai['tanah']);
|
||||
// }
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
@@ -1848,7 +1853,7 @@
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-break"></div>
|
||||
<div class="section">
|
||||
<div class="judul">
|
||||
<h6 class="border">
|
||||
|
||||
Reference in New Issue
Block a user