Merge branch 'faiqahzaman' into azfar_dev
This commit is contained in:
@@ -5,27 +5,94 @@ namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\LelongBid;
|
||||
use App\Models\LelongBidder;
|
||||
use App\Models\Users;
|
||||
use App\Models\LelongBidMarhun;
|
||||
use App\Models\User;
|
||||
|
||||
class PaymentController extends Controller
|
||||
{
|
||||
public function SenaraiPemenang(Request $request){
|
||||
|
||||
$listwinner = LelongBid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
||||
$lelong_id = 1;
|
||||
$listwinner = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->get();
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->select('lelongbidder.user_id'
|
||||
)
|
||||
->groupBy('lelongbidder.user_id')
|
||||
->get()->toArray();
|
||||
|
||||
return view('pembayaran.kaunterpembayaran',compact('listwinner'));
|
||||
// dd($listwinner);
|
||||
|
||||
foreach($listwinner as $index1=>$winner){
|
||||
|
||||
$userdetails = User::where('id', $winner['user_id'])->first();
|
||||
$SAGWin = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('user_id', $winner['user_id'])
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get();
|
||||
// $totalBid = 0;
|
||||
// foreach($SAGWin as $SAG){
|
||||
// $totalBid = $totalBid + $SAG->hargabida;
|
||||
|
||||
// }
|
||||
$listwinner[$index1]['details'] = $userdetails;
|
||||
$listwinner[$index1]['total_surat'] = sizeof($SAGWin);
|
||||
$listwinner[$index1]['totalBid'] = $SAGWin->sum('hargabida');
|
||||
|
||||
|
||||
// $listwinner = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
// ->join('users', 'lelongbidder.user_id', '=', 'users.id')
|
||||
// ->where('lelongbidder.status_bidder', 1)
|
||||
// ->where('lelongbid.lelong_id', $lelongId)
|
||||
// ->get();
|
||||
|
||||
|
||||
// $totalBid = LelongBidder::where('status_bidder', 1)->sum('hargabida');
|
||||
}
|
||||
|
||||
return view('pembayaran.kaunterpembayaran',compact('listwinner','lelong_id'));
|
||||
|
||||
}
|
||||
|
||||
public function SAGBidItem(Request $request){
|
||||
public function SAGBidItem($user_id, $lelong_id){
|
||||
|
||||
$SAGBidItem = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('users', 'lelongbidder.user_id', '=', 'users.id')
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('users.id', $user_id)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->select(
|
||||
'users.name',
|
||||
'users.nokp',
|
||||
'users.alamat'
|
||||
)
|
||||
->first();
|
||||
|
||||
foreach($SAGBidItem as $eachbid){
|
||||
|
||||
$eachbid = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('users', 'lelongbidder.user_id', '=', 'users.id')
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('users.id', $user_id)
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->select('lelongbidder.hargabida',
|
||||
'lelongbid.hargaasas',
|
||||
'lelongbid.norujukan')
|
||||
->get();
|
||||
|
||||
}
|
||||
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem', 'eachbid'));
|
||||
}
|
||||
|
||||
public function pengesahanPembayaran(Request $request){
|
||||
|
||||
$pengesahanPembayaran = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('users', 'lelongbidder.user_id', '=', 'users.id')
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->get();
|
||||
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem'));
|
||||
return view('pembayaran.pengesahanPembayaran',compact('pengesahanPembayaran'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,12 +57,16 @@ class RolesSeeder extends Seeder
|
||||
//pengurus cawangan
|
||||
Permission::create([
|
||||
'name' => 'pendaftaranpembida',
|
||||
'description' => 'Pemdaftaran pembida di cawangan'
|
||||
'description' => 'Pendaftaran pembida di cawangan'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'jananotis',
|
||||
'description' => 'Jana Notis Lelong'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'pengesahanpembayaranpc',
|
||||
'description' => 'Pengesahan Pembayaran Bagi PC'
|
||||
]);
|
||||
|
||||
//jurulelong
|
||||
Permission::create([
|
||||
@@ -95,6 +99,10 @@ class RolesSeeder extends Seeder
|
||||
'name' => 'tangguhan',
|
||||
'description' => 'Tangguh lelong'
|
||||
]);
|
||||
Permission::create([
|
||||
'name' => 'pengesahanpembida',
|
||||
'description' => 'Pengesahan Pembida Baru'
|
||||
]);
|
||||
|
||||
//account
|
||||
Permission::create([
|
||||
@@ -129,6 +137,7 @@ class RolesSeeder extends Seeder
|
||||
$role4 = Role::create(['name' => 'pengurus-cawangan']);
|
||||
$role4->givePermissionTo('pendaftaranpembida');
|
||||
$role4->givePermissionTo('jananotis');
|
||||
$role4->givePermissionTo('pengesahanpembayaranpc');
|
||||
|
||||
$role5 = Role::create(['name' => 'jurulelong']);
|
||||
$role5->givePermissionTo('pendaftaranbatch');
|
||||
@@ -142,6 +151,7 @@ class RolesSeeder extends Seeder
|
||||
$role6->givePermissionTo('report');
|
||||
$role6->givePermissionTo('tangguhan');
|
||||
$role6->givePermissionTo('analisa');
|
||||
$role6->givePermissionTo('pengesahanpembida');
|
||||
|
||||
$role7 = Role::create(['name' => 'account']);
|
||||
$role7->givePermissionTo('pengesahanbayaran');
|
||||
|
||||
@@ -47,9 +47,12 @@
|
||||
</li>
|
||||
@endhasrole
|
||||
@hasrole('teller')
|
||||
{{-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
|
||||
<!-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
|
||||
<a href="/home">Home</a>
|
||||
</li> --}}
|
||||
</li> -->
|
||||
<li class="{{ ( request()->is('pembayaran/kaunter/*')) ? 'active' : '' }}">
|
||||
<a href="{{url('pembayaran/kaunterpembayaran')}}">Pembayaran Pemenang</a>
|
||||
</li>
|
||||
@endhasrole
|
||||
@hasrole('pengurus-cawangan')
|
||||
|
||||
@@ -62,16 +65,17 @@
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
{{-- <li class="{{ (request()->is('')) ? 'active' : '' }}">
|
||||
<li class="{{ (request()->is('')) ? 'active' : '' }}">
|
||||
<a href="#analisaSubmenu" data-toggle="collapse" aria-expanded="false" style="">Notis Lelong</a>
|
||||
<ul class="list-unstyled collapse {{ (request()->is('analisa/*')) ? 'show' : '' }}" id="analisaSubmenu" >
|
||||
<li class="{{ (request()->is('') || request()->is('') ) ? 'active' : '' }}">
|
||||
<a href="{{url('#')}}">Jana Notis Lelong</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li> --}}
|
||||
|
||||
|
||||
</li>
|
||||
<li class="{{ (request()->is('pengurus-cawangan/*')) ? 'active' : '' }}">
|
||||
<a href="{{url('lelong/pengesahanPembayaran')}}">Pengesahan Pembayaran</a>
|
||||
</li>
|
||||
@endhasrole
|
||||
@hasrole('jurulelong')
|
||||
<li class="{{ (request()->is('lelong/*')) ? 'active' : '' }}">
|
||||
@@ -82,14 +86,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="{{ (request()->is('pembayaran/*')) ? 'active' : '' }}">
|
||||
<a href="#pembayaranSubmenu" data-toggle="collapse" aria-expanded="false" style="">Pembayaran</a>
|
||||
<ul class="list-unstyled collapse {{ (request()->is('pembayaran/*')) ? 'show' : '' }}" id="pembayaranSubmenu" >
|
||||
<li class="{{ (request()->is('lelong/kaunterpembayaran/*') || request()->is('lelong/kaunterpembayaran') ) ? 'active' : '' }}">
|
||||
<a href="{{url('lelong/kaunterpembayaran')}}">Senarai Pemenang</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@endhasrole
|
||||
@hasrole('operasi')
|
||||
<li class="{{ (request()->is('analisa/*')) ? 'active' : '' }}">
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
<div class="container">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
@foreach($SAGBidItem as $BidItem)
|
||||
<p> <b>Nama : </b> {{ $BidItem->nama_bidder }}</p>
|
||||
<p> <b>No Kad Pengenalan : </b> {{ $BidItem->nokp }}</p>
|
||||
<p> <b>Alamat : </b> {{ $BidItem->alamat }}</p>
|
||||
@endforeach
|
||||
<p> <b>Nama : </b> {{ $SAGBidItem->name }}</p>
|
||||
<p> <b>No Kad Pengenalan : </b> {{ $SAGBidItem->nokp }}</p>
|
||||
<p> <b>Alamat : </b> {{ $SAGBidItem->alamat }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,7 +15,7 @@
|
||||
<div class="container">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<table class="table table-striped table-xl" style="width:100%">
|
||||
<table class="table table-border table-hover table-xl" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th class="text-center">No</th>
|
||||
@@ -28,18 +26,23 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($SAGBidItem as $BidItem)
|
||||
<tr>
|
||||
<td class="text-center">1</td>
|
||||
<td class="text-center">{{ $BidItem->norujukan}}</td>
|
||||
<td class="text-center">{{ $BidItem->hargaasas}}</td>
|
||||
<td class="text-center">{{ $BidItem->hargajual}}</td>
|
||||
<td class="text-center"><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $BidItem->norujukan }}"></td>
|
||||
</tr>
|
||||
|
||||
<!-- $a= (string)$eachbid['hargabida'];
|
||||
$Total_Payment = sum($a); -->
|
||||
|
||||
@foreach($eachbid as $biditem)
|
||||
<tr>
|
||||
<td class="text-center">{{ $loop->iteration }}</td>
|
||||
<td class="text-center">{{ $biditem->norujukan}}</td>
|
||||
<td class="text-center">{{ $biditem->hargaasas}}</td>
|
||||
<td class="text-center">{{ $biditem->hargabida}}</td>
|
||||
<td class="text-center"><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" onclick="sum(this.value,this)" value="{{ $biditem->hargabida }}"></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td colspan="3"><b> Jumlah Bayaran </b></td>
|
||||
<td class="text-center"><b> RM 2000 </b></td>
|
||||
<td class="text-center"><b>RM<input type="text" id="total" value="0" style="border: none;" readonly></b></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -47,4 +50,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
function sum(val, e){ //e = get all data
|
||||
if(e.checked==true) //checkbox
|
||||
{
|
||||
var total_sum = parseFloat($('#total').val());
|
||||
total_sum = total_sum + parseFloat(val);
|
||||
$('#total').val(parseFloat(total_sum).toFixed(2)); //get access to selected total and display total_sum with decimal of 2
|
||||
}
|
||||
else{
|
||||
var total_sum = parseFloat($('#total').val());
|
||||
total_sum = total_sum - parseFloat(val);
|
||||
$('#total').val(parseFloat(total_sum).toFixed(2));
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<table class="table table-striped table-xl" style="width:100%">
|
||||
<table class="table table-striped table-xl text-center" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
@@ -14,23 +14,23 @@
|
||||
<th>No Telefon</th>
|
||||
<th>Bilangan Surat</th>
|
||||
<th>Jumlah Bidaan(RM)</th>
|
||||
<th>Remark</th>
|
||||
<th>Status Bayaran</th>
|
||||
<th>Resit Bayaran</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($listwinner as $winner)
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><a href=" {{ route('lelong.SAGBidItem') }} " target="blank" style="color:#3490dc">{{ $winner->nama_bidder}}</a></td>
|
||||
<td>{{ $winner->nokp}}</td>
|
||||
<td>{{ $winner->notelbimbit}}</td>
|
||||
<td></td>
|
||||
<td>{{ $winner->hargabida}}</td>
|
||||
<td></td>
|
||||
<td>{{ $winner->status_payment}}</td>
|
||||
<td></td>
|
||||
<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>
|
||||
<a href=" # " target = "blank" ><i class="fas fa-download"></i></a>
|
||||
</td>
|
||||
<td><a href=" {{ route('pembayaran.SAGBidItem', ['user_id'=>$winner['details']['id'], 'lelong_id'=>$lelong_id]) }} "><i class="far fa-edit"></i></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<table class="table table-striped table-xl text-center" 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 Bayaran(RM)</th>
|
||||
<th>Remark</th>
|
||||
<th>Status Bayaran</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($pengesahanPembayaran as $sahbayar)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td><a href=" # " target="blank" style="color:#3490dc">{{ $sahbayar->nama_bidder}}</a></td>
|
||||
<td>{{ $sahbayar->nokp}}</td>
|
||||
<td>{{ $sahbayar->notelbimbit}}</td>
|
||||
<td></td>
|
||||
<td>{{ $sahbayar->hargabida}}</td>
|
||||
<td></td>
|
||||
<td>
|
||||
@if ($sahbayar->status_payment == 0)
|
||||
<button class="btn btn-danger btn-sm" disabled>UNPAID</button>
|
||||
@elseif ($sahbayar->status_payment == 1)
|
||||
<button class="btn btn-success btn-sm" disabled>PAID</button>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-info btn-sm">SAHKAN</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -111,9 +111,6 @@
|
||||
$( '.adduser').removeClass('dt-button');
|
||||
$( '.export').removeClass('dt-button');
|
||||
|
||||
//var simple = '<?php {{-- echo $totaluser;--}} ?>';
|
||||
// console.log(simple);
|
||||
|
||||
|
||||
function selectall(cb) {
|
||||
tabletaraf.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
||||
|
||||
+8
-4
@@ -80,7 +80,6 @@ Route::group(['prefix'=>'lelong'], function () {
|
||||
Route::get('/lelongtaklaku',['as'=>'lelong.lelongtaklaku','uses'=>'LelongController@lelongtaklaku']);
|
||||
Route::get('/showlelong/{id}',['as'=>'lelong.show','uses'=>'LelongController@show']);
|
||||
Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']);
|
||||
|
||||
Route::get('/export/{id}',['as'=>'lelong.exportnotis','uses'=>'LelongController@exportnotis']);
|
||||
Route::get('/janapemenang/{id}', ['as'=>'lelong.janapemenang','uses'=>'LelongController@janapemenang']);
|
||||
Route::get('/kaunterpembayaran', ['as'=>'lelong.kaunterpembayaran','uses'=>'PaymentController@SenaraiPemenang']);
|
||||
@@ -91,6 +90,10 @@ Route::group(['prefix'=>'lelong'], function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['permission:pengesahanpembayaranpc']], function () {
|
||||
Route::get('/pengesahanPembayaran', ['as'=>'payment.pengesahanPembayaran','uses'=>'PaymentController@pengesahanPembayaran']);
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['permission:import']], function () {
|
||||
Route::get('/refresh/{id}',['as'=>'lelong.refresh','uses'=>'LelongController@refresh']);
|
||||
@@ -138,9 +141,10 @@ Route::group(['middleware' => ['permission:serahan'],'prefix'=>'serahan'], funct
|
||||
Route::get('/penyatabayaran',['as'=>'serahan.penyatabayaran','uses'=>'SerahanController@penyatabayaran']);
|
||||
Route::get('/senaraibid',['as'=>'serahan.senaraibid','uses'=>'SerahanController@senaraibid']);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Route::group(['middleware' => ['permission:pengesahanbayarancash'],'prefix'=>'pembayaran'], function () {
|
||||
Route::get('/kaunterpembayaran', ['as'=>'pembayaran.kaunterpembayaran','uses'=>'PaymentController@SenaraiPemenang']);
|
||||
Route::get('/SAGBidItem/{user_id}/{lelong_id}', ['as'=>'pembayaran.SAGBidItem','uses'=>'PaymentController@SAGBidItem']);
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user