diff --git a/app/Http/Controllers/BayaranController.php b/app/Http/Controllers/BayaranController.php index 4546c9f..0d4fee9 100644 --- a/app/Http/Controllers/BayaranController.php +++ b/app/Http/Controllers/BayaranController.php @@ -255,10 +255,13 @@ class BayaranController extends Controller $gadai = $gadai_details[0][0]; // Load a view and pass data to it - $pdf = PDF::loadView('pembayaran.resit.resitpdf', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai')); + if($request->jenis == 'pdf'){ + $pdf = PDF::loadView('pembayaran.resit.resitpdf', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai')); + return $pdf->stream('resit_pembayaran.pdf'); + }else{ + return view('pembayaran.resit.resitpdf', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai')); + } - // Return the generated PDF (inline display in browser) - return $pdf->stream('resit_pembayaran.pdf'); } public function callback(Request $request) diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 09e6482..6ab7fde 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -91,10 +91,10 @@ class ProfileController extends Controller // dd($gadai_details); - // return view('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')); - $pdf = PDF::loadView('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')) - ->setPaper('a4', 'potrait'); - return $pdf->download('Surat Wakil.pdf'); + return view('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')); + // $pdf = PDF::loadView('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')) + // ->setPaper('a4', 'potrait'); + // return $pdf->download('Surat Wakil.pdf'); } else { // insert into wakil_surat @@ -145,10 +145,10 @@ class ProfileController extends Controller // ->setPaper('A4','potrait'); // return $pdf->download('notislelong_'.'.pdf'); - // return view('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')); - $pdf = PDF::loadView('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')) - ->setPaper('a4', 'potrait'); - return $pdf->download('Surat Wakil.pdf'); + return view('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')); + // $pdf = PDF::loadView('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri')) + // ->setPaper('a4', 'potrait'); + // return $pdf->download('Surat Wakil.pdf'); } } } diff --git a/resources/views/pembayaran/resit/resitpdf.blade.php b/resources/views/pembayaran/resit/resitpdf.blade.php index c8482cd..8ea0c0c 100644 --- a/resources/views/pembayaran/resit/resitpdf.blade.php +++ b/resources/views/pembayaran/resit/resitpdf.blade.php @@ -89,5 +89,11 @@ + diff --git a/resources/views/pembayaran/resit/resitportal.blade.php b/resources/views/pembayaran/resit/resitportal.blade.php index 79e8b43..a1ec209 100644 --- a/resources/views/pembayaran/resit/resitportal.blade.php +++ b/resources/views/pembayaran/resit/resitportal.blade.php @@ -126,13 +126,14 @@ -
+
@csrf + Kembali Muka Hadapan