update
This commit is contained in:
@@ -195,7 +195,7 @@ class PenggunaController extends Controller
|
||||
$model_name = '\\App\\Models\\'.$request->type;
|
||||
}
|
||||
|
||||
dd($request->checkboxdata);
|
||||
// dd($request->checkboxdata);
|
||||
if($request->checkboxdata)
|
||||
{
|
||||
if($request->type == 'User')
|
||||
|
||||
@@ -189,11 +189,37 @@ class SimulasiController extends Controller
|
||||
|
||||
public function showsimulasi($id)
|
||||
{
|
||||
$simulasi_id = $id;
|
||||
$simulasi = Simulasi::where('id','=',$id)->first();
|
||||
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
|
||||
$simkarat = SimKarat::where('simulasi_id','=',$id)->get();
|
||||
|
||||
$arraydata = [];
|
||||
$arraycaw = [];
|
||||
$data = [];
|
||||
|
||||
$total_marhun = 0;
|
||||
$total_berat = 0;
|
||||
$total_nmarhun = 0;
|
||||
$total_pinjaman = 0;
|
||||
$total_upah = 0;
|
||||
$total_hargaasas = 0;
|
||||
$total_cazlelong = 0;
|
||||
$total_rugilelong = 0;
|
||||
$total_bakilelong = 0;
|
||||
|
||||
$total24Kgb = 0;
|
||||
$total24K = 0;
|
||||
$total23k = 0;
|
||||
$total22K = 0;
|
||||
$total21K = 0;
|
||||
$total20K = 0;
|
||||
$total18Kp = 0;
|
||||
$total18K = 0;
|
||||
$total14Kp = 0;
|
||||
$total14K = 0;
|
||||
$total9K = 0;
|
||||
|
||||
foreach($cawangansim as $cawsim)
|
||||
{
|
||||
$cawangan = Cawangan::where('id','=',$cawsim->caw_id)->first();
|
||||
@@ -212,39 +238,132 @@ class SimulasiController extends Controller
|
||||
foreach($databid as $bid)
|
||||
{
|
||||
$marhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)->get();
|
||||
$packet = $packet + count($marhun);
|
||||
$berat = $berat + $bid->berat;
|
||||
$nilai_marhun = $nilai_marhun + ($marhun->sum('n_marhun'));
|
||||
$pinjaman =$pinjaman + $bid->pinjaman;
|
||||
// $upah = $upah + $bid->upah;
|
||||
$upah = $upah + $bid->upah;
|
||||
$hargaasas = $hargaasas + $bid->hargaasas;
|
||||
$cajlelong = $cajlelong + $bid->cajlelong;
|
||||
// $rugilelong = $berat + $bid->berat;
|
||||
$bakilelong = $bakilelong + $bid->baki;
|
||||
}
|
||||
|
||||
|
||||
if($bid->baki > 0)
|
||||
{
|
||||
$bakilelong = $bakilelong + $bid->baki;
|
||||
}
|
||||
else
|
||||
{
|
||||
$rugilelong = $rugilelong - $bid->baki;
|
||||
}
|
||||
|
||||
|
||||
$total24Kgb += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','24.0Kgb')
|
||||
->sum('berat');
|
||||
|
||||
|
||||
$total24K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','24.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total23k += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','23.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total22K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','22.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total21K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','21.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total20K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','20.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total18Kp += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','18.0Kp')
|
||||
->sum('berat');
|
||||
|
||||
$total18K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','18.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total14Kp += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','14.0Kp')
|
||||
->sum('berat');
|
||||
|
||||
$total14K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','14.0K')
|
||||
->sum('berat');
|
||||
|
||||
$total9K += SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)
|
||||
->where('karat','=','9.0K')
|
||||
->sum('berat');
|
||||
|
||||
|
||||
|
||||
}
|
||||
array_push($arraycaw,[
|
||||
'cawangan'=>$cawangan->caw_name,
|
||||
't_lelong'=>$simulasi->tarikh_lelong,
|
||||
'bil_marhun'=>$packet,
|
||||
'bil_marhun'=>sizeof($databid),
|
||||
'berat'=>$berat,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'pinjaman'=>$pinjaman,
|
||||
'upah'=>0,
|
||||
'hargaasas'=>$hargaasas,
|
||||
'cajlelong'=>$cajlelong,
|
||||
'rugilelong'=>0,
|
||||
'rugilelong'=>$rugilelong,
|
||||
'bakilelong'=>$bakilelong,
|
||||
]);
|
||||
// dd($arraycaw);
|
||||
// array_push($arraydata, $arraycaw);
|
||||
}
|
||||
|
||||
// dd($arraycaw);
|
||||
// ->where('id','=',$id)-
|
||||
|
||||
return view('simulasi.showsimulasi',compact('arraycaw'));
|
||||
$total_marhun = $total_marhun + sizeof($databid);
|
||||
$total_berat = $total_berat + $berat;
|
||||
$total_nmarhun = $total_nmarhun + $nilai_marhun;
|
||||
$total_pinjaman = $total_pinjaman + $pinjaman;
|
||||
$total_upah = $total_upah + 0;
|
||||
$total_hargaasas = $total_hargaasas + $hargaasas;
|
||||
$total_cazlelong = $total_cazlelong + $cajlelong;
|
||||
$total_rugilelong = $total_rugilelong + $rugilelong;
|
||||
$total_bakilelong = $total_bakilelong + $bakilelong;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return view('simulasi.showsimulasi',compact(
|
||||
'arraycaw',
|
||||
'total_marhun',
|
||||
'total_berat',
|
||||
'total_nmarhun',
|
||||
'total_pinjaman',
|
||||
'total_upah',
|
||||
'total_hargaasas',
|
||||
'total_cazlelong',
|
||||
'total_rugilelong',
|
||||
'total_bakilelong',
|
||||
'total24Kgb',
|
||||
'total24K',
|
||||
'total23k',
|
||||
'total22K',
|
||||
'total21K',
|
||||
'total20K',
|
||||
'total18Kp',
|
||||
'total18K',
|
||||
'total14Kp',
|
||||
'total14K',
|
||||
'total9K',
|
||||
'simkarat',
|
||||
'simulasi_id'));
|
||||
}
|
||||
|
||||
public function createlelong($id)
|
||||
{
|
||||
$simulasi = Simulasi::where('id','=',$id)->first();
|
||||
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
|
||||
|
||||
return redirect()->route('analisa.senaraisimulasi')
|
||||
->with('success','Create Lelong Berjaya');
|
||||
|
||||
}
|
||||
|
||||
public function deletesim($id)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$totaluser = count($alluser);
|
||||
?>
|
||||
<form id="exportform" action="{{route('pengguna.export')}}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="type" value="User">
|
||||
<table class="table table-striped table-xl" id="pengguna" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="{{route('pengguna.export')}}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="type" value="Permission">
|
||||
<table class="table table-striped" id="roles">
|
||||
<thead class="bg-primary text-white">
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="{{route('pengguna.export')}}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="type" value="Role">
|
||||
<table class="table table-striped" id="taraf">
|
||||
<thead class="bg-primary text-white">
|
||||
|
||||
@@ -10,12 +10,47 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
{{$arraycaw[0]->cawangan }}
|
||||
{{-- {{$cawangan[0] }} --}}
|
||||
<form id="exportform" action="" method="POST">
|
||||
<input type="hidden" name="type" value="User">
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<table class="table table-striped table-xl" id="conclusion" style="width:100%">
|
||||
<tr>
|
||||
<td>Bilangan Lelong : {{$total_marhun}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nilai Marhun Keseluruhan : RM{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pinjaman Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Upah Keseluruhan : RM{{ number_format($total_upah, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-5">
|
||||
<table class="table table-striped table-xl" id="conclusion2" style="width:100%">
|
||||
<tr>
|
||||
<td>Rugi Lelong Keseluruhan : -RM{{ number_format($total_rugilelong, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Baki Lelong Keseluruhan : RM{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Caj Lelong Keseluruhan : RM{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table table-striped table-xl" id="simulasi" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<tr class="text-center">
|
||||
<th>No</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Bil Marhun (Paket)</th>
|
||||
@@ -25,31 +60,79 @@
|
||||
<th>Upah (RM)</th>
|
||||
<th>Harga Asas (RM)</th>
|
||||
<th>Caj Lelong (RM)</th>
|
||||
<th>Rugi Lelong (RM)</th>
|
||||
<th>Baki Lelong (RM)</th>
|
||||
<th>Rugi Lelong (RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($arraycaw as $caw)
|
||||
@foreach ($arraycaw as $index=>$caw)
|
||||
<tr>
|
||||
<td>{{ $caw->cawangan }}</td>
|
||||
<td>{{ $caw->t_lelong }}</td>
|
||||
<td>{{ $caw->bil_marhun }}</td>
|
||||
<td>{{ $caw->berat }}</td>
|
||||
<td>{{ $caw->n_marhun }}</td>
|
||||
<td>{{ $caw->pinjaman }}</td>
|
||||
<td>{{ $caw->upah }}</td>
|
||||
<td>{{ $caw->hargaasas }}</td>
|
||||
<td>{{ $caw->cajlelong }}</td>
|
||||
<td>{{ $caw->rugilelong }}</td>
|
||||
<td>{{ $caw->bakilelong }}</td>
|
||||
<td>{{$index+1}}</td>
|
||||
<td>{{ $caw['cawangan'] }}</td>
|
||||
<td>{{ $caw['t_lelong'] }}</td>
|
||||
<td>{{ $caw['bil_marhun'] }}</td>
|
||||
<td>{{ number_format($caw['berat'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['n_marhun'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['pinjaman'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['upah'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['hargaasas'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['cajlelong'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['bakilelong'], 2, '.', ',') }}</td>
|
||||
<td>({{ number_format($caw['rugilelong'], 2, '.', ',') }})</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3"><b>JUMLAH KESELURUHAN</b></td>
|
||||
<td>{{ $total_marhun }}</td>
|
||||
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_upah, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
|
||||
<td>({{ number_format($total_rugilelong, 2, '.', ',') }})</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
</table>
|
||||
|
||||
<table class="table table-striped table-xl" id="jumlahberat" style="width:80%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr class="text-center">
|
||||
<th colspan="12">JUMLAH BERAT MENGIKUT MUTU (KESELURUHAN)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>MUTU</td>
|
||||
@foreach ($simkarat as $index=>$karat)
|
||||
<td>{{$karat->karat}}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BERAT (gm)</td>
|
||||
<td>{{$total24Kgb}}</td>
|
||||
<td>{{$total24K}}</td>
|
||||
<td>{{$total23k}}</td>
|
||||
<td>{{$total22K}}</td>
|
||||
<td>{{$total21K}}</td>
|
||||
<td>{{$total20K}}</td>
|
||||
<td>{{$total18Kp}}</td>
|
||||
<td>{{$total18K}}</td>
|
||||
<td>{{$total14Kp}}</td>
|
||||
<td>{{$total14K}}</td>
|
||||
<td>{{$total9K}}</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<a href="{{ route('analisa.createlelong',$simulasi_id) }}">Create Lelong</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -79,10 +162,6 @@
|
||||
{
|
||||
"targets": 0,
|
||||
"orderable": false
|
||||
},
|
||||
{
|
||||
"targets": 5,
|
||||
"orderable": false
|
||||
}
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
|
||||
+2
-1
@@ -51,7 +51,8 @@ Route::group(['middleware' => ['permission:analisa'],'prefix'=>'analisa'], funct
|
||||
Route::post('/janadata',['as'=>'analisa.janadata','uses'=>'SimulasiController@janadata']);
|
||||
Route::get('/senaraisimulasi',['as'=>'analisa.senaraisimulasi','uses'=>'SimulasiController@senaraisimulasi']);
|
||||
Route::get('/showsimulasi/{id}',['as'=>'analisa.showsimulasi','uses'=>'SimulasiController@showsimulasi']);
|
||||
Route::get('/deletesimulasi/{id}',['as'=>'analisa.deletesimulasi','uses'=>'SimulasiController@deletesim']);
|
||||
Route::get('/deletesimulasi/{id}',['as'=>'analisa.deletesimulasi','uses'=>'SimulasiController@deletesim']);
|
||||
Route::get('/createlelong/{id}',['as'=>'analisa.createlelong','uses'=>'SimulasiController@createlelong']);
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], function () {
|
||||
|
||||
Reference in New Issue
Block a user