feat: add pdf for primayan medicare
This commit is contained in:
@@ -488,6 +488,7 @@ class RequestLogController extends Controller
|
||||
'members.birth_date',
|
||||
'members.member_id',
|
||||
'members.gender',
|
||||
'corporate_employees.branch_code',
|
||||
DB::raw('
|
||||
(Select persons.nik FROM persons WHERE persons.id = members.person_id LIMIT 1) AS nik
|
||||
'),
|
||||
@@ -535,6 +536,7 @@ class RequestLogController extends Controller
|
||||
'members.members_effective_date AS mulai',
|
||||
'members.members_expire_date AS akhir'
|
||||
)
|
||||
->leftJoin('corporate_employees', 'corporate_employees.member_id', '=', 'members.id')
|
||||
->first();
|
||||
$data['namaKaryawan'] = '';
|
||||
if($dataMember->principal_id)
|
||||
@@ -613,6 +615,44 @@ class RequestLogController extends Controller
|
||||
|
||||
$data['signatureAd'] = $signatureAd;
|
||||
|
||||
$namaPenjaminTtd = $dataMember->nama_perusahaan;
|
||||
|
||||
$isVale = ($logoPerusahaan->code ?? null) === "VALEIND";
|
||||
$ttdNama = '';
|
||||
$ttdJabatan = '';
|
||||
$ttdImage = null;
|
||||
|
||||
if ($isVale) {
|
||||
if ($dataRequestLog->submission_date <= '2025-05-12') {
|
||||
$ttdNama = 'Dr. Hery Hermas, M.Kes';
|
||||
$ttdImage = public_path('images/ttd_dr_vale.png');
|
||||
} else {
|
||||
$ttdNama = 'dr. Irmawati Baso, S. Ked., MM';
|
||||
$ttdImage = public_path('images/ttd_dr_irma_2.png');
|
||||
}
|
||||
|
||||
$ttdJabatan = 'Offsite Medical Treatment';
|
||||
|
||||
} else {
|
||||
$ttdNama = 'Fariz Ariyadi';
|
||||
$ttdJabatan = 'Chief Executive Officer';
|
||||
$ttdImage = public_path('images/ttd_fariz.png');
|
||||
}
|
||||
|
||||
$data['ttdNama'] = $ttdNama;
|
||||
$data['ttdJabatan'] = $ttdJabatan;
|
||||
$data['ttdImage'] = $ttdImage;
|
||||
|
||||
if (!$isVale) {
|
||||
$namaPenjaminTtd = 'Primayan Medicare';
|
||||
}
|
||||
|
||||
$data['namaPenjaminTtd'] = $namaPenjaminTtd;
|
||||
|
||||
if (!$isVale) {
|
||||
$data['penjamin'] = 'Primayan Medicare';
|
||||
}
|
||||
|
||||
$pdf = new Dompdf();
|
||||
|
||||
$options = new Options();
|
||||
@@ -623,25 +663,47 @@ class RequestLogController extends Controller
|
||||
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.req_log_page_1', $data);
|
||||
if (!$isVale) {
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.req_log_page_1_primayan', $data);
|
||||
|
||||
// Halaman 2
|
||||
// $html2 = view('pdf.req_log_page_2', $data);
|
||||
// Halaman 2
|
||||
// $html2 = view('pdf.req_log_page_2', $data);
|
||||
|
||||
// Gabung konten HTML dari dua tampilan
|
||||
// $htmlCombined = $html1 . $html2;
|
||||
$htmlCombined = $html1;
|
||||
// Gabung konten HTML dari dua tampilan
|
||||
// $htmlCombined = $html1 . $html2;
|
||||
$htmlCombined = $html1;
|
||||
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
|
||||
return response($pdf->output(), 200, $headers);
|
||||
return response($pdf->output(), 200, $headers);
|
||||
} else {
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.req_log_page_1', $data);
|
||||
|
||||
// Halaman 2
|
||||
// $html2 = view('pdf.req_log_page_2', $data);
|
||||
|
||||
// Gabung konten HTML dari dua tampilan
|
||||
// $htmlCombined = $html1 . $html2;
|
||||
$htmlCombined = $html1;
|
||||
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
|
||||
return response($pdf->output(), 200, $headers);
|
||||
}
|
||||
}
|
||||
|
||||
public function downlodFinalLog($request_log_id)
|
||||
@@ -660,6 +722,7 @@ class RequestLogController extends Controller
|
||||
'members.birth_date',
|
||||
'members.member_id',
|
||||
'members.gender',
|
||||
'corporate_employees.branch_code',
|
||||
DB::raw('
|
||||
(Select persons.nik FROM persons WHERE persons.id = members.person_id LIMIT 1) AS nik
|
||||
'),
|
||||
@@ -707,6 +770,7 @@ class RequestLogController extends Controller
|
||||
'members.members_effective_date AS mulai',
|
||||
'members.members_expire_date AS akhir'
|
||||
)
|
||||
->leftJoin('corporate_employees', 'corporate_employees.member_id', '=', 'members.id')
|
||||
->first();
|
||||
$data['namaKaryawan'] = '';
|
||||
if($dataMember->principal_id)
|
||||
@@ -809,6 +873,44 @@ class RequestLogController extends Controller
|
||||
|
||||
$data['signatureAd'] = $signatureAd;
|
||||
|
||||
$namaPenjaminTtd = $dataMember->nama_perusahaan;
|
||||
|
||||
$isVale = ($logoPerusahaan->code ?? null) === "VALEIND";
|
||||
$ttdNama = '';
|
||||
$ttdJabatan = '';
|
||||
$ttdImage = null;
|
||||
|
||||
if ($isVale) {
|
||||
if ($dataRequestLog->submission_date <= '2025-05-12') {
|
||||
$ttdNama = 'Dr. Hery Hermas, M.Kes';
|
||||
$ttdImage = public_path('images/ttd_dr_vale.png');
|
||||
} else {
|
||||
$ttdNama = 'dr. Irmawati Baso, S. Ked., MM';
|
||||
$ttdImage = public_path('images/ttd_dr_irma_2.png');
|
||||
}
|
||||
|
||||
$ttdJabatan = 'Offsite Medical Treatment';
|
||||
|
||||
} else {
|
||||
$ttdNama = 'Fariz Ariyadi';
|
||||
$ttdJabatan = 'Chief Executive Officer';
|
||||
$ttdImage = public_path('images/ttd_fariz.png');
|
||||
}
|
||||
|
||||
$data['ttdNama'] = $ttdNama;
|
||||
$data['ttdJabatan'] = $ttdJabatan;
|
||||
$data['ttdImage'] = $ttdImage;
|
||||
|
||||
if (!$isVale) {
|
||||
$namaPenjaminTtd = 'Primayan Medicare';
|
||||
}
|
||||
|
||||
$data['namaPenjaminTtd'] = $namaPenjaminTtd;
|
||||
|
||||
if (!$isVale) {
|
||||
$data['penjamin'] = 'Primayan Medicare';
|
||||
}
|
||||
|
||||
$dataDiagnosis = [];
|
||||
if($dataRequestLog->diagnosis)
|
||||
{
|
||||
@@ -825,6 +927,9 @@ class RequestLogController extends Controller
|
||||
|
||||
$data['dataDiagnosis'] = $dataDiagnosis;
|
||||
|
||||
if (($logoPerusahaan->code ?? null) !== "VALEIND") {
|
||||
$data['penjamin'] = 'Primayan Medicare';
|
||||
}
|
||||
|
||||
$pdf = new Dompdf();
|
||||
|
||||
@@ -834,24 +939,45 @@ class RequestLogController extends Controller
|
||||
$options->set(['isRemoteEnabled' => true]);
|
||||
$pdf->setOptions($options);
|
||||
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.final_log_page_1', $data);
|
||||
if (!$isVale) {
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.final_log_page_1_primayan', $data);
|
||||
|
||||
// Halaman 2
|
||||
$html2 = view('pdf.final_log_page_2', $data);
|
||||
// Halaman 2
|
||||
$html2 = view('pdf.final_log_page_2_primayan', $data);
|
||||
|
||||
// Gabung konten HTML dari dua tampilan
|
||||
$htmlCombined = $html1 . $html2;
|
||||
// Gabung konten HTML dari dua tampilan
|
||||
$htmlCombined = $html1 . $html2;
|
||||
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
|
||||
return response($pdf->output(), 200, $headers);
|
||||
return response($pdf->output(), 200, $headers);
|
||||
} else {
|
||||
// Halaman 1
|
||||
$html1 = view('pdf.final_log_page_1', $data);
|
||||
|
||||
// Halaman 2
|
||||
$html2 = view('pdf.final_log_page_2', $data);
|
||||
|
||||
// Gabung konten HTML dari dua tampilan
|
||||
$htmlCombined = $html1 . $html2;
|
||||
|
||||
$pdf->loadHtml($htmlCombined);
|
||||
$pdf->render();
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => 'application/pdf',
|
||||
'Content-Disposition' => 'inline; filename="file.pdf"',
|
||||
];
|
||||
|
||||
return response($pdf->output(), 200, $headers);
|
||||
}
|
||||
}
|
||||
|
||||
public function submitClaims(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user