update home controller

This commit is contained in:
Nur Izzati Zulkifli
2022-12-13 20:42:53 +08:00
parent 93633aa0cd
commit 14b1fda3a6
7 changed files with 43 additions and 43 deletions
+1 -1
View File
@@ -282,7 +282,7 @@ class AccountController extends Controller
$bidder->update();
}
return redirect()->route('account.senarailelongan')->with('success','Pembayaran Berjaya');
return redirect()->route('home')->with('success','Pembayaran Berjaya');
}
+8 -5
View File
@@ -286,11 +286,12 @@ class HomeController extends Controller
$namawinner = User::where('id', $listwin['user_id'])
->first();
$total_payment = 0;
$userdetails = User::where('id', $listwin['user_id'])->first();
$SAGWin = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
->where('lelongbid.nopembeli', $listing['user_id'])
->where('lelongbid.kodcaw', $listing['kodcaw'])
->where('lelongbid.nopembeli', $listwin['user_id'])
->where('lelongbid.kodcaw', $listwin['kodcaw'])
->where('lelongbidder.status_bidder', 1)
->where('lelongbid.lelong_id', $listing['lelong_id'])
->where('lelongbid.lelong_id', $listwin['lelong_id'])
->get();
foreach($SAGWin as $index2=>$sag)
{
@@ -305,14 +306,16 @@ class HomeController extends Controller
{
$total_payment = '0.00';
}
$listwinner[$index]['jenisbayaran'] = $detailspayment ;
}
// dd($namawinner);
// $listwinner[$index]['namawinner'] = sizeof($namawinner);
$listwinner[$index]['nama'] = $namawinner['name'];
$listwinner[$index]['details'] = $userdetails;
$listwinner[$index]['nama'] = $userdetails['name'];
$listwinner[$index]['caw_code'] = $details1['caw_code'];
$listwinner[$index]['totalPay'] = $total_payment;
$listwinner[$index]['jenisbayaran'] = $detailspayment ;
$detailsinfo[$index1]['nama'] = $userdetails;
}
// $detailsinfo[$index1]['nama'] = $namawinner['name'];
@@ -35,7 +35,7 @@
</tr>
</thead>
<tbody>
@foreach($listwinner as $winner)
@forelse($listwinner as $winner)
<tr>
<td> {{ $loop->iteration }} </td>
<td class="text-left">{{ $winner['details']['name']}}</td>
@@ -46,7 +46,11 @@
{{-- <td>{{ number_format($winner['totalBid'], 2, '.', ',')}}</td> --}}
<td>{{ $winner['disahkanoleh']['name']}}</td>
</tr>
@endforeach
@empty
<tr>
<td colspan="7">No Data</td>
</tr>
@endforelse
</tbody>
</table>
{{-- <div class="modal-footer" style="margin-top:2%;">
@@ -65,7 +65,7 @@
</tr>
@endforeach
</tbody> --}}
<tr>
{{-- <tr>
<td colspan="2"><b> No.Resit</b></td>
<td colspan="2"></td>
@@ -73,9 +73,9 @@
<td></td>
<td></td>
<td></td>
</tr>
</tr> --}}
<tr>
{{-- {{dd($senaraisag->sum('hargabida'))}} --}}
<td colspan="2"><b> Jumlah Bayaran</b></td>
<td colspan="2"></td>
<td><b>RM{{ number_format($senaraisag->sum('hargabida'), 2, '.', ',') }}</b></td>
+15 -16
View File
@@ -400,8 +400,12 @@
</span><br>
@forelse($details['listwinner'] as $winner)
@if($winner['jenisbayaran'] != NULL)
@if($winner['jenisbayaran']['status'] == 2)
SELESAI
@if($winner['jenisbayaran']['disahkan_oleh'] != NULL)
SELESAI
@elseif($winner['jenisbayaran']['disahkan_oleh'] == NULL)
TUNGGU PENGESAHAN
@else
BELUM SELESAI
@endif
@else
BELUM SELESAI
@@ -437,8 +441,8 @@
<th>Tarikh Lelong</th>
{{-- <th>Cawangan</th> --}}
<th>Nama</th>
<th>Jumlah Bayaran</th>
<th>Jenis Bayaran</th>
{{-- <th>Jumlah Bayaran</th> --}}
{{-- <th>Jenis Bayaran</th> --}}
<th>Status Lelong</th>
</tr>
</thead>
@@ -457,18 +461,16 @@
{{-- <a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['detail']['lelong_id'], 'kodcaw'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a> --}}
<strong><span class="m-2">{{ $details['caw_name']}}</span></strong><br>
@forelse($details['listwinner'] as $winner)
<a href=" {{ route('account.sahsagonline', ['lelong_id'=>$data['detail']['lelong_id'],'user_id'=>$details['user_id'], 'caw_code'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Pengesahan"><i class="far fa-edit"></i></a>
<span class="m-2">{{ $details['caw_name']}}</span> {{$details['nama']}}<img src="{{ asset('img/new.gif') }}" alt="description of myimage"><br>
<a href=" {{ route('account.sahsagonline', ['lelong_id'=>$data['detail']['lelong_id'],'user_id'=>$winner['user_id'], 'caw_code'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Pengesahan"><i class="far fa-edit"></i></a>
{{$winner['nama']}}<img src="{{ asset('img/new.gif') }}" alt="description of myimage"><br>
<br>
@empty
<br>
@endforelse
@endforeach
</td>
<td align='left'>
@foreach($data['detailsinfo'] as $details)
{{-- <a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['detail']['lelong_id'], 'kodcaw'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a> --}}
{{-- <td align='left'>
@foreach($data['detailsinfo'] as $details)
@forelse($details['listwinner'] as $winner)
{{ number_format($winner['totalPay'], 2, '.', ',') }}
<br>
@@ -476,7 +478,7 @@
<br>
@endforelse
@endforeach
</td>
</td> --}}
{{-- <td align='left'>
@foreach($data['listwinner'] as $details)
<a href=" {{ route('account.sahsagonline', ['lelong_id'=>$data['detail']['lelong_id'],'user_id'=>$details['user_id'], 'caw_code'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Pengesahan"><i class="far fa-edit"></i></a>
@@ -484,13 +486,10 @@
@endforeach
</td> --}}
<td align='left'>
{{-- <td align='left'>
@foreach($data['detailsinfo'] as $details)
{{-- <a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['detail']['lelong_id'], 'kodcaw'=>$details['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a> --}}
@forelse($details['listwinner'] as $winner)
@if($winner['jenisbayaran'] != NULL)
{{-- {{ dump($winner['jenisbayaran'])}} --}}
@if($winner['jenisbayaran']['status_payment_opt'] == 1)
TUNAI
@elseif($winner['jenisbayaran']['status_payment_opt'] == 2)
@@ -507,7 +506,7 @@
<br>
@endforelse
@endforeach
</td>
</td> --}}
<td>
@if($data['detail']['sts_lelong'] == 3)
<button class="btn btn-success btn-sm" disabled>LELONG SELESAI</button>
@@ -27,7 +27,7 @@
@endhasrole
</div>
<table class="table table-bordered table-xl text-center" id="senarailelongonline" style="width:100%">
<table class="table table-bordered text-center" id="tablestatuspembayaran" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
@@ -121,10 +121,10 @@
@if($winner['jenisbayaran'] != NULL)
@if($winner['jenisbayaran']['status'] == 2)
SELESAI
@else
BELUM SELESAI
@endif
@endif
@else
BELUM SELESAI
@endif
<br>
@empty
- <br>
@@ -137,13 +137,9 @@
@endif
</td>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan="4"></td>
<td class="text-right"><b>{{number_format($totalall, 2, '.', ',')}}</b> </td>
<td></td>
<td></td>
<td colspan="3"></td>
</tr>
@@ -161,7 +157,7 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
var tablesenarailelongonline = $('#senarailelongonline').DataTable({
var tablestatuspembayaran = $('#senarailelongonline').DataTable({
"columnDefs": [
{
"targets": 0,
@@ -172,7 +168,8 @@
"orderable": false
}
],
order: [[0, 'asc']],
order: [[1, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
@@ -94,10 +94,7 @@
@endif
</td> --}}
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td colspan="4"></td>
<td class="text-right"><b>{{number_format($totalall, 2, '.', ',')}}</b> </td>