diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php new file mode 100644 index 00000000..59142949 --- /dev/null +++ b/app/Http/Controllers/AccountController.php @@ -0,0 +1,161 @@ +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'); + + } +} diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index d3aa8cec..28290951 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -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(); diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index c1148ad5..c8f5f298 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -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')); + } } \ No newline at end of file diff --git a/app/Http/Controllers/Mobile/LelongMobileController.php b/app/Http/Controllers/Mobile/LelongMobileController.php index 937886ac..164d78df 100644 --- a/app/Http/Controllers/Mobile/LelongMobileController.php +++ b/app/Http/Controllers/Mobile/LelongMobileController.php @@ -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); } } diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 8ba01372..9e9c856a 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -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'); } diff --git a/app/Http/Controllers/PembidaController.php b/app/Http/Controllers/PembidaController.php index 591f16e5..13b73406 100644 --- a/app/Http/Controllers/PembidaController.php +++ b/app/Http/Controllers/PembidaController.php @@ -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'); + } } \ No newline at end of file diff --git a/app/Http/Controllers/PenggunaController.php b/app/Http/Controllers/PenggunaController.php index 817b3686..1c031025 100644 --- a/app/Http/Controllers/PenggunaController.php +++ b/app/Http/Controllers/PenggunaController.php @@ -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'); } diff --git a/app/Http/Controllers/SimulasiController.php b/app/Http/Controllers/SimulasiController.php index 371a799a..71ec1773 100644 --- a/app/Http/Controllers/SimulasiController.php +++ b/app/Http/Controllers/SimulasiController.php @@ -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(); diff --git a/app/Models/Gadai.php b/app/Models/Gadai.php index 7569b3f0..67a12f24 100644 --- a/app/Models/Gadai.php +++ b/app/Models/Gadai.php @@ -25,8 +25,6 @@ class Gadai extends Model 'baki', 'berat', 'marhun', - 'gst_hj', - 'gst_cl', 'percent', 'mora_upah', 't_gadai', diff --git a/app/Models/GadaiMarhun.php b/app/Models/GadaiMarhun.php index f2bf32ed..a1fdd6ef 100644 --- a/app/Models/GadaiMarhun.php +++ b/app/Models/GadaiMarhun.php @@ -12,7 +12,7 @@ class GadaiMarhun extends Model protected $table = 'gadaimarhun'; protected $fillable = [ - 'gadai_id', + 'norujukan', 'bil', 'marhun', 'nota', diff --git a/app/Models/LelongBid.php b/app/Models/LelongBid.php index 75247c3c..304d1bbc 100644 --- a/app/Models/LelongBid.php +++ b/app/Models/LelongBid.php @@ -31,8 +31,6 @@ class LelongBid extends Model 'baki', 'berat', 'marhun', - 'gst_hj', - 'gst_cl', 'percent', 'status_jual', 'status_payment', diff --git a/app/Models/SimulasiBid.php b/app/Models/SimulasiBid.php index 1a286d19..32787ab8 100644 --- a/app/Models/SimulasiBid.php +++ b/app/Models/SimulasiBid.php @@ -31,8 +31,6 @@ class SimulasiBid extends Model 'baki', 'berat', 'marhun', - 'gst_hj', - 'gst_cl', 'percent', 'status_jual', 'status_payment', diff --git a/database/migrations/2021_12_13_053311_create_cawangans_table.php b/database/migrations/2021_12_13_053311_create_cawangans_table.php index f369b89b..7dadcf22 100644 --- a/database/migrations/2021_12_13_053311_create_cawangans_table.php +++ b/database/migrations/2021_12_13_053311_create_cawangans_table.php @@ -84,47 +84,150 @@ class CreateCawangansTable extends Migration Schema::create('gadai', function (Blueprint $table) { $table->bigIncrements('id'); - $table->string('kodcaw'); + $table->string('kodcaw')->nullable(); $table->string('norujukan'); - $table->string('nokp'); - $table->decimal('jbg', $precision = 7, $scale = 2); - $table->decimal('kadarupah', $precision = 5, $scale = 2)->nullable(); - $table->decimal('upahsimpan', $precision = 11, $scale = 2)->nullable(); - $table->decimal('ansuran', $precision = 11, $scale = 2)->nullable(); + $table->string('prkod')->nullable(); + $table->string('nopelanggan'); + $table->string('nokp')->nullable(); + $table->date('t_gadai'); + $table->time('masa')->nullable(); + $table->integer('sirig')->nullable(); $table->decimal('nilaimarhun', $precision = 9, $scale = 2)->nullable(); + $table->decimal('n_marhuns', $precision = 9, $scale = 2)->nullable(); + $table->decimal('berat', $precision = 7, $scale = 2)->nullable(); $table->decimal('pinjaman', $precision = 9, $scale = 2)->nullable(); + $table->decimal('telahbayar', $precision = 7, $scale = 2)->nullable(); + $table->decimal('upahtelahbyr', $precision = 7, $scale = 2)->nullable(); + $table->decimal('cajtelahbyr', $precision = 7, $scale = 2)->nullable(); + $table->decimal('ansuran', $precision = 9, $scale = 2)->nullable(); + $table->decimal('ansupah', $precision = 7, $scale = 2)->nullable(); + $table->decimal('kadarupah', $precision = 5, $scale = 2)->nullable(); + $table->decimal('tempoh', $precision = 10, $scale = 2)->nullable(); + $table->date('t_lanjut1')->nullable(); + $table->date('t_lanjut2')->nullable(); + $table->date('t_matang')->nullable(); + $table->date('t_matang1')->nullable(); + $table->date('t_matang2')->nullable(); + $table->date('t_notis1')->nullable(); + $table->date('t_notis2')->nullable(); + $table->date('t_notis3')->nullable(); + $table->date('t_lelong')->nullable(); + $table->date('t_hapus')->nullable(); + $table->string('sttebus'); + $table->string('terima')->nullable(); + $table->integer('cetak')->nullable(); + $table->string('tncek')->nullable(); + $table->string('nocek')->nullable(); + $table->string('bkcode')->nullable(); + $table->string('glcode')->nullable(); + $table->string('teller')->nullable(); + $table->string('pelulus')->nullable(); + $table->string('pelulust')->nullable(); + $table->string('disburseid')->nullable(); + $table->time('disbursetime')->nullable(); + $table->string('cancelid')->nullable(); + $table->time('canceltime')->nullable(); + $table->string('f_lulus')->nullable(); + $table->string('tag')->nullable(); + $table->decimal('jbg', $precision = 9, $scale = 2); + $table->decimal('bakipjm', $precision = 7, $scale = 2); $table->decimal('bakiupah', $precision = 7, $scale = 2)->nullable(); $table->decimal('cajlain', $precision = 7, $scale = 2)->nullable(); - $table->decimal('baki', $precision = 9, $scale = 2)->nullable(); - $table->decimal('berat', $precision = 7, $scale = 2)->nullable(); $table->string('marhun')->nullable(); - $table->decimal('gst_hj', $precision = 7, $scale = 2)->default(0.00); - $table->decimal('gst_cl', $precision = 7, $scale = 2)->default(0.00); - $table->decimal('percent', $precision = 7, $scale = 2)->nullable(); - $table->integer('mora_upah')->default(0); - $table->date('t_gadai')->nullable(); - $table->date('t_matang')->nullable(); - $table->integer('sttebus')->nullable(); - $table->integer('tagpalsu')->nullable(); - $table->integer('tagpalsu2')->nullable(); + $table->string('jenisupah')->nullable(); + $table->decimal('cajkhidmat', $precision = 7, $scale = 2)->nullable(); + $table->integer('stcajkhidmat')->nullable(); + $table->string('kodgl')->nullable(); $table->integer('taglel')->nullable(); + $table->integer('instno')->nullable(); + $table->integer('currInstno')->nullable(); + $table->decimal('ansakhir', $precision = 7, $scale = 2)->nullable(); + $table->decimal('ansupahakhir', $precision = 7, $scale = 2)->nullable(); + $table->decimal('jumupahaz', $precision = 7, $scale = 2)->nullable(); + $table->decimal('tunggakan', $precision = 7, $scale = 2)->nullable(); + $table->date('t_update'); + $table->string('jantina')->nullable(); + $table->string('bangsa')->nullable(); + $table->integer('sirit')->nullable(); + $table->integer('jenisansur')->nullable(); + $table->string('nokotak')->nullable(); + $table->integer('tiada')->nullable(); + $table->integer('tagtbaki')->nullable(); + $table->string('penilai')->nullable(); + $table->string('namapenilai')->nullable(); + $table->integer('tagserah')->nullable(); + $table->date('tempTarikhAging')->nullable(); + $table->string('jenistebus')->nullable(); + $table->string('namapelulus')->nullable(); + $table->decimal('percentpinj', $precision = 9, $scale = 2)->nullable(); + $table->integer('kuantiti')->nullable(); + $table->string('namateller')->nullable(); + $table->decimal('jumtebus', $precision = 11, $scale = 2)->nullable(); + $table->decimal('upahnotis', $precision = 9, $scale = 2)->nullable(); + $table->decimal('upahpercuma', $precision = 11, $scale = 2)->nullable(); + $table->integer('tagpalsu')->nullable(); + $table->decimal('upahdibayar', $precision = 10, $scale = 2)->nullable(); + $table->integer('tagcetak')->nullable(); + $table->integer('tag_sms')->nullable(); + $table->string('semakbarcode')->nullable(); + $table->integer('wangkeluarteller')->nullable(); + $table->integer('semakpetibesi')->nullable(); + $table->integer('semakaudit')->nullable(); + $table->string('historygadaian')->nullable(); + $table->integer('tagkiratebus')->nullable(); + $table->integer('checkbp')->nullable(); + $table->decimal('pampasan', $precision = 9, $scale = 2)->nullable(); + $table->integer('lel1stop')->nullable(); + $table->string('tellernew')->nullable(); + $table->string('idjompay')->nullable(); + $table->integer('tangguh')->nullable(); + $table->date('tebus')->nullable(); + $table->decimal('upahSim', $precision = 7, $scale = 2)->nullable(); + $table->decimal('jbgakru', $precision = 5, $scale = 2)->nullable(); + $table->decimal('upahakru', $precision = 7, $scale = 2)->nullable(); + $table->integer('tagpalsu2')->nullable(); + $table->integer('tagcall')->nullable(); + $table->decimal('upah_semasa', $precision = 11, $scale = 2)->nullable(); + $table->decimal('simulasi_hargaasas', $precision = 11, $scale = 2)->nullable(); + $table->decimal('simulasi_cajlelong', $precision = 11, $scale = 2)->nullable(); + $table->decimal('simulasi_bakilelong', $precision = 11, $scale = 2)->nullable(); + $table->decimal('sim_hargaasas', $precision = 9, $scale = 2)->nullable(); + $table->decimal('sim_cajlelong', $precision = 9, $scale = 2)->nullable(); + $table->decimal('sim_upahlelong', $precision = 9, $scale = 2)->nullable(); + $table->decimal('sim_bakilelong', $precision = 9, $scale = 2)->nullable(); + $table->decimal('percentrebet', $precision = 9, $scale = 2)->nullable(); + $table->decimal('rebet', $precision = 9, $scale = 2)->nullable(); + $table->decimal('upahlpsrebet', $precision = 9, $scale = 2)->nullable(); + $table->integer('taguploadslip')->nullable(); + $table->integer('tagsahupahonline')->nullable(); + $table->decimal('bayarupahonline', $precision = 9, $scale = 2)->nullable(); + $table->date('tbayaronline')->nullable(); + $table->decimal('upahsebenar', $precision = 9, $scale = 2)->nullable(); + $table->integer('tagupdatedbonline')->nullable(); + $table->decimal('bayarpinjamanonline', $precision = 9, $scale = 2)->nullable(); + $table->string('jenis_bayaran')->nullable(); + $table->decimal('upah12', $precision = 9, $scale = 2)->nullable(); + $table->decimal('hargajualan', $precision = 9, $scale = 2)->nullable(); + $table->decimal('bakihargajualan', $precision = 9, $scale = 2)->nullable(); + $table->integer('tagkomuditi')->nullable(); $table->integer('lelong_tawarruq')->nullable(); + $table->float('tempohbayar', $precision = 10, $scale = 2)->nullable(); $table->timestamps(); }); Schema::create('gadaimarhun', function (Blueprint $table) { $table->bigIncrements('id'); - $table->unsignedBigInteger('gadai_id')->unsigned(); - $table->decimal('bil', $precision = 3, $scale = 0); + $table->string('norujukan'); + $table->decimal('bil', $precision = 3, $scale = 2); $table->string('marhun'); $table->string('nota'); $table->string('karat'); $table->decimal('berat', $precision = 7, $scale = 2); $table->timestamps(); - $table->foreign('gadai_id') - ->references('id')->on('gadai') - ->onDelete('cascade'); + // $table->foreign('norujukan') + // ->references('norujukan')->on('gadai') + // ->onDelete('cascade'); }); } diff --git a/database/migrations/2021_12_14_041545_create_simulasis_table.php b/database/migrations/2021_12_14_041545_create_simulasis_table.php index 3ed5c114..dc3f202e 100644 --- a/database/migrations/2021_12_14_041545_create_simulasis_table.php +++ b/database/migrations/2021_12_14_041545_create_simulasis_table.php @@ -69,8 +69,6 @@ class CreateSimulasisTable extends Migration $table->decimal('baki', $precision = 9, $scale = 2); $table->decimal('berat', $precision = 7, $scale = 2); $table->string('marhun'); - $table->decimal('gst_hj', $precision = 7, $scale = 2); - $table->decimal('gst_cl', $precision = 7, $scale = 2); $table->decimal('percent', $precision = 7, $scale = 2); $table->integer('status_jual'); $table->integer('status_payment'); diff --git a/database/migrations/2021_12_14_041557_create_lelongs_table.php b/database/migrations/2021_12_14_041557_create_lelongs_table.php index 5e66c61c..3d3c3b3d 100644 --- a/database/migrations/2021_12_14_041557_create_lelongs_table.php +++ b/database/migrations/2021_12_14_041557_create_lelongs_table.php @@ -72,8 +72,6 @@ class CreateLelongsTable extends Migration $table->decimal('baki', $precision = 9, $scale = 2); $table->decimal('berat', $precision = 7, $scale = 2); $table->string('marhun'); - $table->decimal('gst_hj', $precision = 7, $scale = 2); - $table->decimal('gst_cl', $precision = 7, $scale = 2); $table->decimal('percent', $precision = 7, $scale = 2); $table->string('status_jual'); $table->string('status_payment'); diff --git a/database/migrations/2022_01_25_010223_create_payment_table.php b/database/migrations/2022_01_25_010223_create_payment_table.php index 5daf633c..c48d6756 100644 --- a/database/migrations/2022_01_25_010223_create_payment_table.php +++ b/database/migrations/2022_01_25_010223_create_payment_table.php @@ -67,7 +67,7 @@ class CreatePaymentTable extends Migration $table->unsignedBigInteger('lelong_id')->unsigned(); $table->string('reference_no')->nullable(); $table->string('billplz_id'); - $table->decimal('total_payment', $precision = 9, $scale = 2); + $table->decimal('total_payment', $precision = 11, $scale = 2); $table->string('resit_type'); // 1 = fee , 2 = bid $table->string('status')->nullable(); //status => 1 = paid , 2 = pending $table->timestamp('paid_at')->nullable(); diff --git a/resources/views/account/listbayaranonline.blade.php b/resources/views/account/listbayaranonline.blade.php new file mode 100644 index 00000000..9d27bcbf --- /dev/null +++ b/resources/views/account/listbayaranonline.blade.php @@ -0,0 +1,103 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + + + + + + + + + + + + + + + @foreach($listwinner as $winner) + + + + + + + + + + + @endforeach + +
NoNamaNo Kad PengenalanNo TelefonBilangan SuratJumlah Bidaan(RM)Jumlah Pembayaran(RM)Action
{{ $loop->iteration }} {{ $winner['details']['name']}}{{ $winner['details']['nokp']}}{{ $winner['details']['notelbimbit']}}{{ $winner['total_surat']}}{{ $winner['totalBid']}}{{ $winner['totalPay']}} + +
+
+
+
+ + + +@endsection + diff --git a/resources/views/account/sahsagonline.blade.php b/resources/views/account/sahsagonline.blade.php new file mode 100644 index 00000000..1d0113e2 --- /dev/null +++ b/resources/views/account/sahsagonline.blade.php @@ -0,0 +1,107 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + + + + + + + + + + + + + + @foreach($senaraisag as $sag) + + + + + + + + + + @endforeach + + + + + + + + +
NoNo RujukanTarikh LelongHarga Asas (RM)Harga Bida (RM)Masa BidaanStatus
{{ $loop->iteration }} {{ $sag['norujukan'] }}{{ $sag['t_lelong'] }}{{ $sag['hargaasas'] }}{{ $sag['hargabida'] }}{{ $sag['masa_bidaan'] }} + PAID +
Jumlah BayaranRM
+ +
+
+
+ + + +@endsection diff --git a/resources/views/account/senarailelongan.blade.php b/resources/views/account/senarailelongan.blade.php new file mode 100644 index 00000000..d2bc5771 --- /dev/null +++ b/resources/views/account/senarailelongan.blade.php @@ -0,0 +1,97 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + + + + + + + + + + + + @foreach($senarai as $data) + + + + + + + + @endforeach + +
NoKod CawanganTarikh LelongStatus LelongAction
{{$loop->iteration}}{{ $data->caw_code }}{{ $data->tarikh_lelong }}{{ $data->sts_lelong }} + +
+
+
+
+ + + +@endsection \ No newline at end of file diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php index 88fc44a0..49d82f97 100644 --- a/resources/views/includes/sidebar.blade.php +++ b/resources/views/includes/sidebar.blade.php @@ -42,8 +42,8 @@ @endhasrole @hasrole('khazanah') -
  • - Marhun +
  • + Marhun
  • @endhasrole @hasrole('teller') @@ -107,14 +107,25 @@ -
  • - Pengesahan Pembida Baharu +
  • + +
  • @endhasrole @hasrole('account') {{--
  • Home
  • --}} +
  • + List Bayaran Online +
  • @endhasrole @hasrole('pembida') {{--
  • diff --git a/resources/views/jananotis/notislelong.blade.php b/resources/views/jananotis/notislelong.blade.php index 77fddc7b..192be8f6 100644 --- a/resources/views/jananotis/notislelong.blade.php +++ b/resources/views/jananotis/notislelong.blade.php @@ -29,8 +29,8 @@ {{ $bid->lelong_id}} {{ $bid->tarikh_lelong }} - - + + @endforeach @@ -43,4 +43,10 @@ + @endsection diff --git a/resources/views/jananotis/senarainotis.blade.php b/resources/views/jananotis/senarainotis.blade.php index 7a3e2888..833f6a20 100644 --- a/resources/views/jananotis/senarainotis.blade.php +++ b/resources/views/jananotis/senarainotis.blade.php @@ -44,6 +44,9 @@ @endforeach + diff --git a/resources/views/lelong/lelongtaklaku.blade.php b/resources/views/lelong/lelongtaklaku.blade.php index 82d12758..d3780795 100644 --- a/resources/views/lelong/lelongtaklaku.blade.php +++ b/resources/views/lelong/lelongtaklaku.blade.php @@ -17,7 +17,7 @@ No Tarikh Lelong - Kod Cawangan + No Rujukan Nama Cawangan Bilangan Pinjaman (RM) @@ -38,7 +38,7 @@ {{ $loop->iteration }} {{ $leltaklaku->t_lelong }} - {{ $leltaklaku->kodcaw }} + {{ $leltaklaku->norujukan }} {{ $leltaklaku->caw_name }} {{ $leltaklaku['suratlelongtaklaku'] }} {{ $leltaklaku->pinjaman }} @@ -64,7 +64,7 @@ TIDAK LAKU @endif - + @@ -76,12 +76,20 @@ + + +@endsection \ No newline at end of file diff --git a/resources/views/marhun/senaraimarhun.blade.php b/resources/views/marhun/senaraimarhun.blade.php index cce798af..7e0bffd9 100644 --- a/resources/views/marhun/senaraimarhun.blade.php +++ b/resources/views/marhun/senaraimarhun.blade.php @@ -29,8 +29,7 @@ {{ $bid->norujukan }} {{ $bid->t_lelong }} - - {{-- --}} + @endforeach @@ -38,11 +37,19 @@ + +@endsection diff --git a/resources/views/pembida/senaraipembida.blade.php b/resources/views/pembida/senaraipembida.blade.php index a5bd2cc3..5ad480d3 100644 --- a/resources/views/pembida/senaraipembida.blade.php +++ b/resources/views/pembida/senaraipembida.blade.php @@ -36,16 +36,15 @@ {{ $user->notelbimbit }} {{ $user->email }} - @if ($user->status =='active') + + Menunggu Pengesahan Operasi - - {{-- --}} + @endforeach @@ -58,6 +57,11 @@ + +@endsection diff --git a/resources/views/pengurusandatabase/senaraidb.blade.php b/resources/views/pengurusandatabase/senaraidb.blade.php index 27496f94..78f8c5d3 100644 --- a/resources/views/pengurusandatabase/senaraidb.blade.php +++ b/resources/views/pengurusandatabase/senaraidb.blade.php @@ -38,9 +38,9 @@
    @csrf - + {{-- --}} - +
    @@ -153,6 +153,10 @@ @endsection diff --git a/resources/views/pengurusanpengguna/taraf.blade.php b/resources/views/pengurusanpengguna/taraf.blade.php index 821c0f4e..fd441d8e 100644 --- a/resources/views/pengurusanpengguna/taraf.blade.php +++ b/resources/views/pengurusanpengguna/taraf.blade.php @@ -33,8 +33,8 @@ @endforeach - - + + @endforeach @@ -47,6 +47,10 @@ + @endsection diff --git a/resources/views/serahan/pembayaran.blade.php b/resources/views/serahan/pembayaran.blade.php index e3666b03..594ec942 100644 --- a/resources/views/serahan/pembayaran.blade.php +++ b/resources/views/serahan/pembayaran.blade.php @@ -32,8 +32,8 @@ {{ $pay['totalBid']}} {{-- --}} - - + + @@ -42,10 +42,17 @@ @endforeach +