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 1/3] 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 @@ - {{--
  • +
  • -
  • --}} + @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 BeludInvois
    Ground Floor, Lot 11, KKMPNo.Invois: :0002588
    Kota Belud, Sabah.Tarikh: 30/08/2021
    Tel : 088-979599 
    Faks : 088-255026Cawangan : 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 BeludInvois
    Ground Floor, Lot 11, KKMPNo.Invois: :0002588
    Kota Belud, Sabah.Tarikh: 30/08/2021
    Tel : 088-979599 
    Faks : 088-255026Cawangan : Ar-Rahn Kota Belud
    +
    - -
    PENYATA BAYARAN LELONGAN
    - - +
    - - - - - - - - + + - - - - - + - - - - - + + + + + - - - + + + -
    BilNo. RujukanJenis BarangBerat(g) Harga Bidaan(RM)
    1.011232200714-00491- Cincin1.53346.00 
    2.011232200723-00391- Cincin2.90647.00
    Nama :{{ $info['nama_bidder'] }}
    Jumlah Bayaran4.43993.00No.K/P:{{$info['nokp']}}
    + + Alamat + : + {{$info['alamat']}} + + + No.Telefon + : + {{$info['notelbimbit']}} + + - - - - -
    SENARAI BAYARAN MENGIKUT AKAUN
    + +
    PENYATA BAYARAN LELONGAN
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    BilCawangan Berat(g) Harga Jual(RM)Nama BankPemegang AkaunNo.Akaun
    1.Ar-Rahn Kota Belud4.43993.00Bank Muamalat Malaysia BerhadJoint Venture MVSB and PKB-Kota Belud 0301-0006119-71-3
    Jumlah Bayaran993.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 @@
    @csrf + @@ -29,14 +30,14 @@ - {{-- @foreach ($lelong as $lel) --}} + @foreach ($payment as $pay) - - - - - - + + + + + + - {{-- @endforeach --}} + @endforeach
    MOHD SAID BIN TAIB83051912539901937494952993.00{{ $pay->nama_bidder }}{{ $pay->nokp }}{{ $pay->notelbimbit }}{{ $pay->lelongbid_id }}{{ $pay->total_payment }} {{-- @hasrole('jurulelong') @@ -55,7 +56,7 @@
    diff --git a/routes/web.php b/routes/web.php index 56454480..e3c864b0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -127,7 +127,7 @@ Route::group(['middleware' => ['permission:pengesahanpembida'],'prefix'=>'pembid Route::group(['middleware' => ['permission:serahan'],'prefix'=>'serahan'], function () { Route::get('/pembayaran',['as'=>'serahan.pembayaran','uses'=>'SerahanController@pembayaran']); - Route::get('/resitpembayaran',['as'=>'serahan.resitpembayaran','uses'=>'SerahanController@resitpembayaran']); + Route::post('/resitpembayaran',['as'=>'serahan.resitpembayaran','uses'=>'SerahanController@resitpembayaran']); Route::get('/penyatabayaran',['as'=>'serahan.penyatabayaran','uses'=>'SerahanController@penyatabayaran']); Route::get('/senaraibid',['as'=>'serahan.senaraibid','uses'=>'SerahanController@senaraibid']); From 2463c05a6f939a7a66a221cc436192b451308751 Mon Sep 17 00:00:00 2001 From: Amirah22 <94591077+Amirah22@users.noreply.github.com> Date: Mon, 21 Feb 2022 10:12:55 +0800 Subject: [PATCH 2/3] penyata pembayaran by user_id --- app/Http/Controllers/SerahanController.php | 17 +++++++++++------ resources/views/pdf/penyatabayaran.blade.php | 12 ++++++------ resources/views/serahan/pembayaran.blade.php | 4 ++-- routes/web.php | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/SerahanController.php b/app/Http/Controllers/SerahanController.php index 67b91354..c7862f93 100644 --- a/app/Http/Controllers/SerahanController.php +++ b/app/Http/Controllers/SerahanController.php @@ -47,6 +47,8 @@ class SerahanController extends Controller * @return \Illuminate\Contracts\Support\Renderable */ + + public function pembayaran() { @@ -60,18 +62,21 @@ class SerahanController extends Controller } - public function penyatabayaran(Request $request) + public function penyatabayaran($user_id) { - $payment_id = $request->paymentid; + // dd($norujukan); + // $payment_id = $request->paymentid; + $pembida= User::where('id','=',$user_id) + ->first(); $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 - + ->where('lelongbidder.user_id','=',$user_id) + ->where('lelongbidder.status_bidder','=','1') ->get(); - - $pdf = PDF::loadView('pdf.penyatabayaran',compact('payment','payment_id')) + // dd($payment); + $pdf = PDF::loadView('pdf.penyatabayaran',compact('payment','pembida')) ->setPaper('a4', 'landscape'); return $pdf->download('Penyata Bayaran.pdf'); diff --git a/resources/views/pdf/penyatabayaran.blade.php b/resources/views/pdf/penyatabayaran.blade.php index 2169a30d..c8fe7a88 100644 --- a/resources/views/pdf/penyatabayaran.blade.php +++ b/resources/views/pdf/penyatabayaran.blade.php @@ -46,7 +46,7 @@ - @foreach ($payment as $index=>$info) + @@ -85,22 +85,22 @@ - + - + - + - +
    Nama :{{ $info['nama_bidder'] }}{{ $pembida['name'] }}
    No.K/P :{{$info['nokp']}}{{$pembida['nokp']}}
    Alamat :{{$info['alamat']}}{{$pembida['alamat']}}
    No.Telefon :{{$info['notelbimbit']}}{{$pembida['notelbimbit']}}
    @@ -117,7 +117,7 @@ Harga Bidaan(RM) - + @foreach ($payment as $index=>$info) {{$index+1}} {{$info['norujukan']}} diff --git a/resources/views/serahan/pembayaran.blade.php b/resources/views/serahan/pembayaran.blade.php index 84037db8..44e45019 100644 --- a/resources/views/serahan/pembayaran.blade.php +++ b/resources/views/serahan/pembayaran.blade.php @@ -37,7 +37,7 @@ {{ $pay->nokp }} {{ $pay->notelbimbit }} {{ $pay->lelongbid_id }} - {{ $pay->total_payment }} + {{ $pay->hargajual }} {{-- @hasrole('jurulelong') @@ -52,7 +52,7 @@ @endif @endhasrole --}} - + diff --git a/routes/web.php b/routes/web.php index e3c864b0..1cdb6b40 100644 --- a/routes/web.php +++ b/routes/web.php @@ -128,7 +128,7 @@ Route::group(['middleware' => ['permission:pengesahanpembida'],'prefix'=>'pembid Route::group(['middleware' => ['permission:serahan'],'prefix'=>'serahan'], function () { Route::get('/pembayaran',['as'=>'serahan.pembayaran','uses'=>'SerahanController@pembayaran']); Route::post('/resitpembayaran',['as'=>'serahan.resitpembayaran','uses'=>'SerahanController@resitpembayaran']); - Route::get('/penyatabayaran',['as'=>'serahan.penyatabayaran','uses'=>'SerahanController@penyatabayaran']); + Route::get('/penyatabayaran/{user_id}',['as'=>'serahan.penyatabayaran','uses'=>'SerahanController@penyatabayaran']); Route::get('/senaraibid',['as'=>'serahan.senaraibid','uses'=>'SerahanController@senaraibid']); From 8bbd0aa4d0cd32da0387ce7c43e428e0c11b1600 Mon Sep 17 00:00:00 2001 From: Amirah22 <94591077+Amirah22@users.noreply.github.com> Date: Mon, 21 Feb 2022 11:35:58 +0800 Subject: [PATCH 3/3] db customer --- ...21_12_13_053311_create_cawangans_table.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/database/migrations/2021_12_13_053311_create_cawangans_table.php b/database/migrations/2021_12_13_053311_create_cawangans_table.php index 00ac113d..f369b89b 100644 --- a/database/migrations/2021_12_13_053311_create_cawangans_table.php +++ b/database/migrations/2021_12_13_053311_create_cawangans_table.php @@ -33,10 +33,60 @@ class CreateCawangansTable extends Migration $table->timestamps(); }); + Schema::create('customer', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->string('ahli')->nullable(); + $table->string('kodcaw')->nullable(); + $table->integer('nosiri')->nullable(); + $table->date('tarikhdaftar')->nullable(); + $table->string('nopelanggan'); + $table->string('kplama')->nullable(); + $table->string('kpbaru')->nullable(); + $table->string('nama')->nullable(); + $table->date('t_lahir')->nullable(); + $table->string('jantina')->nullable(); + $table->string('alamat1')->nullable(); + $table->string('alamat2')->nullable(); + $table->string('alamat3')->nullable(); + $table->string('alamat4')->nullable(); + $table->string('poskod')->nullable(); + $table->integer('koddaerah')->nullable(); + $table->string('kodnegeri')->nullable(); + $table->string('telefon')->nullable(); + $table->decimal('jumpinjaman', $precision = 9, $scale = 2)->nullable(); + $table->date('t_gadai')->nullable(); + $table->decimal('pinjamhari', $precision = 9, $scale = 2)->nullable(); + $table->string('bumiputra')->nullable(); + $table->string('warganegara')->nullable(); + $table->string('bangsa')->nullable(); + $table->string('kodkerja')->nullable(); + $table->string('kodugama')->nullable(); + $table->string('kodstatus')->nullable(); + $table->string('kodbank')->nullable(); + $table->string('noakaun')->nullable(); + $table->string('nota')->nullable(); + $table->string('teller')->nullable(); + $table->string('pelulus')->nullable(); + $table->date('t_ubah')->nullable(); + $table->time('m_ubah')->nullable(); + $table->string('aktif')->nullable(); + $table->decimal('yuranahli', $precision = 5, $scale = 2)->nullable(); + $table->string('nopelangganlama')->nullable(); + $table->string('tujuangadai')->nullable(); + $table->string('kodkerjabaru')->nullable(); + $table->string('tagperingatan')->nullable(); + $table->string('namateller')->nullable(); + $table->integer('kumpulan')->nullable(); + $table->string('telefon2')->nullable(); + $table->string('tagpelanggan')->nullable(); + }); + + Schema::create('gadai', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('kodcaw'); $table->string('norujukan'); + $table->string('nokp'); $table->decimal('jbg', $precision = 7, $scale = 2); $table->decimal('kadarupah', $precision = 5, $scale = 2)->nullable(); $table->decimal('upahsimpan', $precision = 11, $scale = 2)->nullable();