diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 939fe894..597d5790 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -390,6 +390,97 @@ class AccountController extends Controller $getresit[$index1]['resit64'] = 'data:image/' . $resit['file_type'] . ';base64' . base64_encode($resit['filename']); } - return view('account.sahsagonline', compact('senaraisag', 'lelong_id', 'user_id', 'total_payment', 'caw_code', 'userdetails', 'getresit','noresit')); + return view('account.sahsagonline', compact('senaraisag', 'lelong_id', 'user_id', 'total_payment', 'caw_code', 'userdetails', 'getresit')); + } + + public function listpengesahanakaun($lelong_id, $kodcaw) + { + $getkodcaw = Cawangan::where('caw_code', $kodcaw)->select('caw_name')->first(); + + $listwinner2 = Payment::join('lelongbid', 'payment.kodcaw', '=', 'lelongbid.kodcaw') + ->join('lelongbidder', 'payment.id', '=', 'lelongbidder.payment_id') + ->where('lelongbidder.status_bidder', 1) + ->where('lelongbid.lelong_id', $lelong_id) + // ->where('lelongbidder.status_payment', 2) + ->where('payment.status', 2) + ->where('payment.remark', 'BERJAYA BAYARAN ONLINE') + // ->whereNull('payment.disahkan_pada') + ->orWhere(function ($query) { + $query->where('payment.status_payment_opt', [2,3]); + // ->where('payment.status_payment_opt', 2); + }) + ->select('lelongbidder.user_id', 'payment.user_id') + ->groupBy('lelongbidder.user_id', 'payment.user_id') + ->get(); + // dd($listwinner2); + + $listwinner = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id') + ->join('payment', 'lelongbidder.payment_id', '=', 'payment.id') + ->where('lelongbidder.status_bidder', 1) + ->where('lelongbid.lelong_id', $lelong_id) + ->where('lelongbid.kodcaw', $kodcaw) + // ->where('lelongbidder.status_payment', 2) + ->where('payment.status', 2) + ->where('payment.remark', 'BERJAYA BAYARAN ONLINE') + // ->whereNull('payment.disahkan_pada') + ->select('lelongbidder.user_id', 'payment.user_id') + ->groupBy('lelongbidder.user_id', 'payment.user_id') + ->orWhere(function ($query) { + $query->where('payment.status_payment_opt', 3) + ->where('payment.status_payment_opt', 2); + }) + ->get(); + // dd($listwinner); + + foreach($listwinner as $index1=>$winner){ + + $userdetails = User::where('id', $winner['user_id'])->first(); + + + $SAGWin = Payment::join('lelongbidder', 'payment.id', '=', 'lelongbidder.payment_id') + ->where('payment.user_id', $winner['user_id']) + ->where('payment.kodcaw', $kodcaw) + ->get(); + + // dd($SAGWin); + + $id_payment = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id') + ->join('payment', 'lelongbidder.user_id', '=', 'payment.user_id') + ->where('lelongbidder.user_id', $winner['user_id']) + ->where('lelongbidder.status_bidder', 1) + ->where('lelongbid.lelong_id', $lelong_id) + ->where('lelongbid.kodcaw',$kodcaw) + ->where('payment.kodcaw',$kodcaw) + ->where('lelongbid.lelong_id', $lelong_id) + ->select('lelongbidder.payment_id') + ->groupBy('lelongbidder.payment_id') + ->get(); + + $total_payment = 0; + foreach($id_payment as $id){ + // dd($id_payment); + $payment = Payment::where('id', $id['payment_id']) + ->where('user_id', $userdetails['id']) + ->where('kodcaw', $kodcaw) + ->first(); + + if($payment){ + $total_payment = $total_payment + $payment->total_payment; + } + + $disahkanoleh = User::where('id', $payment->disahkan_oleh)->first(); + // dd($disahkanoleh); + } + $listwinner[$index1]['details'] = $userdetails; + $listwinner[$index1]['total_surat'] = sizeof($SAGWin); + $listwinner[$index1]['totalBid'] = $SAGWin->sum('hargabida'); + $listwinner[$index1]['totalPay'] = $total_payment; + $listwinner[$index1]['data'] = $SAGWin; + $listwinner[$index1]['disahkanoleh'] = $disahkanoleh; + + } + + + return view('account.listbayaranonlinesah',compact('listwinner','lelong_id', 'getkodcaw', 'kodcaw')); } } diff --git a/resources/views/account/listbayaranonline.blade.php b/resources/views/account/listbayaranonline.blade.php index 68141115..3eb77395 100644 --- a/resources/views/account/listbayaranonline.blade.php +++ b/resources/views/account/listbayaranonline.blade.php @@ -11,7 +11,7 @@
- Senarai Bayaran Atas Talian + Senarai Bayaran Atas Talian {{ $getkodcaw['caw_name'] }}
@@ -20,8 +20,9 @@

{{ $message }}

@endif -

Senarai Bayaran Atas Talian

-

{{ $getkodcaw['caw_name'] }}

+
+ Laporan Pengesahan +
diff --git a/resources/views/account/listbayaranonlinesah.blade.php b/resources/views/account/listbayaranonlinesah.blade.php new file mode 100644 index 00000000..e3296645 --- /dev/null +++ b/resources/views/account/listbayaranonlinesah.blade.php @@ -0,0 +1,115 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+
+
+ + + +
+ Senarai Bayaran Atas Talian {{ $getkodcaw['caw_name'] }} +
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + +
+ + + + + + + + + {{-- --}} + + + + + @foreach($listwinner as $winner) + + + + + + + + {{-- --}} + + + @endforeach + +
NoNamaNo Kad PengenalanNo TelefonBilangan SuratJumlah Pembayaran(RM)Jumlah Bidaan(RM)Disahkan Oleh
{{ $loop->iteration }} {{ $winner['details']['name']}}{{ $winner['details']['nokp']}}{{ $winner['details']['notelbimbit']}}{{ $winner['total_surat']}}{{ number_format($winner['totalPay'], 2, '.', ',')}}{{ number_format($winner['totalBid'], 2, '.', ',')}}{{ $winner['disahkanoleh']['name']}}
+ {{-- + + --}} + + + + +@endsection + diff --git a/routes/web.php b/routes/web.php index b35554a2..97f7725f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Http; +use App\Http\Controllers\SendSMSController; /* |-------------------------------------------------------------------------- @@ -440,6 +441,7 @@ Route::group(['middleware' => ['permission:pengesahanbayaran'],'prefix'=>'accoun Route::get('/sahsagonline/{lelong_id}/{user_id}/{caw_code}', ['as'=>'account.sahsagonline','uses'=>'AccountController@sahsagonline']); Route::post('/sahbayaronline', ['as'=>'account.sahbayaronline','uses'=>'AccountController@sahbayaronline']); Route::get('/listbayaranonlinehome', ['as'=>'account.listbayaranonlinehome','uses'=>'AccountController@listbayaranonlinehome']); + Route::get('/listpengesahanakaun/{lelong_id}/{kodcaw}',['as'=>'account.listpengesahanakaun','uses'=>'AccountController@listpengesahanakaun']); });