Files
lelong/resources/views/simulasi/showsimulasi.blade.php
T
Amirah22 eefc3e803a export to pdf
simulasi keseluruhan
notis lelong
2022-01-26 14:46:24 +08:00

282 lines
14 KiB
PHP

@extends('layouts.app')
@section('content')
<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="{{route('analisa.export')}}" method="POST">
@csrf
<input type="hidden" name="type" value="User">
<input type="hidden" name="simulasiid" value="{{ $simulasi_id }}">
<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] }} --}}
</div>
<div class="modal fade" tabindex="-1" id="modalfilter">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter By</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('analisa.filter') }}" method="POST" id="formfilter">
@csrf
<div class="row justify-content-center">
<div class="col-md-8">
<div class="form-group row">
<input type="hidden" name="idmarhun" id="idmarhun" >
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="button" class="btn btn-primary" onclick="">Jana Semula Simulasi</button>
</div>
</div>
</div>
</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
}
],
order: [[1, 'asc']],
// "ordering": false,
"searching":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-filter"></i>',
titleAttr: 'Filter By',
action: function ( e, dt, node, config ) {
$('#modalfilter').modal("show");
}
},
{
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
titleAttr: 'Download to PDF',
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