update lelong simulasi payment new db mysql2

This commit is contained in:
Nur Izzati Zulkifli
2022-07-07 12:01:07 +08:00
parent 98e70a2c97
commit e947e14575
14 changed files with 487 additions and 137 deletions
@@ -48,6 +48,7 @@
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>Nama Pelanggan</th>
<th>Tempoh</th>
<th>Berat (gm)</th>
<th>N. Marhun (RM)</th>
@@ -67,6 +68,7 @@
<tr>
<td>{{$loop->iteration}}</td>
<td>{{ $marhun['norujukan']}}</td>
<td>{{ $marhun['nama']['nama']}}</td>
<td>{{ $marhun['jbg']}}</td>
<td>{{ $marhun['berat'] }}</td>
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
+2 -2
View File
@@ -34,7 +34,7 @@
<td>Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
</tr>
<tr>
<td>Keuntungan Keseluruhan : RM{{ number_format($totalkeuntungan2, 2, '.', ',') }}</td>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_bakiupah, 2, '.', ',') }}</td>
</tr>
<tr>
@foreach($data as $data1)
@@ -113,7 +113,7 @@
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
<td>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</td>
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
<td>{{ number_format($totalkeuntungan2, 2, '.', ',') }}</td>
<td>{{ number_format($total_bakiupah, 2, '.', ',') }}</td>
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
<td>{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
@@ -34,7 +34,7 @@
<td>Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
</tr>
<tr>
<td>Keuntungan Keseluruhan : RM{{ number_format($totalkeuntungan2, 2, '.', ',') }}</td>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_bakiupah, 2, '.', ',') }}</td>
</tr>
<tr>
@foreach($data as $data1)
@@ -113,7 +113,7 @@
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
<td>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</td>
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
<td>{{ number_format($totalkeuntungan2, 2, '.', ',') }}</td>
<td>{{ number_format($total_bakiupah, 2, '.', ',') }}</td>
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
<td>{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
@@ -55,7 +55,7 @@
@endif
</td>
<td>
<a href="{{ route('pembida.detailsbidaan', [ 'user_id'=>$winner['details']['id'], 'payment_id'=>$winner['payment_id'][0]['payment_id'], $kodcaw ]) }}" data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-list-alt"></i></a>
<a href="{{ route('pembida.detailsbidaan', [ 'user_id'=>$winner['details']['id'], $kodcaw ]) }}" data-toggle="tooltip" data-placement="top" title="Butiran Bidaan"><i class="far fa-list-alt"></i></a>
</td>
</tr>
@endforeach
@@ -0,0 +1,224 @@
@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
<div class="text-left pt-4">
<a href="{{ route('analisa.listsagbycust',[$simulasi_id,'cawid'=>$cawid]) }}" class="btn btn-success">Senarai Nama Pelangan</a>
</div>
<form id="deletesag" action="{{route('analisa.deletemarhunlel')}}" method="POST">
@csrf
<input type="hidden" name="simulasi_id" value="{{$simulasi_id}}">
<input type="hidden" name="cawid" value="{{$cawid}}">
<table class="table table-striped table-xl" id="marhun" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>Nama Pelanggan</th>
<th>No.Rujukan</th>
<th>Tempoh</th>
<th>Berat (gm)</th>
<th>Nilai Marhun (RM)</th>
<th>Harga Asas (RM)</th>
<th>Pembiayaan (RM)</th>
<th>Keuntungan (RM)</th>
<th>Caj Lelong (%)</th>
<th>Baki Lelong (RM)</th>
<!-- <th>Tindakan</th> -->
</tr>
</thead>
<tbody>
@foreach ($marhuns as $index=> $marhun)
<tr>
<td>{{$loop->iteration}}</td>
<td style='word-wrap'>{{ $marhun['nama']['nama']}}</td>
<td style='word-wrap'>@foreach ($marhun['listsag'] as $item)
{{$loop->iteration}}. {{ $item['norujukan'] }}<br>
@endforeach</td>
<td>@foreach ($marhun['listsag'] as $item)
{{ $item['tempoh'] }}<br>
@endforeach</td>
<td align = 'right'>
@php $jumberat = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumberat = $jumberat + $item['berat'];
@endphp
{{ number_format($item['berat'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumberat, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumnilaimarhun = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumnilaimarhun = $jumnilaimarhun + $item['nilaimarhun'];
@endphp
{{ number_format($item['nilaimarhun'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumnilaimarhun, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumhargaasas = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumhargaasas = $jumhargaasas + $item['hargaasas'];
@endphp
{{ number_format($item['hargaasas'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumhargaasas, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumpinjaman = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumpinjaman = $jumpinjaman + $item['pinjaman'];
@endphp
{{ number_format($item['pinjaman'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumpinjaman, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumbakiupah = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumbakiupah = $jumbakiupah + $item['bakiupah'];
@endphp
{{ number_format($item['bakiupah'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumbakiupah, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumcajlelong = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumcajlelong = $jumcajlelong + $item['cajlelong'];
@endphp
{{ number_format($item['cajlelong'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumcajlelong, 2, '.', ',') }}</strong>
</td>
<td align = 'right'>
@php $jumbaki = 0;@endphp
@foreach ($marhun['listsag'] as $item)
@php
$jumbaki = $jumbaki + $item['baki'];
@endphp
{{ number_format($item['baki'], 2, '.', ',') }}<br>
@endforeach
<strong>Total: {{ number_format($jumbaki, 2, '.', ',') }}</strong>
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
$("#btndelete").prop("disabled", true);
function btnDelete(e) {
var count = 0;
tablemarhun.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
if($(this).prop('checked') === true)
{
count = count + 1;
}
// $(this).prop('checked', e.checked);
})
if(count != 0)
{
$("#btndelete").prop("disabled", false);
}
else
{
$("#btndelete").prop("disabled", true);
}
// let checkbox = $('#checkboxdata').val();
// console.log(checkbox)
// $("#btndelete").prop("disabled", checkboxdata.length === 0);
}
function confirm() {
$.confirm({
title: 'Confirmation',
content: 'Anda pasti?',
type: 'red',
typeAnimated: true,
buttons: {
Delete: {
btnClass: 'btn-danger',
action: function () {
$("#deletesag").submit();
}
},
Batal: {
btnClass: 'btn-default',
action: function () {}
}
}
});
}
var tablemarhun = $('#marhun').DataTable( {
"columnDefs": [
{
"targets": 13,
"orderable": false
},
// {
// "targets": 4,
// "orderable": false
// }
],
// order: [[1, 'asc']],
// "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 10000000,
dom: 'Bfrtip',
// buttons: [
// // 'copy', 'excel', 'pdf'
// // { text: 'copy', className: 'btn btn-primary' },
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm adduser',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Pengguna',
// 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();
// }
// }
// ]
});
</script>
@endsection
@@ -12,6 +12,9 @@
<p>{{ $message }}</p>
</div>
@endif
<div class="text-left pt-4">
<a href="{{ route('analisa.listsagbycust',[$simulasi_id,$cawid]) }}" class="btn btn-success">Senarai Nama Pelangan</a>
</div>
<form id="deletesag" action="{{route('analisa.deletemarhunlel')}}" method="POST">
@csrf
<input type="hidden" name="simulasi_id" value="{{$simulasi_id}}">
@@ -20,7 +23,8 @@
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th>No Rujukan</th>
<th>No Rujukan</th>
<th>Nama Pelanggan</th>
<th>Tempoh</th>
<th>Berat (gm)</th>
<th>Nilai Marhun (RM)</th>
@@ -38,6 +42,7 @@
<tr>
<td>{{$loop->iteration}}</td>
<td>{{ $marhun['norujukan']}}</td>
<td>{{ $marhun['nama']['nama']}}</td>
<td>{{ number_format($marhun['tempoh'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['berat'], 2, '.', ',') }}</td>
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
@@ -32,7 +32,7 @@
<td>Pembiayaan Keseluruhan : RM{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
</tr>
<tr>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_upahkeuntungan2, 2, '.', ',') }}</td>
<td>Keuntungan Keseluruhan : RM{{ number_format($total_bakiupah, 2, '.', ',') }}</td>
</tr>
<tr>
@foreach($data as $data1)
@@ -112,7 +112,7 @@
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
<td>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</td>
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
<td>{{ number_format($total_upahkeuntungan2, 2, '.', ',') }}</td>
<td>{{ number_format($total_bakiupah, 2, '.', ',') }}</td>
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
<td>{{ number_format($total_bakilelong, 2, '.', ',') }}</td>