latest
This commit is contained in:
@@ -52,10 +52,10 @@ class LelongController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$simulasi_id = $id;
|
||||
$simulasi = Simulasi::where('id','=',$id)->first();
|
||||
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
|
||||
$simkarat = SimKarat::where('simulasi_id','=',$id)->get();
|
||||
$lelong_id = $id;
|
||||
$lelong = Lelong::where('id','=',$id)->first();
|
||||
$cawanganlel = CawanganLelong::where('lelong_id','=',$id)->get();
|
||||
$lelkarat = LelKarat::where('lelong_id','=',$id)->get();
|
||||
|
||||
$arraydata = [];
|
||||
$arraycaw = [];
|
||||
@@ -83,10 +83,10 @@ class LelongController extends Controller
|
||||
$total14K = 0;
|
||||
$total9K = 0;
|
||||
|
||||
foreach($cawangansim as $cawsim)
|
||||
foreach($cawanganlel as $cawlel)
|
||||
{
|
||||
$cawangan = Cawangan::where('id','=',$cawsim->caw_id)->first();
|
||||
$databid = SimulasiBid::where('caw_id','=',$cawsim->caw_id)->get();
|
||||
$cawangan = Cawangan::where('id','=',$cawlel->caw_id)->first();
|
||||
$databid = LelongBid::where('caw_id','=',$cawlel->caw_id)->get();
|
||||
|
||||
$packet = 0;
|
||||
$berat = 0;
|
||||
@@ -100,7 +100,7 @@ class LelongController extends Controller
|
||||
|
||||
foreach($databid as $bid)
|
||||
{
|
||||
$marhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)->get();
|
||||
$marhun = LelongBidMarhun::where('lelongbid_id','=',$bid->id)->get();
|
||||
$berat = $berat + $bid->berat;
|
||||
$nilai_marhun = $nilai_marhun + ($marhun->sum('n_marhun'));
|
||||
$pinjaman =$pinjaman + $bid->pinjaman;
|
||||
@@ -119,47 +119,47 @@ class LelongController extends Controller
|
||||
}
|
||||
|
||||
|
||||
$total24Kgb += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total24Kgb += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','24.0Kgb')
|
||||
->sum('berat');
|
||||
|
||||
$total24K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total24K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','24.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total23k += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total23k += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','23.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total22K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total22K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','22.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total21K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total21K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','21.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total20K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total20K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','20.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total18Kp += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total18Kp += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','18.0Kp')
|
||||
->sum('berat');
|
||||
|
||||
$total18K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total18K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','18.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total14Kp += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total14Kp += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','14.0Kp')
|
||||
->sum('berat');
|
||||
|
||||
$total14K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total14K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','14.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total9K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
$total9K += LelongBidMarhun::where('lelongbid_id','=',$bid->id)
|
||||
->where('karat','=','9.0K')
|
||||
->sum('berat');
|
||||
|
||||
@@ -168,7 +168,7 @@ class LelongController extends Controller
|
||||
}
|
||||
array_push($arraycaw,[
|
||||
'cawangan'=>$cawangan->caw_name,
|
||||
't_lelong'=>$simulasi->tarikh_lelong,
|
||||
't_lelong'=>$lelong->tarikh_lelong,
|
||||
'bil_marhun'=>sizeof($databid),
|
||||
'berat'=>$berat,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
@@ -193,7 +193,7 @@ class LelongController extends Controller
|
||||
|
||||
|
||||
|
||||
return view('simulasi.showsimulasi',compact(
|
||||
return view('lelong.showlelong',compact(
|
||||
'arraycaw',
|
||||
'total_marhun',
|
||||
'total_berat',
|
||||
@@ -215,8 +215,8 @@ class LelongController extends Controller
|
||||
'total14Kp',
|
||||
'total14K',
|
||||
'total9K',
|
||||
'simkarat',
|
||||
'simulasi_id'));
|
||||
'lelkarat',
|
||||
'lelong_id'));
|
||||
}
|
||||
|
||||
public function create($id)
|
||||
@@ -256,6 +256,7 @@ class LelongController extends Controller
|
||||
|
||||
foreach ($datasimbid as $simulasibid ) {
|
||||
$lelongbid = new LelongBid;
|
||||
$lelongbid->lelong_id = $lelong->id;
|
||||
$lelongbid->caw_id = $simulasibid->caw_id;
|
||||
$lelongbid->kodcaw =$simulasibid->kodcaw;
|
||||
$lelongbid->norujukan =$simulasibid->norujukan;
|
||||
@@ -332,6 +333,12 @@ class LelongController extends Controller
|
||||
return redirect()->route('lelong.senarailelong')
|
||||
->with('success','Kemaskini Berjaya');
|
||||
}
|
||||
|
||||
public function kemaskini(Request $request)
|
||||
{
|
||||
return redirect()->route('lelong.showlelong',$request->idlelong)
|
||||
->with('success','Kemaskini Berjaya');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user