perbaikan print out dan foto
This commit is contained in:
@@ -586,6 +586,7 @@ class PenilaiController extends Controller
|
||||
$documentId = $request->query('documentId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$statusLpj = $request->query('statusLpj');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
@@ -609,33 +610,40 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
try {
|
||||
$pdf = PDF::loadView('lpj::penilai.components.print-out', compact(
|
||||
'permohonan',
|
||||
'forminspeksi',
|
||||
'lpjData',
|
||||
'formFoto',
|
||||
'basicData',
|
||||
'inspeksi',
|
||||
'lpj'
|
||||
));
|
||||
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
// if ($statusLpj) {
|
||||
// return view('lpj::penilai.components.print-out-laporan', compact(
|
||||
// 'permohonan',
|
||||
// 'forminspeksi',
|
||||
// 'lpjData',
|
||||
// 'formFoto',
|
||||
// 'basicData',
|
||||
// 'inspeksi',
|
||||
// 'lpj',
|
||||
// 'statusLpj'
|
||||
// ));
|
||||
// }else{
|
||||
$pdf = PDF::loadView('lpj::penilai.components.print-out-laporan', compact(
|
||||
'permohonan',
|
||||
'forminspeksi',
|
||||
'lpjData',
|
||||
'formFoto',
|
||||
'basicData',
|
||||
'inspeksi',
|
||||
'lpj',
|
||||
'statusLpj'
|
||||
));
|
||||
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
return $pdf->download('laporan.pdf');
|
||||
// }
|
||||
|
||||
return $pdf->download('laporan.pdf');
|
||||
} catch (\Exception $e) {
|
||||
Log::error('PDF generation failed: ' . $e->getMessage());
|
||||
return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.'], 500);
|
||||
}
|
||||
|
||||
// return view('lpj::penilai.components.print-out', compact(
|
||||
// 'permohonan',
|
||||
// 'forminspeksi',
|
||||
// 'lpjData',
|
||||
// 'formFoto',
|
||||
// 'basicData',
|
||||
// 'inspeksi',
|
||||
// 'lpj'
|
||||
// ));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user