add sahbayaronline acc
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Cawangan;
|
||||
use App\Models\CawanganLelong;
|
||||
use App\Models\Lelong;
|
||||
use App\Models\Payment;
|
||||
use App\Models\LelongBid;
|
||||
use App\Models\LelongBidder;
|
||||
|
||||
class AccountController extends Controller
|
||||
{
|
||||
public function senarailelongan(){
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
$senarai = CawanganLelong::join('lelong', 'cawangan_lelong.lelong_id', '=', 'lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong.sts_lelong', 3)
|
||||
->get();
|
||||
|
||||
return view('account.senarailelongan',compact('senarai'));
|
||||
}
|
||||
|
||||
public function listbayaranonline($lelong_id){
|
||||
|
||||
$listwinner = Payment::join('lelongbid', 'payment.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('lelongbidder', 'payment.lelongbidder_id', '=', 'lelongbidder.id')
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->select('payment.user_id'
|
||||
)
|
||||
->groupBy('payment.user_id')
|
||||
->get();
|
||||
|
||||
foreach($listwinner as $index1=>$winner){
|
||||
|
||||
$userdetails = User::where('id', $winner['user_id'])->first();
|
||||
$SAGWin = Payment::join('lelongbid', 'payment.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('lelongbidder', 'payment.lelongbidder_id', '=', 'lelongbidder.id')
|
||||
->where('payment.user_id', $winner['user_id'])
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get();
|
||||
|
||||
$total_payment = 0;
|
||||
foreach($SAGWin as $SAG){
|
||||
$payment = Payment::where('lelongbid_id', $SAG->lelongbid_id)
|
||||
->first();
|
||||
|
||||
if($payment){
|
||||
$total_payment = $total_payment + $payment->total_payment;
|
||||
}
|
||||
}
|
||||
|
||||
$listwinner[$index1]['details'] = $userdetails;
|
||||
$listwinner[$index1]['total_surat'] = sizeof($SAGWin);
|
||||
$listwinner[$index1]['totalBid'] = $SAGWin->sum('hargabida');
|
||||
$listwinner[$index1]['totalPay'] = $total_payment;
|
||||
|
||||
}
|
||||
|
||||
|
||||
return view('account.listbayaranonline',compact('listwinner','lelong_id'));
|
||||
}
|
||||
|
||||
public function sahsagonline($lelong_id, $user_id){
|
||||
|
||||
$senaraisag = LelongBid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('lelongbidder.user_id', $user_id)
|
||||
->get();
|
||||
|
||||
return view('account.sahsagonline', compact('senaraisag', 'user_id', 'lelong_id'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<table class="table table-striped table-xl text-center" id="sahsagonline" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nama</th>
|
||||
<th>No Kad Pengenalan</th>
|
||||
<th>No Telefon</th>
|
||||
<th>Bilangan Surat</th>
|
||||
<th>Jumlah Bidaan(RM)</th>
|
||||
<th>Jumlah Pembayaran(RM)</th>
|
||||
<th>Penyata Bayaran</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($listwinner as $winner)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td>{{ $winner['details']['name']}}</td>
|
||||
<td>{{ $winner['details']['nokp']}}</td>
|
||||
<td>{{ $winner['details']['notelbimbit']}}</td>
|
||||
<td>{{ $winner['total_surat']}}</td>
|
||||
<td>{{ $winner['totalBid']}}</td>
|
||||
<td>{{ $winner['totalPay']}}</td>
|
||||
<td>
|
||||
<a href="{{ route('serahan.penyatabayaran',['user_id'=>$winner['details']['id'],'lelong_id'=>$lelong_id]) }}" target = "blank" ><i class="fas fa-download"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href=" {{ route('account.sahsagonline', ['user_id'=>$winner['details']['id'], 'lelong_id'=>$lelong_id]) }} "><i class="far fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tablesahsagonline = $('#sahsagonline').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 7,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 8,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
// buttons: [
|
||||
// {
|
||||
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
|
||||
// text: '<i class="fas fa-plus" id="test"></i>',
|
||||
// titleAttr: 'Tambah Cawangan',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// // alert( 'Button activated' );
|
||||
// // console.log('hye');
|
||||
|
||||
// $('#myModal').modal("show");
|
||||
// $('#myModal').on('shown.bs.modal', function () {
|
||||
// $('#rolename').trigger('focus')
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
// titleAttr: 'Export to CSV',
|
||||
// text: '<i class="fas fa-download"></i>',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// $("#exportform").submit();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
});
|
||||
|
||||
// $('.addcaw').tooltip();
|
||||
// $('.export').tooltip();
|
||||
// // $( '.dt-buttons').addClass('btn-group');
|
||||
// $( '.addcaw').removeClass('dt-button');
|
||||
// $( '.export').removeClass('dt-button');
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<table class="table table-striped table-xl text-center" id="tablekaunter" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Harga Asas (RM)</th>
|
||||
<th>Harga Bida (RM)</th>
|
||||
<th>Masa Bidaan</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($senaraisag as $senaraisag)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td>{{ $senaraisag['norujukan']}}</td>
|
||||
<td>{{ $senaraisag['t_lelong']}}</td>
|
||||
<td>{{ $senaraisag['hargaasas']}}</td>
|
||||
<td>{{ $senaraisag['hargabida']}}</td>
|
||||
<td>{{ $senaraisag['masa_bidaan']}}</td>
|
||||
<td>
|
||||
<input type="checkbox" aria-label="Checkbox for following text input" >
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal-footer">
|
||||
<a href="{{ route('account.senarailelongan') }}" class="btn btn-primary">Kembali</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tablekaunter = $('#tablekaunter').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 6,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
// buttons: [
|
||||
// {
|
||||
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
|
||||
// text: '<i class="fas fa-plus" id="test"></i>',
|
||||
// titleAttr: 'Tambah Cawangan',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// // alert( 'Button activated' );
|
||||
// // console.log('hye');
|
||||
|
||||
// $('#myModal').modal("show");
|
||||
// $('#myModal').on('shown.bs.modal', function () {
|
||||
// $('#rolename').trigger('focus')
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
// titleAttr: 'Export to CSV',
|
||||
// text: '<i class="fas fa-download"></i>',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// $("#exportform").submit();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
});
|
||||
|
||||
// $('.addcaw').tooltip();
|
||||
// $('.export').tooltip();
|
||||
// // $( '.dt-buttons').addClass('btn-group');
|
||||
// $( '.addcaw').removeClass('dt-button');
|
||||
// $( '.export').removeClass('dt-button');
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<table class="table table-striped table-xl text-center" id="senarailelongan" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Kod Cawangan</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Status Lelong</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($senarai as $data)
|
||||
<tr>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{ $data->caw_code }}</td>
|
||||
<td>{{ $data->tarikh_lelong }}</td>
|
||||
<td>{{ $data->sts_lelong }}</td>
|
||||
<td>
|
||||
<a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['lelong_id']]) }} "><i class="far fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var tablesenarailelongan = $('#senarailelongan').DataTable({
|
||||
"columnDefs": [
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 4,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
"info": false,
|
||||
"lengthChange": false,
|
||||
"pageLength": 15,
|
||||
dom: 'Bfrtip',
|
||||
// buttons: [
|
||||
// {
|
||||
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
|
||||
// text: '<i class="fas fa-plus" id="test"></i>',
|
||||
// titleAttr: 'Tambah Cawangan',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// // alert( 'Button activated' );
|
||||
// // console.log('hye');
|
||||
|
||||
// $('#myModal').modal("show");
|
||||
// $('#myModal').on('shown.bs.modal', function () {
|
||||
// $('#rolename').trigger('focus')
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
// titleAttr: 'Export to CSV',
|
||||
// text: '<i class="fas fa-download"></i>',
|
||||
// action: function ( e, dt, node, config ) {
|
||||
// $("#exportform").submit();
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
});
|
||||
|
||||
// $('.addcaw').tooltip();
|
||||
// $('.export').tooltip();
|
||||
// // $( '.dt-buttons').addClass('btn-group');
|
||||
// $( '.addcaw').removeClass('dt-button');
|
||||
// $( '.export').removeClass('dt-button');
|
||||
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -115,6 +115,9 @@
|
||||
{{-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
|
||||
<a href="/home">Home</a>
|
||||
</li> --}}
|
||||
<li class="{{ (request()->is('account/*')) ? 'active' : '' }}">
|
||||
<a href="{{url('account/senarailelongan')}}">List Bayaran Online</a>
|
||||
</li>
|
||||
@endhasrole
|
||||
@hasrole('pembida')
|
||||
{{-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
|
||||
|
||||
+11
-2
@@ -146,8 +146,7 @@ Route::group(['middleware' => ['permission:serahan'],'prefix'=>'serahan'], funct
|
||||
Route::get('/senaraibid/{user_id}/{lelong_id}',['as'=>'serahan.senaraibid','uses'=>'SerahanController@senaraibid']);
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Pengurus Cawangan
|
||||
Route::group(['middleware' => ['permission:pengesahanbayarancash'],'prefix'=>'pembayaran'], function () {
|
||||
Route::get('/kaunterpembayaran/{lelong_id}', ['as'=>'pembayaran.kaunterpembayaran','uses'=>'PaymentController@SenaraiPemenang']);
|
||||
Route::get('/SAGBidItem/{user_id}/{lelong_id}', ['as'=>'pembayaran.SAGBidItem','uses'=>'PaymentController@SAGBidItem']);
|
||||
@@ -155,6 +154,16 @@ Route::group(['middleware' => ['permission:pengesahanbayarancash'],'prefix'=>'pe
|
||||
Route::post('/paymentdenokaunter', ['as'=>'pembayaran.paymentdenokaunter','uses'=>'PaymentController@paymentdenokaunter']);
|
||||
|
||||
});
|
||||
// Pengurus Cawangan
|
||||
|
||||
// Account
|
||||
Route::group(['middleware' => ['permission:pengesahanbayaran'],'prefix'=>'account'], function () {
|
||||
Route::get('/senarailelongan', ['as'=>'account.senarailelongan','uses'=>'AccountController@senarailelongan']);
|
||||
Route::get('/listbayaranonline/{lelong_id}', ['as'=>'account.listbayaranonline','uses'=>'AccountController@listbayaranonline']);
|
||||
Route::get('/sahsagonline/{lelong_id}/{user_id}', ['as'=>'account.sahsagonline','uses'=>'AccountController@sahsagonline']);
|
||||
|
||||
});
|
||||
// Account
|
||||
|
||||
Route::group(['middleware' => ['permission:jananotis'],'prefix'=>'jananotis'], function () {
|
||||
Route::get('/notislelong',['as'=>'jananotis.notislelong','uses'=>'NotisController@notislelong']);
|
||||
|
||||
Reference in New Issue
Block a user