Merge branch 'amirah' of https://gitlab.com/azfararsyad/lelong into amirah
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
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;
|
||||
use App\Models\Resit;
|
||||
|
||||
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')
|
||||
->join('payment', 'lelongbid.id', '=', 'payment.lelongbid_id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('lelongbidder.user_id', $user_id)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('payment.status_payment_opt', 2)
|
||||
->get()->toArray();
|
||||
|
||||
// dd($senaraisag);
|
||||
|
||||
$total_payment = 0;
|
||||
foreach($senaraisag as $index1=>$sagbid){
|
||||
|
||||
if($sagbid['total_payment']){
|
||||
$total_payment = $total_payment +$sagbid['total_payment'];
|
||||
}
|
||||
|
||||
// $senaraisag[$index1]['totalPay'] = $total_payment;
|
||||
}
|
||||
// dd($senaraisag);
|
||||
return view('account.sahsagonline', compact('senaraisag', 'user_id', 'lelong_id','total_payment'));
|
||||
}
|
||||
|
||||
public function sahbayaronline($lelong_id, $user_id){
|
||||
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
$senaraisag = LelongBid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
||||
->join('payment', 'lelongbid.id', '=', 'payment.lelongbid_id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('lelongbidder.user_id', $user_id)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->where('payment.status_payment_opt', 2)
|
||||
->get();
|
||||
|
||||
$total_payment = 0;
|
||||
foreach($senaraisag as $sag)
|
||||
{
|
||||
$payment = Payment::where('lelong_id', $lelong_id)
|
||||
->where('user_id', $user_id)
|
||||
->where('lelongbid_id',$sag->lelongbid_id)
|
||||
->first();
|
||||
$payment->disahkan_oleh = $user->id;
|
||||
$payment->disahkan_pada = $currentdate;
|
||||
$payment->save();
|
||||
|
||||
$total_payment = $total_payment + $payment->total_payment;
|
||||
|
||||
$updatelelbidbidder = LelongBidder::where('lelongbid_id', $sag->lelongbid_id)
|
||||
->first();
|
||||
$updatelelbidbidder->status_payment = 1;
|
||||
$updatelelbidbidder->save();
|
||||
|
||||
$eachbid = LelongBid::where('id',$sag->lelongbid_id)->first();
|
||||
$eachbid->status_jual = 1;
|
||||
$eachbid->t_jual = $currentdate;
|
||||
$eachbid->save();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$senaraisagallpayment = LelongBid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('lelongbidder.user_id', $user_id)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->get();
|
||||
// dd($senaraisagallpayment);
|
||||
$resit = Resit::where('id',$payment->resit_id)->first();
|
||||
$resit->total_payment = $resit->total_payment + $total_payment;
|
||||
|
||||
if($resit->total_payment >= $senaraisagallpayment->sum('hargabida'))
|
||||
{
|
||||
$resit->status = 'PAID';
|
||||
$resit->paid_at = $currentdate;
|
||||
}
|
||||
$resit->save();
|
||||
|
||||
return redirect()->route('account.senarailelongan')->with('success','Pembayaran Berjaya');
|
||||
|
||||
}
|
||||
}
|
||||
@@ -296,8 +296,6 @@ class LelongController extends Controller
|
||||
$lelongbid->baki =$simulasibid->baki;
|
||||
$lelongbid->berat =$simulasibid->berat;
|
||||
$lelongbid->marhun =$simulasibid->marhun;
|
||||
$lelongbid->gst_hj =$simulasibid->gst_hj;
|
||||
$lelongbid->gst_cl =$simulasibid->gst_cl;
|
||||
$lelongbid->percent =$simulasibid->percent;
|
||||
$lelongbid->status_jual =$simulasibid->status_jual;
|
||||
$lelongbid->status_payment =$simulasibid->status_payment;
|
||||
@@ -448,11 +446,13 @@ class LelongController extends Controller
|
||||
$lelongbid = LelongBid::where('lelong_id','=',$id)->get();
|
||||
foreach($lelongbid as $bid)
|
||||
{
|
||||
$highestprice = LelongBidder::where('lelongbid_id','=',$bid->id)->orderByRaw('lelongbidder.hargabida DESC' )->get();
|
||||
$highestprice = LelongBidder::where('lelongbid_id','=',$bid->id)->orderBy('lelongbidder.hargabida','DESC' )->first();
|
||||
// dd($highestprice->hargabida);
|
||||
if($highestprice)
|
||||
{
|
||||
foreach($highestprice as $price){
|
||||
$bidders = LelongBidder::where('hargabida','=',$price->hargabida)->MIN('lelongbidder.masa_bidaan' )->get();
|
||||
// foreach($highestprice as $price){
|
||||
$bidders = LelongBidder::where('lelongbid_id','=',$bid->id)->where('hargabida','=',$highestprice->hargabida)->orderBy('masa_bidaan','ASC' )->get();
|
||||
// dd($bidders);
|
||||
$count = 0;
|
||||
foreach($bidders as $bidder)
|
||||
{
|
||||
@@ -460,11 +460,12 @@ class LelongController extends Controller
|
||||
if($count == 1)
|
||||
{
|
||||
$pemenang = LelongBidder::where('id','=',$bidder->id)
|
||||
->first();
|
||||
->first();
|
||||
$pemenang->status_bidder = 1;
|
||||
$pemenang->save();
|
||||
|
||||
|
||||
$updatebid = LelongBid::where('id','=',$bid->id)->first();
|
||||
// dd($updatebid);
|
||||
$updatebid->hargajual = $bidder->hargabida;
|
||||
$updatebid->nopembeli = $bidder->user_id;
|
||||
$updatebid->status_jual = 1;
|
||||
@@ -488,7 +489,7 @@ class LelongController extends Controller
|
||||
$resit->lelong_id = $id;
|
||||
$resit->reference_no = $reference_no;
|
||||
$resit->billplz_id = '';
|
||||
$resit->total_payment = '';
|
||||
$resit->total_payment = '0.00';
|
||||
$resit->resit_type = 2; // 1 = fee , 2 = bid
|
||||
$resit->save();
|
||||
}
|
||||
@@ -501,7 +502,7 @@ class LelongController extends Controller
|
||||
$kalah->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
else
|
||||
@@ -565,11 +566,8 @@ class LelongController extends Controller
|
||||
|
||||
public function senarailelongtaklaku(Request $request){
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
$senarai = CawanganLelong::join('lelong', 'cawangan_lelong.lelong_id', '=', 'lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
->where('cawangan.caw_code', $user->kodcaw)
|
||||
->get();
|
||||
|
||||
return view('lelong.senarailelongtaklaku',compact('senarai'));
|
||||
@@ -582,6 +580,7 @@ class LelongController extends Controller
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->whereNull('t_jual')
|
||||
->select(
|
||||
'lelongbid.norujukan',
|
||||
'lelongbid.t_lelong',
|
||||
'lelongbid.kodcaw',
|
||||
'cawangan.caw_name',
|
||||
@@ -600,6 +599,7 @@ class LelongController extends Controller
|
||||
|
||||
$suratlelongtaklaku = LelongBid::join('lelong', 'lelongbid.lelong_id', '=', 'lelong.id')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->where('status_jual', '=', 1)
|
||||
->whereNull('t_jual')
|
||||
->get();
|
||||
|
||||
|
||||
@@ -126,7 +126,14 @@ class MarhunController extends Controller
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function senarailelongmarhun(Request $request){
|
||||
|
||||
$senarai = CawanganLelong::join('lelong', 'cawangan_lelong.lelong_id', '=', 'lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
->get();
|
||||
|
||||
return view('marhun.senarailelongmarhun',compact('senarai'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,25 +28,33 @@ class LelongMobileController extends Controller
|
||||
->where('sts_lelong','=',1)
|
||||
->get()->toArray();
|
||||
|
||||
foreach($lelong as $index1=>$lel)
|
||||
if($lelong)
|
||||
{
|
||||
$lelongbid = LelongBid::whereIn('lelong_id',$lelong)
|
||||
->get()->toArray();
|
||||
|
||||
$lelong[$index1]['lelongbid'] = $lelongbid;
|
||||
|
||||
foreach($lelongbid as $index2=>$lelbidmarhun){
|
||||
$cawangan = Cawangan::where('id','=',$lelbidmarhun['caw_id'])->first()->toArray();
|
||||
// $id = lelongbid::first();
|
||||
|
||||
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['id'])
|
||||
foreach($lelong as $index1=>$lel)
|
||||
{
|
||||
$lelongbid = LelongBid::whereIn('lelong_id',$lelong)
|
||||
->get()->toArray();
|
||||
|
||||
$lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun;
|
||||
$lelong[$index1]['lelongbid'][$index2]['cawangan'] = $cawangan;
|
||||
$lelong[$index1]['lelongbid'] = $lelongbid;
|
||||
|
||||
foreach($lelongbid as $index2=>$lelbidmarhun){
|
||||
$cawangan = Cawangan::where('id','=',$lelbidmarhun['caw_id'])->first()->toArray();
|
||||
// $id = lelongbid::first();
|
||||
|
||||
$lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $lelbidmarhun['id'])
|
||||
->get()->toArray();
|
||||
|
||||
$lelong[$index1]['lelongbid'][$index2]['lelongbidmarhun'] = $lelongbidmarhun;
|
||||
$lelong[$index1]['lelongbid'][$index2]['cawangan'] = $cawangan;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$lelong[0]['lelongbid'] = [];
|
||||
}
|
||||
|
||||
return response()->json($lelong);
|
||||
|
||||
@@ -79,7 +87,8 @@ class LelongMobileController extends Controller
|
||||
'lelongbid.t_lelong',
|
||||
'lelongbid.nilaimarhun',
|
||||
'lelongbid.cajlelong',
|
||||
'carts.hargabida')
|
||||
'carts.hargabida',
|
||||
'carts.id as cart_id')
|
||||
->get();
|
||||
|
||||
// dd($selectBid[0]->hargabida);
|
||||
@@ -97,14 +106,28 @@ class LelongMobileController extends Controller
|
||||
$lelongBidder->nilaimarhun = $cart->nilaimarhun;
|
||||
$lelongBidder->cajlelong = $cart->cajlelong;
|
||||
$lelongBidder->masa_bidaan = $currentdate;
|
||||
$lelongBidder->save();
|
||||
if($lelongBidder->save())
|
||||
{
|
||||
$delincart = Cart::where('id',$cart->cart_id)->first();
|
||||
$delincart->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return response()->json("success", 201);
|
||||
$response = [
|
||||
'success' => "success",
|
||||
'message' => "Bidder berjaya disimpan"
|
||||
];
|
||||
|
||||
return response()->json($response, 201);
|
||||
}
|
||||
else if($feepayment == null){
|
||||
return response()->json("unsuccess", 201);
|
||||
|
||||
$errors = [
|
||||
'success' => "error",
|
||||
'message' => "Something wrong with the server"
|
||||
];
|
||||
return response()->json($response, 201);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,25 +87,22 @@ class PaymentController extends Controller
|
||||
'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',
|
||||
'lelongbidder.lelongbid_id',
|
||||
'lelongbidder.status_payment'
|
||||
)
|
||||
->get();
|
||||
$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',
|
||||
'lelongbidder.lelongbid_id',
|
||||
'lelongbidder.status_payment'
|
||||
)
|
||||
->get();
|
||||
|
||||
// }
|
||||
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem', 'eachbid', 'lelong_id'));
|
||||
return view('pembayaran.SAGBidItem',compact('SAGBidItem', 'eachbid', 'lelong_id','user_id'));
|
||||
}
|
||||
|
||||
public function paymentdenokaunter(Request $request){
|
||||
@@ -119,6 +116,7 @@ class PaymentController extends Controller
|
||||
$bid_id = explode(",", $request->eachbid);
|
||||
|
||||
$resit = Resit::where('lelong_id', $request->lelong_id)
|
||||
->where('user_id',$request->user_id)
|
||||
->first();
|
||||
|
||||
$total_hargabida = 0;
|
||||
@@ -135,8 +133,9 @@ class PaymentController extends Controller
|
||||
'lelongbid.lelong_id as lelong_id'
|
||||
)
|
||||
->first();
|
||||
|
||||
|
||||
$total_hargabida = $total_hargabida + $eachbid->hargabida;
|
||||
// dd($total_hargabida);
|
||||
$payment = Payment::create([
|
||||
'user_id' => $request->user_id,
|
||||
'lelongbidder_id' => $eachbid->lelongbidder_id,
|
||||
@@ -166,18 +165,29 @@ class PaymentController extends Controller
|
||||
$updatelelbidbidder = LelongBidder::where('lelongbid_id', $eachbid->lelongbid_id)
|
||||
->first();
|
||||
$updatelelbidbidder->status_payment = 1;
|
||||
$updatelelbidbidder->update();
|
||||
$updatelelbidbidder->save();
|
||||
|
||||
$eachbid->status_jual = 1;
|
||||
$eachbid->t_jual = $currentdate;
|
||||
$eachbid->update();
|
||||
$eachbidupdate = LelongBid::where('id',$bid)->first();
|
||||
$eachbidupdate->status_jual = 1;
|
||||
$eachbidupdate->t_jual = $currentdate;
|
||||
$eachbidupdate->save();
|
||||
|
||||
}
|
||||
if($request->amaunkiraan == $total_hargabida){
|
||||
$resit->total_payment = $total_hargabida;
|
||||
$resit->status = 'PAID';
|
||||
$resit->paid_at = $currentdate;
|
||||
$resit->update();
|
||||
$senaraisagallpayment = LelongBid::join('lelongbidder', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
||||
->where('lelongbid.lelong_id', $request->lelong_id)
|
||||
->where('lelongbidder.user_id', $request->user_id)
|
||||
->where('lelongbidder.status_bidder', 1)
|
||||
->get();
|
||||
// dd(floatval($request->amaunkiraan));
|
||||
if(floatval($request->amaunkiraan) == $total_hargabida){
|
||||
// dd('hye');
|
||||
$resit->total_payment = $resit->total_payment + $total_hargabida;
|
||||
if($resit->total_payment >= $senaraisagallpayment->sum('hargabida'))
|
||||
{
|
||||
$resit->status = 'PAID'; // $resit->status = 'PAID'; when hargabida >= total_payment di resit
|
||||
$resit->paid_at = $currentdate;
|
||||
}
|
||||
$resit->save();
|
||||
}
|
||||
return redirect()->route('pembayaran.SenaraiLelongBayar')->with('success','Pembayaran Berjaya');
|
||||
}
|
||||
|
||||
@@ -61,8 +61,6 @@ class PembidaController extends Controller
|
||||
return view('pembida.show',compact('user','files'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function delete(Request $request)
|
||||
{
|
||||
$user = User::where('id','=',$request->userid)->first();
|
||||
@@ -110,7 +108,66 @@ class PembidaController extends Controller
|
||||
->with('unsuccessful','Pengesahan Ditolak');
|
||||
}
|
||||
|
||||
|
||||
public function senaraipembidakeseluruhan(Request $request)
|
||||
{
|
||||
// $alluser = User::all();
|
||||
$alluser = User::where('user_type','=',2)
|
||||
->get();
|
||||
|
||||
// dd($alluser);
|
||||
|
||||
// $allroles = Role::all()->pluck('name');
|
||||
// $user = Auth::user();
|
||||
// $user->assignRole('admin');
|
||||
return view('pembida.senaraipembidakeseluruhan',compact('alluser'));
|
||||
}
|
||||
|
||||
public function kemaskini($userid)
|
||||
{
|
||||
// dd($userid);
|
||||
$user = User::where('id','=',$userid)->first();
|
||||
$files = File::where('user_id','=',$userid)->get()->toArray();
|
||||
|
||||
$array_ic = [];
|
||||
foreach($files as $index=>$file)
|
||||
{
|
||||
$files[$index]['ic64']= 'data:image/' . $file['file_type'] . ';base64,' . base64_encode($file['filename']);
|
||||
}
|
||||
|
||||
// dd($files);
|
||||
return view('pembida.kemaskini',compact('user','files'));
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
if($request->status == true)
|
||||
{
|
||||
$status = 'active';
|
||||
}
|
||||
else if($request->statusban == true)
|
||||
{
|
||||
$status = 'banned';
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = 'inactive';
|
||||
}
|
||||
|
||||
$user = User::where('id','=',$request->userid)->first();
|
||||
// dd($user);
|
||||
$user->email = $request->email;
|
||||
$user->notelbimbit = $request->notelbimbit;
|
||||
$user->nokp = $request->nokp;
|
||||
$user->updated_at = $currentdate;
|
||||
$user->status = $status;
|
||||
|
||||
$user->save();
|
||||
|
||||
return redirect()->route('pembida.senaraipembidakeseluruhan')->with('success','Pembida Berjaya Dikemaskini');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use Spatie\Permission\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use PDF;
|
||||
|
||||
class PenggunaController extends Controller
|
||||
@@ -49,6 +50,8 @@ class PenggunaController extends Controller
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
$user = User::where('id','=',$request->userid)->first();
|
||||
$allroles = Role::all()->pluck('name');
|
||||
@@ -64,6 +67,30 @@ class PenggunaController extends Controller
|
||||
}
|
||||
// dd($arraytaraf);
|
||||
$user->syncRoles($arraytaraf);
|
||||
|
||||
if($request->status == true)
|
||||
{
|
||||
$status = 'active';
|
||||
}
|
||||
else if($request->statusban == true)
|
||||
{
|
||||
$status = 'banned';
|
||||
}
|
||||
else
|
||||
{
|
||||
$status = 'inactive';
|
||||
}
|
||||
|
||||
$user = User::where('id','=',$request->userid)->first();
|
||||
// dd($user);
|
||||
$user->email = $request->email;
|
||||
$user->notelbimbit = $request->notelbimbit;
|
||||
$user->nokp = $request->nokp;
|
||||
$user->updated_at = $currentdate;
|
||||
$user->status = $status;
|
||||
|
||||
$user->save();
|
||||
|
||||
return redirect()->route('pengguna.index')
|
||||
->with('success','Kemaskini Berjaya');
|
||||
}
|
||||
|
||||
@@ -123,19 +123,17 @@ class SimulasiController extends Controller
|
||||
$simulasibid->hargajual = 0.00;
|
||||
$simulasibid->jbg = $data->jbg;
|
||||
$simulasibid->kadarupah = $data->kadarupah;
|
||||
$simulasibid->upahsimpan = $data->upahsimpan;
|
||||
$simulasibid->upahsimpan = $data->upahSim;
|
||||
$simulasibid->ansuran = $data->ansuran;
|
||||
$simulasibid->nilaimarhun = $data->nilaimarhun;
|
||||
$simulasibid->pinjaman = $data->pinjaman;
|
||||
$simulasibid->bakiupah = $data->bakiupah;
|
||||
$simulasibid->cajlain = $data->cajlain;
|
||||
$simulasibid->cajlelong = 0.00;
|
||||
$simulasibid->baki = $data->baki;
|
||||
$simulasibid->baki = 0.00;
|
||||
$simulasibid->berat = $data->berat;
|
||||
$simulasibid->marhun = $data->marhun;
|
||||
$simulasibid->gst_hj = $data->gst_hj;
|
||||
$simulasibid->gst_cl = $data->gst_cl;
|
||||
$simulasibid->percent = $data->percent;
|
||||
$simulasibid->percent = $data->percentpinj;
|
||||
$simulasibid->status_jual = 0;
|
||||
$simulasibid->status_payment = 0;
|
||||
$simulasibid->mora_upah = 0;
|
||||
@@ -143,7 +141,7 @@ class SimulasiController extends Controller
|
||||
|
||||
$sumhargaasas = 0;
|
||||
$berat = 0;
|
||||
$gadaimarhun = GadaiMarhun::where('gadai_id','=',$data->id)->get();
|
||||
$gadaimarhun = GadaiMarhun::where('norujukan','=',$data->norujukan)->get();
|
||||
foreach($gadaimarhun as $marhun)
|
||||
{
|
||||
$simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get();
|
||||
@@ -209,7 +207,7 @@ class SimulasiController extends Controller
|
||||
$simulasibid->hargajual = 0.00;
|
||||
$simulasibid->jbg = $data->jbg;
|
||||
$simulasibid->kadarupah = $data->kadarupah;
|
||||
$simulasibid->upahsimpan = $data->upahsimpan;
|
||||
$simulasibid->upahsimpan = $data->upahSim;
|
||||
$simulasibid->ansuran = $data->ansuran;
|
||||
$simulasibid->nilaimarhun = $data->nilaimarhun;
|
||||
$simulasibid->pinjaman = $data->pinjaman;
|
||||
@@ -219,9 +217,7 @@ class SimulasiController extends Controller
|
||||
$simulasibid->baki = $data->baki;
|
||||
$simulasibid->berat = $data->berat;
|
||||
$simulasibid->marhun = $data->marhun;
|
||||
$simulasibid->gst_hj = $data->gst_hj;
|
||||
$simulasibid->gst_cl = $data->gst_cl;
|
||||
$simulasibid->percent = $data->percent;
|
||||
$simulasibid->percent = $data->percentpinj;
|
||||
$simulasibid->status_jual = 0;
|
||||
$simulasibid->status_payment = 0;
|
||||
$simulasibid->mora_upah = 0;
|
||||
@@ -229,7 +225,7 @@ class SimulasiController extends Controller
|
||||
|
||||
$sumhargaasas = 0;
|
||||
$berat = 0;
|
||||
$gadaimarhun = GadaiMarhun::where('gadai_id','=',$data->id)->get();
|
||||
$gadaimarhun = GadaiMarhun::where('norujukan','=',$data->norujukan)->get();
|
||||
foreach($gadaimarhun as $marhun)
|
||||
{
|
||||
$simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get();
|
||||
|
||||
Reference in New Issue
Block a user