update 14/6
This commit is contained in:
@@ -14,6 +14,7 @@ use App\Models\Payment;
|
||||
use App\Models\LelongBid;
|
||||
use App\Models\LelongBidder;
|
||||
use App\Models\Resit;
|
||||
use App\Models\FileResit;
|
||||
|
||||
class AccountController extends Controller
|
||||
{
|
||||
@@ -30,14 +31,23 @@ class AccountController extends Controller
|
||||
return view('account.senarailelongan',compact('senarai'));
|
||||
}
|
||||
|
||||
public function listbayaranonline($lelong_id){
|
||||
public function listbayaranonline($lelong_id, $caw_code)
|
||||
{
|
||||
$getkodcaw = CawanganLelong::join('lelong', 'cawangan_lelong.lelong_id', '=', 'lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong.id', $lelong_id)
|
||||
->where('caw_code')
|
||||
->select('cawangan.caw_name')
|
||||
->get();
|
||||
|
||||
$getkodcaw = Cawangan::where('caw_code', $caw_code)->select('caw_name')->first();
|
||||
|
||||
|
||||
$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('payment.status_payment_opt','=', '3,2')
|
||||
->where('payment.status_payment_opt', 3)
|
||||
->orWhere('payment.status_payment_opt', 2)
|
||||
->where('lelongbidder.status_payment', 2)
|
||||
->whereNull('payment.disahkan_pada')
|
||||
->select('.lelongbidder.user_id'
|
||||
@@ -45,7 +55,6 @@ class AccountController extends Controller
|
||||
->groupBy('lelongbidder.user_id')
|
||||
->get();
|
||||
|
||||
// dd($listwinner);
|
||||
foreach($listwinner as $index1=>$winner){
|
||||
|
||||
$userdetails = User::where('id', $winner['user_id'])->first();
|
||||
@@ -82,26 +91,42 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
|
||||
return view('account.listbayaranonline',compact('listwinner','lelong_id'));
|
||||
return view('account.listbayaranonline',compact('listwinner','lelong_id', 'getkodcaw', 'caw_code'));
|
||||
}
|
||||
|
||||
public function sahsagonline($lelong_id, $user_id)
|
||||
public function sahsagonline($lelong_id, $user_id, $caw_code)
|
||||
{
|
||||
$userdetails = User::where('id', $user_id)->first();
|
||||
|
||||
$senaraisag = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('payment', 'lelongbidder.payment_id', '=', 'payment.id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('lelongbidder.user_id', $user_id)
|
||||
->where('lelongbid.kodcaw', $caw_code)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('payment.status_payment_opt', '=', '3,2')
|
||||
->where('payment.status_payment_opt', 3)
|
||||
->orWhere('payment.status_payment_opt', 2)
|
||||
->where('lelongbidder.status_payment', 2)
|
||||
->get()->toArray();
|
||||
|
||||
foreach($senaraisag as $index1=>$sag)
|
||||
{
|
||||
$checking = Payment::join('lelongbid', 'payment.lelong_id', '=', 'lelongbid.lelong_id')
|
||||
->where('lelongbid.status_jual', 1)
|
||||
->where('lelongbid.status_payment', 1)
|
||||
->whereNotNull('payment.disahkan_pada')
|
||||
->whereNotNull('payment.disahkan_pada')
|
||||
->first();
|
||||
}
|
||||
|
||||
$saggroupbyid = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('payment', 'lelongbidder.payment_id', '=', 'payment.id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('lelongbidder.user_id', $user_id)
|
||||
->where('lelongbid.kodcaw', $caw_code)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('payment.status_payment_opt', '=', '3,2')
|
||||
->where('payment.status_payment_opt', 3)
|
||||
->orWhere('payment.status_payment_opt', 2)
|
||||
->where('lelongbidder.status_payment', 2)
|
||||
->select(
|
||||
'lelongbidder.payment_id as payment_id'
|
||||
@@ -110,14 +135,24 @@ class AccountController extends Controller
|
||||
->get();
|
||||
// $payments = Payment::whereIn($saggroupbyid)->get()
|
||||
$total_payment = Payment::whereIn('id',$saggroupbyid)->get()->sum('total_payment');
|
||||
|
||||
|
||||
return view('account.sahsagonline', compact('senaraisag', 'lelong_id', 'user_id', 'total_payment'));
|
||||
$getresit = FileResit::join('payment', 'fileresit.payment_id', '=', 'payment.id')
|
||||
->where('payment.lelong_id', $lelong_id)
|
||||
->where('payment.user_id', $user_id)
|
||||
->where('payment.kodcaw', $caw_code)
|
||||
->get()->toArray();
|
||||
|
||||
$array_resit = [];
|
||||
foreach($getresit as $index1=>$resit)
|
||||
{
|
||||
$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', 'checking'));
|
||||
}
|
||||
|
||||
public function sahbayaronline(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
@@ -128,7 +163,8 @@ class AccountController extends Controller
|
||||
->where('lelongbid.lelong_id', $request->lelong_id)
|
||||
->where('lelongbidder.user_id', $request->user_id)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('payment.status_payment_opt', '3,2')
|
||||
->where('payment.status_payment_opt', 3)
|
||||
->orWhere('payment.status_payment_opt', 2)
|
||||
->where('lelongbidder.status_payment', 2)
|
||||
->select(
|
||||
'lelongbid.id as lelongbid_id',
|
||||
@@ -144,7 +180,8 @@ class AccountController extends Controller
|
||||
->where('lelongbid.lelong_id', $request->lelong_id)
|
||||
->where('lelongbidder.user_id', $request->user_id)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('payment.status_payment_opt', '3,2')
|
||||
->where('payment.status_payment_opt', 3)
|
||||
->orWhere('payment.status_payment_opt', 2)
|
||||
->where('lelongbidder.status_payment', 2)
|
||||
->select(
|
||||
'lelongbidder.payment_id as payment_id'
|
||||
|
||||
@@ -664,37 +664,16 @@ class MarhunController extends Controller
|
||||
$rugilelong = $totalbaki;
|
||||
}
|
||||
|
||||
// if($gadaimarhun)
|
||||
// {
|
||||
$marhuns[$index1]['harga_gadai'] = $marhun['old_harga'];
|
||||
$marhuns[$index1]['nmarhun_gadai'] = $marhun['old_nmarhun'];
|
||||
$marhuns[$index1]['old_marhun'] = $marhun['marhun'];
|
||||
$marhuns[$index1]['status_ubah'] = $status;
|
||||
$marhuns[$index1]['pembiayaan'] = $lelongbid->pinjaman;
|
||||
$marhuns[$index1]['baki_lelong'] = $bakilelong;
|
||||
$marhuns[$index1]['rugi_lelong'] = $rugilelong;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $marhuns[$index1]['harga_gadai'] = 0;
|
||||
// $marhuns[$index1]['nmarhun_gadai'] = 0;
|
||||
// $marhuns[$index1]['old_marhun'] = 0;
|
||||
// $marhuns[$index1]['status_ubah'] = 0;
|
||||
// $marhuns[$index1]['pembiayaan'] = 0;
|
||||
// $marhuns[$index1]['baki_lelong'] = 0;
|
||||
// $marhuns[$index1]['rugi_lelong'] = 0;
|
||||
// }
|
||||
|
||||
// $marhuns[$index1]['harga_gadai'] = $gadaimarhun->harga;
|
||||
// $marhuns[$index1]['nmarhun_gadai'] = $gadaimarhun->n_marhun;
|
||||
// $marhuns[$index1]['old_marhun'] = $gadaimarhun->marhun;
|
||||
// $marhuns[$index1]['status_ubah'] = $status;
|
||||
// $marhuns[$index1]['pembiayaan'] = $lelongbid->pinjaman;
|
||||
// $marhuns[$index1]['bakiupah'] = $lelongbid->bakiupah;
|
||||
// $marhuns[$index1]['baki_lelong'] = $bakilelong;
|
||||
// $marhuns[$index1]['rugi_lelong'] = $rugilelong;
|
||||
$marhuns[$index1]['harga_gadai'] = $marhun['old_harga'];
|
||||
$marhuns[$index1]['nmarhun_gadai'] = $marhun['old_nmarhun'];
|
||||
$marhuns[$index1]['old_marhun'] = $marhun['marhun'];
|
||||
$marhuns[$index1]['status_ubah'] = $status;
|
||||
$marhuns[$index1]['pembiayaan'] = $lelongbid->pinjaman;
|
||||
$marhuns[$index1]['bakiupah'] = $lelongbid->bakiupah;
|
||||
$marhuns[$index1]['baki_lelong'] = $bakilelong;
|
||||
$marhuns[$index1]['rugi_lelong'] = $rugilelong;
|
||||
}
|
||||
// dd($marhuns);
|
||||
|
||||
array_push($arraylelbidmarhun,$marhuns);
|
||||
}
|
||||
|
||||
@@ -740,7 +719,9 @@ class MarhunController extends Controller
|
||||
{
|
||||
if($bidmarhuns->status_ubah == 3)
|
||||
{
|
||||
$bidmarhuns->delete();
|
||||
$deletemarhun = LelongBidMarhun::where('id', $bidmarhuns->lelongbidmarhun_id)
|
||||
->where('lelongbid_id', $bidmarhuns->lelongbid_id)
|
||||
->delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -751,8 +732,10 @@ class MarhunController extends Controller
|
||||
|
||||
$pengesahans = Pengesahan::join('lelongbidmarhun', 'pengesahan.lelongbid_id', '=', 'lelongbidmarhun.lelongbid_id')
|
||||
->where('pengesahan.lelongbid_id', $terimalel['lelongbid_id'])
|
||||
->select('pengesahan.id as pengesahan_id')
|
||||
->first();
|
||||
->select('pengesahan.id as pengesahan_id',
|
||||
'pengesahan.status'
|
||||
)
|
||||
->update(['status' => 1]);
|
||||
|
||||
$lelongbids = LelongBid::where('id', $lelongbid['id'])->first();
|
||||
$lelongbids->marhun = str_replace( $txtmarhun,"",$lelongbids->marhun);
|
||||
|
||||
@@ -12,6 +12,8 @@ use App\Models\LelongBidder;
|
||||
use App\Models\LelongBidMarhun;
|
||||
use App\Models\Payment;
|
||||
use App\Models\User;
|
||||
use App\Models\File;
|
||||
use App\Models\FileResit;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
@@ -83,6 +85,7 @@ class PaymentController extends Controller
|
||||
foreach($payment_id as $id){
|
||||
$payment = Payment::where('id', $id->payment_id)
|
||||
->first();
|
||||
// dd($payment);
|
||||
|
||||
if($payment){
|
||||
$total_payment = $total_payment + $payment->total_payment;
|
||||
@@ -128,8 +131,20 @@ class PaymentController extends Controller
|
||||
'lelongbidder.status_payment'
|
||||
)
|
||||
->get();
|
||||
// dd($eachbid);
|
||||
|
||||
$getresit = FileResit::join('payment', 'fileresit.payment_id', '=', 'payment.id')
|
||||
->where('payment.lelong_id', $lelong_id)
|
||||
->where('payment.user_id', $user_id)
|
||||
->get()->toArray();
|
||||
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem', 'eachbid', 'lelong_id','user_id'));
|
||||
$array_resit = [];
|
||||
foreach($getresit as $index1=>$resit)
|
||||
{
|
||||
$getresit[$index1]['resit64'] = 'data:image/' . $resit['file_type'] . ';base64' . base64_encode($resit['filename']);
|
||||
}
|
||||
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem', 'eachbid', 'lelong_id','user_id', 'getresit'));
|
||||
}
|
||||
|
||||
public function paymentdenokaunter(Request $request){
|
||||
@@ -243,66 +258,112 @@ class PaymentController extends Controller
|
||||
public function banktransfer(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
//eachbid = lelongbid_id
|
||||
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
// $totalcheck = implode(",", $request->checkboxdata);
|
||||
$bid_id = explode(",", $request->eachbid); //bid_id = lelongbid_id
|
||||
|
||||
$resit = Resit::where('lelong_id', $request->lelong_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->where('resit_type', 2)
|
||||
$paymentexist = Payment::join('fileresit', 'payment.id', '=', 'fileresit.payment_id')
|
||||
->where('payment.lelong_id', $request->lelong_id)
|
||||
->where('payment.user_id', $request->user_id)
|
||||
->first();
|
||||
|
||||
$payment = new Payment;
|
||||
$payment->user_id = $request->user_id;
|
||||
$payment->lelong_id = $request->lelong_id;
|
||||
$payment->kodcaw = $user->kodcaw;
|
||||
$payment->status_payment_opt = 3;
|
||||
$payment->status = 2;
|
||||
$payment->remark = 'BAYARAN CDM';
|
||||
$payment->resit_id = $resit->id;
|
||||
$payment->total_payment = $request->total;
|
||||
$payment->diminta_pada = $currentdate;
|
||||
$payment->diminta_oleh = $user->id;
|
||||
$payment->save();
|
||||
|
||||
foreach($bid_id as $bid){
|
||||
if($paymentexist)
|
||||
{
|
||||
$getpayment = Payment::join('fileresit', 'payment.id', '=', 'fileresit.payment_id')
|
||||
->where('payment.lelong_id', $request->lelong_id)
|
||||
->where('payment.user_id', $request->user_id)
|
||||
->select('payment.id as payment_id',
|
||||
'payment.lelong_id',
|
||||
'payment.user_id',
|
||||
'fileresit.id as fileresit_id',
|
||||
'fileresit.file_type',
|
||||
'fileresit.filename'
|
||||
)
|
||||
->first();
|
||||
|
||||
$eachbid = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('users', 'lelongbidder.user_id', '=', 'users.id')
|
||||
->where('lelongbidder.lelongbid_id', $bid)
|
||||
->select('lelongbidder.hargabida',
|
||||
'lelongbid.hargaasas',
|
||||
'lelongbid.norujukan',
|
||||
'lelongbidder.lelongbid_id',
|
||||
'lelongbidder.id as lelongbidder_id',
|
||||
'lelongbid.lelong_id as lelong_id'
|
||||
)
|
||||
->first();
|
||||
$data = base64_encode($request->resit->get());
|
||||
$file_type = $request->resit->extension();
|
||||
|
||||
$updatepayment = FileResit::where('payment_id', $getpayment['payment_id'])
|
||||
->where('id', $getpayment['fileresit_id'])
|
||||
->first();
|
||||
$updatepayment->id;
|
||||
$updatepayment->user_id = $request->user_id;
|
||||
$updatepayment->payment_id = $updatepayment->payment_id;
|
||||
$updatepayment->file_type = $file_type;
|
||||
$updatepayment->filename = $data;
|
||||
$updatepayment->update();
|
||||
|
||||
return redirect()->route('pembayaran.kaunterpembayaran', $request->lelong_id)
|
||||
->with('success','Ubah Resit Berjaya, Tunggu Pengesahan Akaun');
|
||||
}
|
||||
else
|
||||
{
|
||||
$bid_id = $request->eachbid;
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
$updatelelbidbidder = LelongBidder::where('lelongbid_id', $eachbid->lelongbid_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->first();
|
||||
$updatelelbidbidder->status_payment = 1;
|
||||
$updatelelbidbidder->payment_id = $payment->id;
|
||||
$updatelelbidbidder->save();
|
||||
|
||||
$eachbidupdate = LelongBid::where('id',$bid)->first();
|
||||
$eachbidupdate->status_jual = 1;
|
||||
$eachbidupdate->status_payment = 2;
|
||||
$eachbidupdate->t_jual = $currentdate;
|
||||
$eachbidupdate->hargajual = $eachbid->hargabida;
|
||||
$eachbidupdate->save();
|
||||
$user = Auth::user();
|
||||
|
||||
// $imageName = time().'.'.$request->resit->extension();
|
||||
$data = base64_encode($request->resit->get());
|
||||
$file_type = $request->resit->extension();
|
||||
|
||||
$resit = Resit::where('lelong_id', $request->lelong_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->where('resit_type', 2)
|
||||
->first();
|
||||
|
||||
$payment = new Payment;
|
||||
$payment->user_id = $request->user_id;
|
||||
$payment->lelong_id = $request->lelong_id;
|
||||
$payment->kodcaw = $user->kodcaw;
|
||||
$payment->status_payment_opt = 3;
|
||||
$payment->status = 2;
|
||||
$payment->remark = 'BAYARAN CDM';
|
||||
$payment->resit_id = $resit->id;
|
||||
$payment->total_payment = $request->total_payment;
|
||||
$payment->diminta_pada = $currentdate;
|
||||
$payment->diminta_oleh = $user->id;
|
||||
$payment->save();
|
||||
|
||||
$addfile = new FileResit;
|
||||
$addfile->user_id = $request->user_id;
|
||||
$addfile->payment_id = $payment->id;
|
||||
$addfile->file_type = $file_type;
|
||||
$addfile->filename = $data;
|
||||
$addfile->save();
|
||||
|
||||
foreach($bid_id as $bid)
|
||||
{
|
||||
$eachbid = LelongBidder::join('lelongbid', 'lelongbidder.lelongbid_id', '=', 'lelongbid.id')
|
||||
->join('users', 'lelongbidder.user_id', '=', 'users.id')
|
||||
->where('lelongbidder.lelongbid_id', $bid)
|
||||
->select('lelongbidder.hargabida',
|
||||
'lelongbid.hargaasas',
|
||||
'lelongbid.norujukan',
|
||||
'lelongbidder.lelongbid_id',
|
||||
'lelongbidder.id as lelongbidder_id',
|
||||
'lelongbid.lelong_id as lelong_id'
|
||||
)
|
||||
->first();
|
||||
|
||||
$updatelelbidbidder = LelongBidder::where('lelongbid_id', $eachbid->lelongbid_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->first();
|
||||
$updatelelbidbidder->status_payment = 2;
|
||||
$updatelelbidbidder->payment_id = $payment->id;
|
||||
$updatelelbidbidder->save();
|
||||
|
||||
$eachbidupdate = LelongBid::where('id',$bid)->first();
|
||||
$eachbidupdate->hargajual = $eachbid->hargabida;
|
||||
$eachbidupdate->save();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return redirect()->route('pembayaran.kaunterpembayaran', $request->lelong_id)
|
||||
->with('success','Menunggu Pengesahan Akaun');
|
||||
|
||||
}
|
||||
|
||||
|
||||
return redirect()->route('pembayaran.SenaraiLelongBayar')
|
||||
->with('success','Menunggu Pengesahan Account');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FileResit extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'fileresit';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'payment_id',
|
||||
'file_type',
|
||||
'filename',
|
||||
'deleted_at',
|
||||
'deleted_by'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFileresitTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('fileresit', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->unsignedBigInteger('user_id')->unsigned();
|
||||
$table->unsignedBigInteger('payment_id')->unsigned();
|
||||
$table->string('file_type');
|
||||
$table->datetime('deleted_at')->nullable();
|
||||
$table->integer('deleted_by')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('user_id')
|
||||
->references('id')->on('users')
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign('payment_id')
|
||||
->references('id')->on('payment')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
|
||||
// once the table is created use a raw query to ALTER it and add the MEDIUMBLOB
|
||||
DB::statement("ALTER TABLE fileresit ADD filename LONGBLOB");
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('fileresit');
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<h4> Senarai Bayaran Atas Talian </h4>
|
||||
<p><i class="fas fa-caret-right"></i> {{ $getkodcaw['caw_name'] }}</p>
|
||||
<table class="table table-striped table-xl text-center" id="sahsagonline" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
@@ -34,7 +36,7 @@
|
||||
<td>{{ $winner['totalBid']}}</td>
|
||||
<td>{{ $winner['totalPay']}}</td>
|
||||
<td>
|
||||
<a href=" {{ route('account.sahsagonline', ['user_id'=>$winner['details']['id'], 'lelong_id'=>$lelong_id]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a>
|
||||
<a href=" {{ route('account.sahsagonline', ['user_id'=>$winner['details']['id'], 'lelong_id'=>$lelong_id, 'caw_code'=>$caw_code]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -10,6 +10,15 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<div class="container">
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-12 mx-auto card p-4" style="margin-top:2%; margin-bottom:2%;">
|
||||
<p> <b>Nama Pembida : </b> {{ $userdetails['name'] }}</p>
|
||||
<p> <b>No Kad Pengenalan : </b> {{ $userdetails['nokp'] }}</p>
|
||||
<p> <b>No Telefon : </b> {{ $userdetails['notelbimbit'] }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('account.sahbayaronline') }}" method="POST" id="formsahbayaronline">
|
||||
@csrf
|
||||
<input type="hidden" name="lelong_id" value="{{ $lelong_id }}" />
|
||||
@@ -49,19 +58,54 @@
|
||||
<td colspan="2"><b> Jumlah Bayaran</b></td>
|
||||
<td colspan="2"></td>
|
||||
<td colspan="1"><b>RM<input type="text" id="total" value="{{ $total_payment }}" style="border: none;" readonly></b></td>
|
||||
<td colspan="3"></td>
|
||||
<td></td>
|
||||
<td>
|
||||
@if($getresit)
|
||||
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#exampleModal">
|
||||
Lihat Resit <i class="fas fa-file-alt"></i>
|
||||
</button>
|
||||
@else
|
||||
@endif
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="modal-footer" style="margin-top:2%;">
|
||||
<a href="{{ route('account.senarailelongan') }}" class="btn btn-primary">Kembali</a>
|
||||
<!-- <a href="{{ route('account.sahbayaronline', ['lelong_id'=>$lelong_id, 'user_id'=>$user_id]) }}" class="btn btn-warning">Sahkan</a> -->
|
||||
<button type="button" class="btn btn-warning" onclick="confirm()" >Sahkan</button>
|
||||
<a href="{{ route('account.listbayaranonline', [$lelong_id,$caw_code]) }}" class="btn btn-primary">Kembali</a>
|
||||
@if($checking)
|
||||
<button type="button" class="btn btn-success" disabled>Berjaya Disahkan</button>
|
||||
@else
|
||||
<button type="button" class="btn btn-warning" onclick="confirm()" >Sahkan</button>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Resit Bayaran CDM</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body text-center" style="padding:3rem">
|
||||
@foreach($getresit as $resit)
|
||||
<div class=".col-6 .col-sm-4 form-check form-check-inline">
|
||||
<img src="data:image/png;base64, {{ $resit['filename'] }}" alt="Image Preview" style="width:350px; height:450px; border: 1px solid #dee2e6"/>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Kembali</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
function confirm() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<h4 style="margin-left:1%;"> Senarai Lelongan </h4>
|
||||
<table class="table table-striped table-xl text-center" id="senarailelongan" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
@@ -28,7 +29,7 @@
|
||||
<td>{{ $data->tarikh_lelong }}</td>
|
||||
<td>{{ $data->sts_lelong }}</td>
|
||||
<td>
|
||||
<a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['lelong_id']]) }} " data-toggle="tooltip" data-placement="top" title="Senarai Pembida"><i class="far fa-edit"></i></a>
|
||||
<a href=" {{ route('account.listbayaranonline', ['lelong_id'=>$data['lelong_id'], 'caw_code'=>$data['caw_code']]) }} " data-toggle="tooltip" data-placement="top" title="Senarai Pembida"><i class="far fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="container">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<form action="{{ route('pembayaran.banktransfer') }}" method="POST" id="formbanktransfer">
|
||||
<form action="{{ route('pembayaran.banktransfer') }}" method="POST" id="">
|
||||
@csrf
|
||||
<input type="hidden" name="user_id" value="{{ $user_id }}" />
|
||||
<input type="hidden" name="lelong_id" value="{{ $lelong_id }}" />
|
||||
@@ -34,16 +34,18 @@
|
||||
@foreach($eachbid as $biditem)
|
||||
<tr>
|
||||
<td class="text-center">{{ $loop->iteration }}</td>
|
||||
<td class="text-center">{{ $biditem->norujukan}}</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">
|
||||
@if($biditem->status_payment == 0)
|
||||
<input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" data-bid_id="{{ $biditem->lelongbid_id}}" onclick="sum(this.value,this)" value="{{ $biditem->hargabida }}">
|
||||
@elseif($biditem->status_payment == 2)
|
||||
<span class="btn btn-warning btn-sm hovernone-warning">MENUNGGU PENGESAHAN</span>
|
||||
<span class="btn btn-warning btn-sm hovernone-warning">TUNGGU PENGESAHAN</span>
|
||||
@else
|
||||
<span class="btn btn-danger btn-sm hovernone-danger">PAID</span>
|
||||
<span class="btn btn-success btn-sm hovernone-success">PAID</span>
|
||||
|
||||
@endif
|
||||
</td>
|
||||
@@ -52,14 +54,21 @@
|
||||
<tr>
|
||||
<td colspan="3"><b> Jumlah Bayaran</b></td>
|
||||
<td class="text-center"><b>RM<input type="text" id="total" name="total" value="0" style="border: none;" readonly></b></td>
|
||||
<td> </td>
|
||||
<td class="text-center">
|
||||
@if($getresit)
|
||||
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#exampleModal">
|
||||
Lihat Resit <i class="fas fa-file-alt"></i>
|
||||
</button>
|
||||
@else
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<div class="text-right">
|
||||
<a href="{{ route('pembayaran.kaunterpembayaran', $lelong_id ) }}" class="btn btn-primary" style="width:15%; margin-right:53%;" >Kembali</a>
|
||||
<button type="button" class="btn btn-info" style="width:15%" id="btnbanktransfer" onclick="confirm()">CDM</button>
|
||||
<button type="button" class="btn btn-info" style="width:15%" id="btnbanktransfer" onclick="funccdm()">CDM</button>
|
||||
<button type="button" class="btn btn-success" style="width:15%" id="btnterima" onclick="functerima()">Tunai</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -174,25 +183,108 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="CDM" data-backdrop="static" data-keyboard="false" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
|
||||
|
||||
<div class="modal-content text-center">
|
||||
<form action="{{ route('pembayaran.banktransfer') }}" method="POST" id="formbanktransfer" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="user_id" value="{{ $user_id }}" />
|
||||
<input type="hidden" name="lelong_id" value="{{ $lelong_id }}" />
|
||||
<input type="hidden" name="eachbid[]" id="eachbid" value="" />
|
||||
<input type="hidden" name="total_payment" id="totalpay" value="" />
|
||||
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Bukti Pembayaran</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="flamingo-tab">
|
||||
<div class="input-group">
|
||||
<div class="custom-file">
|
||||
<input type="file" name="resit" id="inputGroupFile04" >
|
||||
{{-- <label class="custom-file-label" for="inputGroupFile04">Muat Naik Resit</label> --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" onclick="funccdmbatal()">Batal</button>
|
||||
<button type="button" class="btn btn-success" data-toggle="modal" data-target=".bd-example-modal-sm" onclick="submitcdm()" >Muat Naik</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Resit Bayaran CDM</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body text-center" style="padding:3rem">
|
||||
@foreach($getresit as $resit)
|
||||
<div class=".col-6 .col-sm-4 form-check form-check-inline">
|
||||
<img src="data:image/png;base64, {{ $resit['filename'] }}" alt="Image Preview" style="width:350px; height:450px; border: 1px solid #dee2e6"/>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Kembali</button>
|
||||
<button type="button" class="btn btn-primary" onclick="funcubah()">Ubah</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var arraylelongbid = [];
|
||||
$("#btnterima").prop("disabled", true);
|
||||
$("#btnbanktransfer").prop("disabled", true);
|
||||
function terimadeno() {
|
||||
function terimadeno()
|
||||
{
|
||||
$("input[name='eachbid[]']").val(arraylelongbid);
|
||||
$("#formpaymentdenokaunter").submit();
|
||||
}
|
||||
function funcbatal(){
|
||||
$('#denominasiHQModal').modal('hide');
|
||||
}
|
||||
function functerima(){
|
||||
|
||||
function functerima()
|
||||
{
|
||||
$('#denominasiHQModal').modal('show');
|
||||
var total_sum = parseFloat($('#total').val());
|
||||
$('#amaundiminta').val(parseFloat(total_sum).toFixed(2));
|
||||
$('#amaunkiraan').val(parseFloat(0).toFixed(2));
|
||||
}
|
||||
function funcbatal(){
|
||||
$('#denominasiHQModal').modal('hide');
|
||||
}
|
||||
function submitcdm() {
|
||||
$("input[name='eachbid[]']").val(arraylelongbid);
|
||||
$("#formbanktransfer").submit();
|
||||
}
|
||||
function funccdm()
|
||||
{
|
||||
$('#CDM').modal('show');
|
||||
var total_sum = parseFloat($('#total').val());
|
||||
$('#totalpay').val(parseFloat(total_sum).toFixed(2));
|
||||
}
|
||||
function funccdmbatal()
|
||||
{
|
||||
$('#CDM').modal('hide');
|
||||
}
|
||||
function funcubah()
|
||||
{
|
||||
$('#exampleModal').modal('hide');
|
||||
$('#CDM').modal('show');
|
||||
}
|
||||
function confirm() {
|
||||
$.confirm({
|
||||
title: 'Confirmation',
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
<a href="{{ route('serahan.penyatabayaran',['user_id'=>$winner['details']['id'],'lelong_id'=>$lelong_id]) }}" target = "blank" data-toggle="tooltip" data-placement="top" title="Muat Turun Penyata Bayaran" ><i class="fas fa-download"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
@if( ($winner['totalPay'] < $winner['totalBid']) || ($winner['sts_payment'] == 2) )
|
||||
{{-- @if( ($winner['totalPay'] < $winner['totalBid']) || ($winner['sts_payment'] == 2) ) --}}
|
||||
<a href=" {{ route('pembayaran.SAGBidItem', ['user_id'=>$winner['details']['id'], 'lelong_id'=>$lelong_id]) }} " data-toggle="tooltip" data-placement="top" title="Buat Pembayaran"><i class="far fa-edit"></i></a>
|
||||
@endif
|
||||
{{-- @endif --}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
+2
-2
@@ -273,8 +273,8 @@ Route::group(['middleware' => ['permission:tangguhlelong'],'prefix'=>'tangguhlel
|
||||
// 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']);
|
||||
Route::get('/listbayaranonline/{lelong_id}/{caw_code}', ['as'=>'account.listbayaranonline','uses'=>'AccountController@listbayaranonline']);
|
||||
Route::get('/sahsagonline/{lelong_id}/{user_id}/{caw_code}', ['as'=>'account.sahsagonline','uses'=>'AccountController@sahsagonline']);
|
||||
Route::post('/sahbayaronline', ['as'=>'account.sahbayaronline','uses'=>'AccountController@sahbayaronline']);
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user