From c450b8b475e8a61c6d9d47a91c94caa0fb478cb0 Mon Sep 17 00:00:00 2001
From: Amirah22 <94591077+Amirah22@users.noreply.github.com>
Date: Mon, 21 Feb 2022 08:39:12 +0800
Subject: [PATCH] download function
---
app/Http/Controllers/SerahanController.php | 35 ++-
resources/views/includes/sidebar.blade.php | 4 +-
resources/views/pdf/penyatabayaran.blade.php | 290 ++++++++-----------
resources/views/serahan/pembayaran.blade.php | 17 +-
routes/web.php | 2 +-
5 files changed, 162 insertions(+), 186 deletions(-)
diff --git a/app/Http/Controllers/SerahanController.php b/app/Http/Controllers/SerahanController.php
index 74b5ceff..67b91354 100644
--- a/app/Http/Controllers/SerahanController.php
+++ b/app/Http/Controllers/SerahanController.php
@@ -27,6 +27,8 @@ use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
+use App\Models\Payment;
+
class SerahanController extends Controller
{
/**
@@ -44,19 +46,44 @@ class SerahanController extends Controller
*
* @return \Illuminate\Contracts\Support\Renderable
*/
- public function pembayaran()
+
+
+ public function pembayaran()
{
- $lelong = Lelong::all();
- return view('serahan.pembayaran',compact('lelong'));
+ $payment= Payment::join('lelongbidder','payment.user_id','=','lelongbidder.user_id')
+ ->join('users','payment.user_id','=','users.id')
+ ->join('lelongbid','payment.lelongbid_id','=','lelongbid.id')
+
+ ->get();
+ // dd($payment);
+ return view('serahan.pembayaran',compact('payment'));
}
+
public function penyatabayaran(Request $request)
{
- $pdf = PDF::loadView('pdf.penyatabayaran')->setPaper('a4', 'landscape');
+ $payment_id = $request->paymentid;
+
+ $payment= Payment::join('lelongbidder','payment.user_id','=','lelongbidder.user_id')
+ ->join('users','payment.user_id','=','users.id')
+ ->join('lelongbid','payment.lelongbid_id','=','lelongbid.id')
+ // ->where('payment.user_id','=',$request->payment) // nnti tanya fifi tunggu dia sihat
+
+ ->get();
+
+ $pdf = PDF::loadView('pdf.penyatabayaran',compact('payment','payment_id'))
+ ->setPaper('a4', 'landscape');
return $pdf->download('Penyata Bayaran.pdf');
}
+
+
+
+
+
+
+
public function resitpembayaran(Request $request)
{
$pdf = PDF::loadView('pdf.resitpembayaran')->setPaper('a4', 'landscape');
diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php
index 3ca1f7bc..0c4673c3 100644
--- a/resources/views/includes/sidebar.blade.php
+++ b/resources/views/includes/sidebar.blade.php
@@ -62,14 +62,14 @@
- {{--
+
Notis Lelong
- --}}
+
@endhasrole
diff --git a/resources/views/pdf/penyatabayaran.blade.php b/resources/views/pdf/penyatabayaran.blade.php
index d9623b8b..2169a30d 100644
--- a/resources/views/pdf/penyatabayaran.blade.php
+++ b/resources/views/pdf/penyatabayaran.blade.php
@@ -1,188 +1,136 @@
-
-
-
- | Ar-Rahn Kota Belud |
- Invois |
-
-
- | Ground Floor, Lot 11, KKMP |
- No.Invois: :0002588 |
-
-
- | Kota Belud, Sabah. |
- Tarikh: 30/08/2021 |
-
-
- | Tel : 088-979599 |
- |
-
-
- | Faks : 088-255026 |
- Cawangan : Ar-Rahn Kota Belud |
-
-
-
-
-
- |
-
-
- | |
-
-
-
-
- | Nama |
- : |
- MOHD SAID BIN TAIB |
-
-
- | No.K/P |
- : |
- 830519125399 |
-
-
- | Alamat |
- : |
- KAMPUNG TAMAU KOTA BELUD |
-
-
- | No.Telefon |
- : |
- 0193749495 |
-
-
+ #marhun {
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ font-size:11px;
+ border-collapse: collapse;
+ width: 100%;
+ }
+
+ #marhun td, #marhun th {
+ border: 0px solid;
+ padding: 1px;
+
+ }
+
+
+ #marhun th {
+
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+
+ }
+
+
+
+
+ @foreach ($payment as $index=>$info)
+
+
+
+ | Ar-Rahn Kota Belud |
+ Invois |
+
+
+ | Ground Floor, Lot 11, KKMP |
+ No.Invois: :0002588 |
+
+
+ | Kota Belud, Sabah. |
+ Tarikh: 30/08/2021 |
+
+
+ | Tel : 088-979599 |
+ |
+
+
+ | Faks : 088-255026 |
+ Cawangan : Ar-Rahn Kota Belud |
+
+
+
-
- PENYATA BAYARAN LELONGAN
-
-
+
- | Bil |
- No. Rujukan |
- Jenis Barang |
- Berat(g) |
- Harga Bidaan(RM) |
-
-
-
+ |
+
- | 1. |
- 011232200714-0049 |
- 1- Cincin |
- 1.53 |
- 346.00 |
+ |
- | 2. |
- 011232200723-0039 |
- 1- Cincin |
- 2.90 |
- 647.00 |
+
+
+ | Nama |
+ : |
+ {{ $info['nama_bidder'] }} |
- | Jumlah Bayaran |
- 4.43 |
- 993.00 |
+ No.K/P |
+ : |
+ {{$info['nokp']}} |
-
+
+ | Alamat |
+ : |
+ {{$info['alamat']}} |
+
+
+ | No.Telefon |
+ : |
+ {{$info['notelbimbit']}} |
+
+
-
-
-
-
- SENARAI BAYARAN MENGIKUT AKAUN
+
+ PENYATA BAYARAN LELONGAN
-
-
- | Bil |
- Cawangan |
- Berat(g) |
- Harga Jual(RM) |
- Nama Bank |
- Pemegang Akaun |
- No.Akaun |
-
-
-
-
- | 1. |
- Ar-Rahn Kota Belud |
- 4.43 |
- 993.00 |
- Bank Muamalat Malaysia Berhad |
- Joint Venture MVSB and PKB-Kota Belud |
- 0301-0006119-71-3 |
-
-
-
-
-
- | Jumlah Bayaran |
- 993.00 |
- |
-
-
-
- *Sila Buat Pembayaran Mengikut Akaun |
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+ | Bil |
+ No. Rujukan |
+ Jenis Barang |
+ Berat(g) |
+ Harga Bidaan(RM) |
+
+
+
+
+ | {{$index+1}} |
+ {{$info['norujukan']}} |
+ {{$info['marhun']}} |
+ {{ number_format($info['berat'], 2, '.', ',') }} |
+ {{ number_format($info['hargajual'], 2, '.', ',') }} |
+
+
+
+ @endforeach
+
+
+
+
+
+
diff --git a/resources/views/serahan/pembayaran.blade.php b/resources/views/serahan/pembayaran.blade.php
index 51d431e5..84037db8 100644
--- a/resources/views/serahan/pembayaran.blade.php
+++ b/resources/views/serahan/pembayaran.blade.php
@@ -13,6 +13,7 @@