fix skit2

This commit is contained in:
hafifierahman
2021-10-06 10:11:21 +08:00
parent 2cf211215c
commit 3e52dfff32
8 changed files with 294 additions and 141 deletions
+1 -3
View File
@@ -10,8 +10,6 @@
<img class="login-logo login-6" src="{{ asset('argon') }}/login/logo_arrahn_baru.png">
<div class="container mt-5">
{{-- <p>Portal rasmi ar-rahn pajak gadai.</p> --}}
<form action="#" method="post" enctype="multipart/form-data" class="login-form" novalidate="novalidate">
@csrf
<div class="row ml-5">
@@ -72,7 +70,7 @@
<br>
</div>
<div class="col-md-6 col-xl-6" >
<div class="col-md-6 col-xl-6">
@include('auth.slides.slidespage')
@@ -12,21 +12,9 @@
</div>
</div>
{{-- <div class="mySlides ">
<div class="numbertext">2 / 3</div>
<img class="login-bg" src="{{ asset('argon') }}/login/backg2.jpg">
<div class="headtext">Caption Two</div>
<div class="text" style="text-align:center">
<span class="dot" onclick="currentSlide(1)"></span>
<span class="dot" onclick="currentSlide(2)"></span>
<span class="dot" onclick="currentSlide(3)"></span>
</div>
</div> --}}
<div class="mySlides ">
<div class="numbertext">2 / 2</div>
<img class="login-bg" src="{{ asset('argon') }}/login/backg4.jpg">
{{-- <div class="headtext">Caption Three</div> --}}
<div class="text" style="text-align:center">
<span class="dot" onclick="currentSlide(1)"></span>
<span class="dot" onclick="currentSlide(2)"></span>
+143 -62
View File
@@ -47,70 +47,128 @@
</div>
</div>
</div>
<div class="nav-wrapper">
<ul class="nav nav-pills ml-2" id="tabs-icons-text" role="tablist">
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">Ar-Rahn</a>
</li>
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false">Tawarruq</a>
</li>
</ul>
</div>
<div class="table-responsive table-striped">
<table class="table align-items-center table-flush" id="belum_tawarruq">
<thead class="thead-light">
<tr>
<th scope="col" class="sort">No</th>
<th scope="col" class="sort">No Rujukan</th>
<th scope="col" class="sort">Pembiayaan</th>
<th scope="col" class="sort">B. Pembiayaan</th>
<th scope="col" class="sort">Keuntungan</th>
<th style="text-align:center;" scope="col" class="sort">Jumlah Telah Dibayar</th>
<th width="20%" scope="col" class="sort">Bayaran</th>
</tr>
</thead>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
<div class="table-responsive table-striped text-center">
<table class="table align-items-center table-flush" id="belum_tawarruq">
<thead class="thead-light">
<tr>
<th>No.</th>
<th>No Rujukan</th>
<th>Pembiayaan</th>
<th>Tempoh Simpan</th>
<th>Upah telah bayar</th>
<th>Upah semasa</th>
<th width="20%">Bayaran</th>
</tr>
</thead>
<tbody class="list">
@php $counter = 1; @endphp
@foreach($arraybayar as $index=>$bayar)
@if($bayar['hargajualan'] == '')
@php
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
@endphp
<tr>
<td>
{{ $counter }}
</td>
<td>
{{ $bayar['norujukan'] }}
</td>
<td>
{{ number_format($bayar['pinjaman'],2) }}
</td>
<td>
{{ number_format($bayar['tempoh'],2) }}
</td>
<td>
{{ number_format($bayar['telahbayar'],2) }}
</td>
<td>
{{ number_format($koskeuntungan,2) }}
</td>
<td>
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-upah="{{ $koskeuntungan }}" name="txtbayaran" placeholder="{{ $koskeuntungan }}" class="form-control"/>
<input type="hidden" name="txtbayaranhidden[]" class="bayaran"/>
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}"/>
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}"/>
</td>
</tr>
@php $counter++; @endphp
@endif
@endforeach
</tbody>
</table>
</div>
</div>
@foreach($arraybayar as $index=>$bayar)
<tbody class="list">
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
<div class="table-responsive table-striped text-center">
<table class="table align-items-center table-flush" id="selepas_tawarruq">
<thead class="thead-light">
<tr>
<td>
{{ $loop->iteration }}
</td>
<td>
{{ $bayar['norujukan'] }}
</td>
<td>
{{ $bayar['pinjaman'] }}
</td>
<td>
{{ $bayar['bakipjm'] }}
</td>
<td>
@php
$upahtawarruq = Http::get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
@endphp
{{ $upahtawarruq }}
</td>
<td>
@php
$ansuranbayar = Http::get(config('api.url') . '/api/transaction/' . $bayar['norujukan'])->json();
$totalansuran = 0;
if($ansuranbayar == '')
{
$totalansuran = 0;
}else{
foreach($ansuranbayar as $index1=>$ans)
{
$totalansuran += $ans['duit_masuk'];
}
}
@endphp
{{ $totalansuran }}
</td>
<td>
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-upah="{{ $upahtawarruq }}" name="txtbayaran" class="form-control"/>
<input type="hidden" name="txtbayaranhidden[]" class="bayaran"/>
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}"/>
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}"/>
</td>
<th>No</th>
<th>No Rujukan</th>
<th>Pembiayaan</th>
<th>B. Pembiayaan</th>
<th>Keuntungan</th>
<th width="20%">Bayaran</th>
</tr>
</tbody>
@endforeach
</table>
</thead>
@php $counter = 1; @endphp
@foreach($arraybayar as $index=>$bayar)
@if($bayar['hargajualan'] != '')
<tbody class="list">
<tr>
<td>
{{ $counter }}
</td>
<td>
{{ $bayar['norujukan'] }}
</td>
<td>
{{ number_format($bayar['pinjaman'],2) }}
</td>
<td>
{{ number_format($bayar['bakipjm'],2) }}
</td>
<td>
@php
$upahtawarruq = Http::get(config('api.url') . '/api/upahtawarruq/'. $bayar['kodcaw'] . '/' . $bayar['norujukan'])->json();
@endphp
{{ $upahtawarruq }}
</td>
<td>
<input type="text" data-bakipjm="{{ $bayar['bakipjm'] }}" data-upah="{{ $upahtawarruq }}" name="txtbayaran" placeholder="{{ $upahtawarruq }}" class="form-control"/>
<input type="hidden" name="txtbayaranhidden[]" class="bayaran"/>
<input type="hidden" name="txtnorujukanhidden[]" value="{{ $bayar['norujukan'] }}"/>
<input type="hidden" name="txtkodcawhidden[]" value="{{ $bayar['kodcaw'] }}"/>
</td>
</tr>
</tbody>
@php $counter++; @endphp
@endif
@endforeach
</table>
</div>
</div>
</div>
</div>
</div>
@@ -134,7 +192,18 @@
<div class="row mb--4 font-weight-light">
<div class="col-7">
<label class="text-dark ml-4 ">Bayaran</label>
<label class="text-dark ml-4 ">Bayaran Ar-Rahn</label>
</div>
<div class="col-5 text-right pr-5">
<span>RM <span id="spanbayaran">0.00</span></span>
</div>
</div>
<hr/>
<div class="row mb--4 font-weight-light">
<div class="col-7">
<label class="text-dark ml-4 ">Bayaran Tawarruq</label>
</div>
<div class="col-5 text-right pr-5">
@@ -146,7 +215,7 @@
<div class="row mb--4 font-weight-light">
<div class="col-7">
<label class="text-dark ml-4">Rebat</label>
<label class="text-dark ml-4">Keuntungan</label>
</div>
<div class="col-5 text-right pr-5">
@@ -197,6 +266,18 @@
}
});
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
"bLengthChange": false,
"bFilter": false,
"bInfo": false,
language: {
'paginate': {
'previous': '<span class="fas fa-backward"></span>',
'next': '<span class="fas fa-forward"></span>'
}
}
});
function validateform()
{
return false;
@@ -57,74 +57,144 @@
<h3 class="mb-0">Pembayaran SAG</h3>
</div>
<div class="nav-wrapper">
<ul class="nav nav-pills mt-4 " id="tabs-icons-text" role="tablist">
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0 active" id="tabs-icons-text-1-tab" data-toggle="tab" href="#tabs-icons-text-1" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">Ar-Rahn</a>
</li>
<li class="nav-item">
<a class="nav-link mb-sm-3 mb-md-0" id="tabs-icons-text-2-tab" data-toggle="tab" href="#tabs-icons-text-2" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false">Tawarruq</a>
</li>
</ul>
</div>
<form method="post" action="{{ route('payment.action') }}" onsubmit="return validateform()">
@csrf
<!-- Light table -->
<div class="table-responsive table-striped">
<table class="table align-items-center table-flush" id="belum_tawarruq">
<thead class="thead-light">
<tr>
<th>No Rujukan</th>
<th>Pembiayaan</th>
<th>Keuntungan</th>
<th>Nilai Marhun</th>
<th>Berat</th>
<th>Marhun</th>
<th>JBG</th>
<th>Kadar Upah</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody class="list">
@foreach($belum_tebus as $index=>$bt)
@if($bt['hargajualan'] != '')
<tr>
<th scope="row">
<div class="media align-items-center">
<div class="media-body">
@php
$marhun = Http::get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json();
@endphp
<a href="#" class="linktarget" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$bt['pinjaman']}}" data-norujukan="{{$bt['norujukan']}}" data-hargajualan="{{$bt['hargajualan']}}" data-kodcaw="{{ $bt['kodcaw'] }}" data-target="#marhunModal"><span class="name mb-0 text-sm">{{ $bt['norujukan'] }}</span></a>
<div class="card shadow">
<div class="card-body">
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="tabs-icons-text-1" role="tabpanel" aria-labelledby="tabs-icons-text-1-tab">
<div class="table-responsive table-striped">
<table class="table align-items-center table-flush" id="belum_tawarruq">
<thead class="thead-light">
<tr>
<th>No Rujukan</th>
<th>Pembiayaan</th>
<th>Tempoh Simpan</th>
<th>Upah telah bayar</th>
<th>Upah semasa</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody class="list">
@foreach($belum_tebus as $index=>$bt)
@if($bt['hargajualan'] == '')
@php
$koskeuntungan = Http::get(config('api.url') . '/api/upahbukantawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json();
@endphp
<tr>
<td scope="row">
<div class="media align-items-center">
<div class="media-body">
@php
$marhun = Http::get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json();
@endphp
<a href="#" class="linktarget" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$bt['pinjaman']}}" data-norujukan="{{$bt['norujukan']}}" data-hargajualan="{{$bt['hargajualan']}}" data-kodcaw="{{ $bt['kodcaw'] }}" data-target="#marhunModal"><span class="name mb-0 text-sm">{{ $bt['norujukan'] }}</span></a>
</div>
</div>
</td>
<td>
{{ number_format($bt['pinjaman'],2) }}
</td>
<td>
{{ number_format($bt['tempoh'],2) }}
</td>
<td>
{{ number_format($bt['telahbayar'],2) }}
</td>
<td>
{{ number_format($koskeuntungan,2) }}
</td>
<td>
<input type="checkbox" name="chkboxsag[]" value="{{ $bt['norujukan'] }}" id="sag-{{ $loop->iteration }}" data-norujukan="{{ $bt['norujukan'] }}"/>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</th>
<td>
{{ number_format($bt['pinjaman'],2) }}
</td>
<td>
{{ number_format($bt['bakiupah'],2) }}
</td>
<td>
{{ number_format($bt['nilaimarhun'],2) }}
</td>
<td>
{{ number_format($bt['berat'],2) }}
</td>
<td>
{{ $bt['marhun'] }}
</td>
<td>
{{ number_format($bt['jbg'],2) }}
</td>
<td>
{{ number_format($bt['kadarupah'],2) }}
</td>
<td>
<input type="checkbox" name="chkboxsag[]" value="{{ $bt['norujukan'] }}" id="sag-{{ $loop->iteration }}" data-norujukan="{{ $bt['norujukan'] }}"/>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="tab-pane fade" id="tabs-icons-text-2" role="tabpanel" aria-labelledby="tabs-icons-text-2-tab">
<!-- Light table -->
<div class="table-responsive table-striped">
<table class="table align-items-center table-flush" id="selepas_tawarruq">
<thead class="thead-light">
<tr>
<th>No Rujukan</th>
<th>Pembiayaan</th>
<th>B. Pembiayaan</th>
<th>Keuntungan (6bulan)</th>
<th>Keuntungan</th>
<th>Tindakan</th>
</tr>
</thead>
<tbody class="list">
@foreach($belum_tebus as $index=>$bt)
@if($bt['hargajualan'] != '')
@php
$koskeuntungan = Http::get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json();
$keuntungan_1bln = $bt['pinjaman'] * ($bt['kadarupah'] / 100);
$ten_percent = floatval($bt['nilaimarhun']) * 0.1;
$baki_pinjaman = floatval($bt['bakipjm']);
$max_bayaran = $baki_pinjaman - $ten_percent;
@endphp
<tr>
<th scope="row">
<div class="media align-items-center">
<div class="media-body">
@php
$marhun = Http::get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json();
@endphp
<a href="#" class="linktarget" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$bt['pinjaman']}}" data-norujukan="{{$bt['norujukan']}}" data-hargajualan="{{$bt['hargajualan']}}" data-kodcaw="{{ $bt['kodcaw'] }}" data-target="#marhunModal"><span class="name mb-0 text-sm">{{ $bt['norujukan'] }}</span></a>
</div>
</div>
</th>
<td>
{{ number_format($bt['pinjaman'],2) }}
</td>
<td>
{{ number_format($bt['bakipjm'],2) }}
</td>
<td>
{{ number_format($bt['bakiupah'],2) }}
</td>
<td>
{{ number_format($koskeuntungan,2) }}
</td>
<td>
<input type="checkbox" name="chkboxsag[]" value="{{ $bt['norujukan'] }}" id="sag-{{ $loop->iteration }}" data-norujukan="{{ $bt['norujukan'] }}"/>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<br>
</div>
</div>
</div>
</div>
<br>
<div class="d-flex justify-content-end">
<div class="d-flex justify-content-end mt-2">
<button type="submit" class="btn btn-primary">Checkout<span class="rounded bg-red ml-2 pr-1 pl-1" id="totalsag">0</span></button>
</div>
</form>
</form>
</div>
</div>
@@ -145,6 +215,18 @@
}
});
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
language: {
'paginate': {
'previous': '<span class="fas fa-backward"></span>',
'next': '<span class="fas fa-forward"></span>'
}
}
});
$("input[type='checkbox'][name='chkboxsag[]']").click(function () {
var count = parseInt($('#totalsag').text());
if ($(this).is(':checked')) {
+2 -2
View File
@@ -9,7 +9,7 @@
<div class="container-fluid mt--7">
<div class="row">
<div class="col-xl-4 order-xl-2 mb-5 mb-xl-0">
{{-- <div class="col-xl-4 order-xl-2 mb-5 mb-xl-0">
<div class="card card-profile shadow">
<div class="row justify-content-center">
<div class="col-lg-3 order-lg-2">
@@ -64,7 +64,7 @@
</div>
</div>
</div>
</div>
</div> --}}
<div class="col-xl-8 order-xl-1">
<div class="card bg-secondary shadow">
<div class="card-header bg-white border-0">