This commit is contained in:
Azfar Arsyad
2021-12-20 17:03:15 +08:00
parent 1ba21078db
commit d95346c2dd
12 changed files with 979 additions and 210 deletions
+331
View File
@@ -0,0 +1,331 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
use Illuminate\Support\Facades\Auth;
use App\Models\User;
use PDF;
use App\Models\Cawangan;
use App\Models\JenisEmas;
use App\Models\JenisKarat;
use App\Models\Simulasi;
use App\Models\SimulasiBid;
use App\Models\SimulasiBidMarhun;
use App\Models\SimKarat;
use App\Models\SimKarat_temp;
use App\Models\CawanganSimulasi;
use App\Models\Lelong;
use App\Models\CawanganLelong;
use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
use App\Models\LelKarat_temp;
class LelongController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
$lelong = Lelong::all();
return view('lelong.senarailelong',compact('lelong'));
}
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();
$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();
$databid = SimulasiBid::where('caw_id','=',$cawsim->caw_id)->get();
$packet = 0;
$berat = 0;
$nilai_marhun = 0;
$pinjaman =0;
$upah = 0;
$hargaasas = 0;
$cajlelong = 0;
$rugilelong = 0;
$bakilelong = 0;
foreach($databid as $bid)
{
$marhun = SimulasiBidMarhun::where('simulasibid_id','=',$bid->id)->get();
$berat = $berat + $bid->berat;
$nilai_marhun = $nilai_marhun + ($marhun->sum('n_marhun'));
$pinjaman =$pinjaman + $bid->pinjaman;
$upah = $upah + $bid->upah;
$hargaasas = $hargaasas + $bid->hargaasas;
$cajlelong = $cajlelong + $bid->cajlelong;
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'=>sizeof($databid),
'berat'=>$berat,
'n_marhun'=>$nilai_marhun,
'pinjaman'=>$pinjaman,
'upah'=>0,
'hargaasas'=>$hargaasas,
'cajlelong'=>$cajlelong,
'rugilelong'=>$rugilelong,
'bakilelong'=>$bakilelong,
]);
$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 create($id)
{
$simulasi = Simulasi::where('id','=',$id)->first();
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
$simkarat = SimKarat::where('simulasi_id','=',$id)->get();
$lelong = new Lelong();
$lelong->tarikh_lelong = $simulasi->tarikh_lelong;
$lelong->harga_emas_asas = $simulasi->harga_emas_asas;
$lelong->jbg = $simulasi->jbg;
$lelong->cajlelong = $simulasi->cajlelong;
$lelong->save();
foreach($simkarat as $simulasikarat)
{
$lelkarat = new LelKarat;
$lelkarat->lelong_id = $lelong->id;
$lelkarat->karat = $simulasikarat->karat;
$lelkarat->keterangan = $simulasikarat->keterangan;
$lelkarat->harga = $simulasikarat->harga;
$lelkarat->harga2 = $simulasikarat->harga2;
$lelkarat->save();
}
foreach($cawangansim as $caw)
{
$caw_lelong = new CawanganLelong;
$caw_lelong->lelong_id = $lelong->id;
$caw_lelong->caw_id = $caw->caw_id;
$caw_lelong->online = $caw->online;
$caw_lelong->lokasi = $caw->lokasi;
$caw_lelong->save();
$datasimbid = SimulasiBid::where('caw_id','=',$caw->caw_id)->get();
foreach ($datasimbid as $simulasibid ) {
$lelongbid = new LelongBid;
$lelongbid->caw_id = $simulasibid->caw_id;
$lelongbid->kodcaw =$simulasibid->kodcaw;
$lelongbid->norujukan =$simulasibid->norujukan;
$lelongbid->t_lelong =$simulasibid->t_lelong;
$lelongbid->hargaasas =$simulasibid->hargaasas;
$lelongbid->hargajual =$simulasibid->hargajual;
$lelongbid->t_jual =$simulasibid->t_jual;
$lelongbid->nopembeli =$simulasibid->nopembeli;
$lelongbid->jbg =$simulasibid->jbg;
$lelongbid->kadarupah =$simulasibid->kadarupah;
$lelongbid->upahsimpan =$simulasibid->upahsimpan;
$lelongbid->ansuran =$simulasibid->ansuran;
$lelongbid->nilaimarhun =$simulasibid->nilaimarhun;
$lelongbid->pinjaman =$simulasibid->pinjaman;
$lelongbid->bakiupah =$simulasibid->bakiupah;
$lelongbid->cajlain =$simulasibid->cajlain;
$lelongbid->cajlelong =$simulasibid->cajlelong;
$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;
$lelongbid->mora_upah =$simulasibid->mora_upah;
$lelongbid->save();
$simulasibidmarhun = SimulasiBidMarhun::where('simulasibid_id','=',$simulasibid->id)->get();
foreach($simulasibidmarhun as $simbidmarhun)
{
$lelongbidmarhun = new LelongBidMarhun;
$lelongbidmarhun->lelongbid_id = $lelongbid->id;
$lelongbidmarhun->bil = $simbidmarhun->bil;
$lelongbidmarhun->marhun = $simbidmarhun->marhun;
$lelongbidmarhun->nota = $simbidmarhun->nota;
$lelongbidmarhun->karat = $simbidmarhun->karat;
$lelongbidmarhun->berat = $simbidmarhun->berat;
$lelongbidmarhun->harga = $simbidmarhun->harga;
$lelongbidmarhun->n_marhun = $simbidmarhun->n_marhun;
$lelongbidmarhun->hargaasas = $simbidmarhun->hargaasas;
$lelongbidmarhun->save();
}
}
}
return redirect()->route('analisa.senaraisimulasi')
->with('success','Create Lelong Berjaya');
}
public function delete($id)
{
$lelong = Lelong::where('id','=',$id)->first();
// dd($role);
$lelong->delete();
return redirect()->route('lelong.senarailelong')
->with('success','Padam Lelong Berjaya');
}
public function start($id)
{
$lelong = Lelong::where('id','=',$id)->first();
$lelong->masatamat_lelong = '2021-12-20 04:51:50';
$lelong->save();
return redirect()->route('lelong.senarailelong')
->with('success','Lelongan bermula');
}
}
+58
View File
@@ -0,0 +1,58 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
use Illuminate\Support\Facades\Auth;
use App\Models\User;
use PDF;
use App\Models\Cawangan;
use App\Models\JenisEmas;
use App\Models\JenisKarat;
use App\Models\Lelong;
use App\Models\CawanganLelong;
use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
use App\Models\LelKarat_temp;
class MarhunController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
$user = Auth::user();
$caw = Cawangan::where('caw_code','=',$user->kodcaw)->first();
$lelongbid = LelongBid::where('caw_id','=',$caw->id)->get();
return view('marhun.senaraimarhun',compact('lelongbid'));
}
public function show($id)
{
$lelongbid = LelongBid::where('id','=',$id)->first();
$marhun = LelongBidMarhun::where('lelongbid_id','=',$id)->get();
return view('marhun.marhun',compact('marhun','lelongbid'));
}
}
+3 -73
View File
@@ -183,7 +183,7 @@ class SimulasiController extends Controller
return redirect()->route('analisa.showsimulasi',$simulasi->id);
return redirect()->route('analisa.show',$simulasi->id);
}
public function senaraisimulasi()
@@ -193,7 +193,7 @@ class SimulasiController extends Controller
return view('simulasi.senaraisimulasi',compact('simulasi'));
}
public function showsimulasi($id)
public function show($id)
{
$simulasi_id = $id;
$simulasi = Simulasi::where('id','=',$id)->first();
@@ -362,77 +362,7 @@ class SimulasiController extends Controller
'simulasi_id'));
}
public function createlelong($id)
{
$simulasi = Simulasi::where('id','=',$id)->first();
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
$lelong = new Lelong();
$lelong->tarikh_lelong = $simulasi->tarikh_lelong;
$lelong->harga_emas_asas = $simulasi->hargaasas;
$lelong->jbg = $simulasi->jbg;
$lelong->cajlelong = $simulasi->cajlelong;
$lelong->save();
foreach($cawangansim as $caw)
{
$caw_lelong = new CawanganLelong;
$caw_lelong->lelong_id = $lelong->id;
$caw_lelong->caw_id = $caw->caw_id;
$caw_lelong->online = $caw->online;
$caw_lelong->lokasi = $caw->lokasi;
$caw_lelong->save();
$datasimbid = SimulasiBid::where('caw_id','=',$caw->caw_id)->get();
foreach ($datasimbid as $simulasibid ) {
$lelongbid = new LelongBid;
$lelongbid->caw_id = $simulasibid->caw_id;
$lelongbid->kodcaw =$simulasibid->kodcaw;
$lelongbid->norujukan =$simulasibid->norujukan;
$lelongbid->t_lelong =$simulasibid->t_lelong;
$lelongbid->hargaasas =$simulasibid->hargaasas;
$lelongbid->hargajual =$simulasibid->hargajual;
$lelongbid->t_jual =$simulasibid->t_jual;
$lelongbid->nopembeli =$simulasibid->nopembeli;
$lelongbid->jbg =$simulasibid->jbg;
$lelongbid->kadarupah =$simulasibid->kadarupah;
$lelongbid->upahsimpan =$simulasibid->upahsimpan;
$lelongbid->ansuran =$simulasibid->ansuran;
$lelongbid->nilaimarhun =$simulasibid->nilaimarhun;
$lelongbid->pinjaman =$simulasibid->pinjaman;
$lelongbid->bakiupah =$simulasibid->bakiupah;
$lelongbid->cajlain =$simulasibid->cajlain;
$lelongbid->cajlelong =$simulasibid->cajlelong;
$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;
$lelongbid->mora_upah =$simulasibid->mora_upah;
$lelongbid->save();
foreach()
{
}
}
}
$simulasi->id
use App\Models\Lelong;
use App\Models\LelongBid;
use App\Models\LelongBidMarhun;
use App\Models\LelKarat;
return redirect()->route('analisa.senaraisimulasi')
->with('success','Create Lelong Berjaya');
}
public function deletesim($id)
public function delete($id)
{
$role = Simulasi::where('id','=',$id)->first();
// dd($role);
+11 -5
View File
@@ -42,9 +42,9 @@
@endhasrole
@hasrole('khazanah')
{{-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
<a href="/home">Home</a>
</li> --}}
<li class="{{ (request()->is('marhun/senaraimarhun') || request()->is('marhun/senaraimarhun/*')) ? 'active' : '' }}">
<a href="{{url('marhun/senaraimarhun')}}">Marhun</a>
</li>
@endhasrole
@hasrole('teller')
{{-- <li class="{{ (request()->is('home')) ? 'active' : '' }}">
@@ -71,8 +71,14 @@
<li class="{{ (request()->is('analisa/senaraisimulasi/*') || request()->is('analisa/senaraisimulasi') ) ? 'active' : '' }}">
<a href="{{url('analisa/senaraisimulasi')}}">Senarai Simulasi</a>
</li>
</ul>
</li>
<li class="{{ (request()->is('lelong/*')) ? 'active' : '' }}">
<a href="#lelongSubmenu" data-toggle="collapse" aria-expanded="false" style="">Lelong</a>
<ul class="list-unstyled collapse {{ (request()->is('lelong/*')) ? 'show' : '' }}" id="lelongSubmenu" >
<li class="{{ (request()->is('lelong/senarailelong/*') || request()->is('lelong/senarailelong') ) ? 'active' : '' }}">
<a href="{{url('lelong/senarailelong')}}">Senarai Lelong</a>
</li>
</ul>
</li>
@endhasrole
@@ -0,0 +1,130 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="" method="POST">
<input type="hidden" name="type" value="User">
<table class="table table-striped table-xl" id="lelong" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
<th>Tarikh Lelong</th>
<th>Masa Tamat Lelong</th>
<th>Harga Emas Asas</th>
<th>JBG</th>
<th>Caj Lelong</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($lelong as $lel)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $lel->id }}"></td>
<td>{{ $lel->tarikh_lelong }}</td>
<td>{{ $lel->masatamat_lelong }}</td>
<td>{{ $lel->harga_emas_asas }}</td>
<td>{{ $lel->jbg }}</td>
<td>{{ $lel->cajlelong }}</td>
<td class="text-center">
<a href="{{ route('lelong.show',$lel->id) }}"><i class="far fa-edit"></i></a>
<a class="confirmdel" href="{{ route('lelong.delete',$lel->id) }}"><i class="far fa-trash-alt"></i></a>
@if(!$lel->masatamat_lelong)
<a class="startlelong" href="{{ route('lelong.start',$lel->id) }}"><i class="fa fa-play"></i></a>
@else
<a class="stoplelong" href="{{ route('lelong.start',$lel->id) }}"><i class="fa fa-stop"></i></a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
$('a.confirmdel').confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-warning',
action: function () {
location.href = this.$target.attr('href');
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
var tablesimulasi = $('#simulasi').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
order: [[1, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
{
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
text: '<i class="fas fa-plus" id="test"></i>',
titleAttr: 'Tambah Simulasi',
action: function ( e, dt, node, config ) {
alert( 'Button activated' );
}
},
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to CSV',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablesimulasi.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection
+130
View File
@@ -0,0 +1,130 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="" method="POST">
<input type="hidden" name="type" value="User">
<table class="table table-striped table-xl" id="marhun" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
<th>No. Rujukan</th>
<th>Marhun</th>
<th>Nota</th>
<th>Karat</th>
<th>Berat</th>
<th>Harga</th>
<th>Nilai Marhun</th>
<th>Harga Asas</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($marhun as $item)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $item->id }}"></td>
<td>{{ $lelongbid->norujukan }}</td>
<td>{{ $item->marhun }}</td>
<td>{{ $item->nota }}</td>
<td>{{ $item->karat }}</td>
<td>{{ $item->berat }}</td>
<td>{{ $item->harga }}</td>
<td>{{ $item->n_marhun }}</td>
<td>{{ $item->hargaasas }}</td>
<td class="text-center">
<a href="{{ route('marhun.show',$item->id) }}"><i class="far fa-edit"></i></a>
<a class="confirmdel" href="{{ route('marhun.delete',$item->id) }}"><i class="far fa-trash-alt"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
$('a.confirmdel').confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-warning',
action: function () {
location.href = this.$target.attr('href');
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
var tablemarhun = $('#marhun').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
order: [[1, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
{
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
text: '<i class="fas fa-plus" id="test"></i>',
titleAttr: 'Tambah Marhun',
action: function ( e, dt, node, config ) {
alert( 'Button activated' );
}
},
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to CSV',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablemarhun.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection
@@ -0,0 +1,118 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportform" action="" method="POST">
<input type="hidden" name="type" value="User">
<table class="table table-striped table-xl" id="senaraimarhun" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th>
<th>Nombor Rujukan</th>
<th>Tarikh Lelong</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach ($lelongbid as $bid)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td>
<td>{{ $bid->norujukan }}</td>
<td>{{ $bid->t_lelong }}</td>
<td class="text-center">
<a href="{{ route('marhun.show',$bid->id) }}"><i class="far fa-edit"></i></a>
{{-- <a class="confirmdel" href="{{ route('marhun.delete',$bid->id) }}"><i class="far fa-trash-alt"></i></a> --}}
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
$('a.confirmdel').confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'orange',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-warning',
action: function () {
location.href = this.$target.attr('href');
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
var tablemarhun = $('#senaraimarhun').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
order: [[1, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Marhun',
// action: function ( e, dt, node, config ) {
// alert( 'Button activated' );
// }
// },
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Export to CSV',
text: '<i class="fas fa-download"></i>',
action: function ( e, dt, node, config ) {
$("#exportform").submit();
}
}
]
});
$('.addsim').tooltip();
$('.export').tooltip();
// $( '.dt-buttons').addClass('btn-group');
$( '.addsim').removeClass('dt-button');
$( '.export').removeClass('dt-button');
function selectall(cb) {
tablemarhun.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
$(this).prop('checked', cb.checked);
})
}
</script>
@endsection
@@ -36,14 +36,14 @@
<td>{{ $user->email }}</td>
<td>
@foreach ($user->roles as $taraf)
<button class="btn btn-primary btn-sm hovernone" >{{$taraf->name}}</button>
<button class="btn btn-primary btn-sm hovernone" disabled>{{$taraf->name}}</button>
@endforeach
</td>
<td>
@if ($user->status =='active')
<button class="btn btn-success btn-sm hovernone-success" >{{$user->status}}</button>
<button class="btn btn-success btn-sm hovernone-success" disabled>{{$user->status}}</button>
@elseif ($user->status =='banned')
<button class="btn btn-danger btn-sm hovernone-danger" >{{$user->status}}</button>
<button class="btn btn-danger btn-sm hovernone-danger" disabled>{{$user->status}}</button>
@endif
</td>
@@ -29,7 +29,7 @@
{{-- <td>{{ $role->email }}</td> --}}
<td>
@foreach ($role->permissions->pluck('name') as $taraf)
<button class="btn btn-primary btn-sm hovernone" >{{$taraf}}</button>
<button class="btn btn-primary btn-sm hovernone" disabled>{{$taraf}}</button>
@endforeach
</td>
<td class="text-center">
@@ -33,9 +33,9 @@
<td>{{ $sim->jbg }}</td>
<td>{{ $sim->cajlelong }}</td>
<td class="text-center">
<a href="{{ route('analisa.showsimulasi',$sim->id) }}"><i class="far fa-edit"></i></a>
<a href="{{ route('analisa.show',$sim->id) }}"><i class="far fa-edit"></i></a>
{{-- <a href="{{ route('sistem.showConn',$data->id) }}"><i class="far fa-eye"></i></a> --}}
<a class="confirmdel" href="{{ route('analisa.deletesimulasi',$sim->id) }}"><i class="far fa-trash-alt"></i></a>
<a class="confirmdel" href="{{ route('analisa.delete',$sim->id) }}"><i class="far fa-trash-alt"></i></a>
</td>
+166 -123
View File
@@ -4,135 +4,178 @@
<div class="container-fluid">
<div class="row ">
<div class="col-md-11 mx-auto card p-4">
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a class="nav-link active" id="nav-simulasi-tab" data-toggle="tab" href="#nav-simulasi" role="tab" aria-controls="nav-simulasi" aria-selected="true">Simulasi</a>
<a class="nav-link" id="nav-hargaasas-tab" data-toggle="tab" href="#nav-hargaasas" role="tab" aria-controls="nav-hargaasas" aria-selected="false">Harga Emas Asas</a>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-simulasi" role="tabpanel" aria-labelledby="nav-simulasi-tab">
<br>
<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 class="text-center">
<th>No</th>
<th>Cawangan</th>
<th>Tarikh Lelong</th>
<th>Bil Marhun (Paket)</th>
<th>Berat (gm)</th>
<th>Nilai Marhun (RM)</th>
<th>Pinjaman (RM)</th>
<th>Upah (RM)</th>
<th>Harga Asas (RM)</th>
<th>Caj Lelong (RM)</th>
<th>Baki Lelong (RM)</th>
<th>Rugi Lelong (RM)</th>
</tr>
</thead>
<tbody>
@foreach ($arraycaw as $index=>$caw)
<tr>
<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>
<div class="row">
<div class="text-center">
<a class="btn btn-primary" href="{{ route('lelong.create',$simulasi_id) }}">Create Lelong</a>
</div>
</div>
</div>
<div class="tab-pane fade" id="nav-hargaasas" role="tabpanel" aria-labelledby="nav-hargaasas-tab">
<br>
<div class="d-flex justify-content-center">
<table class="table table-striped table-xl" id="jumlahberat" style="width:80%" >
<thead class="bg-primary text-white">
<tr class="text-center">
<th>Karat</th>
<th>Keterangan</th>
<th>Harga</th>
<th>Harga</th>
</tr>
</thead>
<tbody class="text-center">
@foreach ($simkarat as $index=>$karat)
<tr>
<td>{{$karat->karat}}</td>
<td>{{$karat->keterangan}}</td>
<td>{{$karat->harga2}}</td>
<td>{{$karat->harga}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
{{-- {{$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 class="text-center">
<th>No</th>
<th>Cawangan</th>
<th>Tarikh Lelong</th>
<th>Bil Marhun (Paket)</th>
<th>Berat (gm)</th>
<th>Nilai Marhun (RM)</th>
<th>Pinjaman (RM)</th>
<th>Upah (RM)</th>
<th>Harga Asas (RM)</th>
<th>Caj Lelong (RM)</th>
<th>Baki Lelong (RM)</th>
<th>Rugi Lelong (RM)</th>
</tr>
</thead>
<tbody>
@foreach ($arraycaw as $index=>$caw)
<tr>
<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>
+26 -3
View File
@@ -50,9 +50,8 @@ Route::group(['middleware' => ['permission:analisa'],'prefix'=>'analisa'], funct
Route::get('/janasimulasi',['as'=>'analisa.janasimulasi','uses'=>'SimulasiController@index']);
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('/createlelong/{id}',['as'=>'analisa.createlelong','uses'=>'SimulasiController@createlelong']);
Route::get('/showsimulasi/{id}',['as'=>'analisa.show','uses'=>'SimulasiController@show']);
Route::get('/deletesimulasi/{id}',['as'=>'analisa.delete','uses'=>'SimulasiController@delete']);
});
Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], function () {
@@ -63,4 +62,28 @@ Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], functio
Route::get('/deleteConn/{id}',['as'=>'sistem.deleteConn','uses'=>'DatabaseController@deleteConn']);
Route::post('/export',['as'=>'sistem.export','uses'=>'DatabaseController@export']);
});
Route::group(['middleware' => ['permission:pendaftaranbatch','permission:lelongan'],'prefix'=>'lelong'], function () {
Route::get('/create/{id}',['as'=>'lelong.create','uses'=>'LelongController@create']);
Route::get('/senarailelong',['as'=>'lelong.senarailelong','uses'=>'LelongController@index']);
Route::get('/showlelong/{id}',['as'=>'lelong.show','uses'=>'LelongController@show']);
Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']);
Route::get('/lelongstart/{id}',['as'=>'lelong.start','uses'=>'LelongController@start']);
});
Route::group(['middleware' => ['permission:pendaftaranbatch','permission:lelongan'],'prefix'=>'lelong'], function () {
Route::get('/create/{id}',['as'=>'lelong.create','uses'=>'LelongController@create']);
Route::get('/senarailelong',['as'=>'lelong.senarailelong','uses'=>'LelongController@index']);
Route::get('/showlelong/{id}',['as'=>'lelong.show','uses'=>'LelongController@show']);
Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']);
Route::get('/lelongstart/{id}',['as'=>'lelong.start','uses'=>'LelongController@start']);
});
Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinimarhun'],'prefix'=>'marhun'], function () {
Route::get('/senaraimarhun',['as'=>'marhun.senaraimarhun','uses'=>'MarhunController@index']);
Route::get('/marhun/{id}',['as'=>'marhun.show','uses'=>'MarhunController@show']);
Route::get('/deletemarhun/{id}',['as'=>'marhun.delete','uses'=>'MarhunController@delete']);
});