Files
erahn-click/resources/views/includes/rekod/rekodsag.blade.php
T
2025-01-13 00:31:48 +08:00

276 lines
11 KiB
PHP

@extends('layouts.indexthird')
@section('content')
@include('modal.historybayaran')
<title>Senarai SAG | Portal Pelanggan</title>
<div class="container">
<div class="row">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item text-dark opacity-5"><a href="/">Home</a></li>
<li class="breadcrumb-item text-dark opacity-5"><a href="{{ route('semaksag') }}">Rekod Pembayaran</a></li>
<li class="breadcrumb-item text-dark active" aria-current="page">Senarai Pembayaran</li>
</ol>
</nav>
</div>
</div>
<div class="row">
<div class="col-md-5 ms-auto me-auto text-center">
<!-- <div class="icon icon-md icon-shape bg-gradient-primary shadow-primary text-center border-radius-xl mt-n4"> -->
<!-- <i class="material-icons opacity-10">engineering</i> -->
<img src="{{ asset('argon/img/brand/arrahnlogo.png') }}" alt="logo ar-rahn" width="50px" height="39px">
<!-- </div> -->
<!-- <h3 class="text-dark mb-0 mt-3">SAG</h3> -->
<p style="margin-top: 2%;">Senarai Pembayaran dan penebusan pelanggan.</p>
<h6 class="text-primary" style="margin-bottom:10%;">Cawangan : {{ $cawangan_info[0]['cawangan'] }}</h6>
</div>
</div>
{{-- <div class="container col-11 shadow-lg p-3 mb-5 bg-white rounded">
<div class="card-header border-0">
<h5 class="mb-0 text-primary">Ar-Rahn</h5>
</div>
<div class="table-responsive table-bordered">
<table class="table align-items-center table-flush table-hover" id="belum_tawarruq">
<thead class="thead-light">
<tr>
<th scope="col" class="sort" data-sort="name">No Rujukan</th>
<th scope="col" class="sort" data-sort="budget">Pembiayaan</th>
<th scope="col" class="sort" data-sort="status">Upah</th>
<th scope="col" class="sort" data-sort="status">Nilai Marhun</th>
<th scope="col" class="sort" data-sort="status">Berat</th>
<th scope="col" class="sort" data-sort="status">JBG</th>
<th scope="col" class="sort" data-sort="status">Kadar Upah</th>
</tr>
</thead>
<tbody class="list">
@foreach($belum_tebus as $index=>$bt)
@if($bt['hargajualan'] == '')
<tr style="text-align: center;">
<th scope="row">
<div class="media align-items-center">
<div class="media-body">
<a href="{{ route('penyata.summaryupah',['kodcaw' => $bt['kodcaw'], 'norujukan' => $bt['norujukan']]) }}" target="_blank"><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['bakiupah'],2) }}
</td>
<td>
{{ number_format($bt['nilaimarhun'],2) }}
</td>
<td>
{{ number_format($bt['berat'],2) }}
</td>
<td>
{{ number_format($bt['tempoh'],2) }}
</td>
<td>
{{ number_format($bt['kadarupah'],2) }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<br>
</div>
<hr class="dark my-md-6 mt-2 mx-7"> --}}
<div class="container col-11 shadow-lg p-3 mb-5 bg-white rounded">
<div class="card-header border-0">
<h5 class="mb-0 text-primary">Transaksi Bayaran</h5>
</div>
<!-- Light table -->
<div class="table-responsive table-bordered">
<table class="table align-items-center table-flush table-hover border" id="selepas_tawarruq" style="width: 100%;">
<thead class="thead-light bg-dark text-white text-center">
<tr>
<th scope="col" class="sort" data-sort="name">No Rujukan</th>
<th scope="col" class="sort" data-sort="budget">Keuntungan</th>
<th scope="col" class="sort" data-sort="budget">JBG</th>
</tr>
</thead>
<tbody class="list">
@foreach($belum_tebus as $index=>$bt)
@if($bt['hargajualan'] != '')
<tr style="text-align: center;">
<th scope="row">
<div class="media align-items-center">
<div class="media-body">
<a href="#" onclick="bayaranfunc(this)" data-pinjaman="{{ number_format($bt['pinjaman'],2) }}" data-upah12="{{ number_format($bt['upah12'],2) }}" data-bakipjm="{{ number_format($bt['bakipjm'],2) }}" data-berat="{{ $bt['berat'] }}" data-nm="{{ number_format($bt['nilaimarhun'],2) }}" class="linktarget" data-toggle="modal" data-target="#historybayaranModal" data-norujukan="{{ $bt['norujukan'] }}" data-url="">{{ $bt['norujukan'] }}</a>
{{-- <a href="{{ route('penyata.summary',['kodcaw' => $bt['kodcaw'], 'norujukan' => $bt['norujukan']]) }}" target="_blank"><span class="name mb-0 text-sm">{{ $bt['norujukan'] }}</span></a> --}}
</div>
</div>
</th>
<td>
{{ number_format($bt['bakiupah'],2) }}
</td>
<td>
{{ number_format($bt['tempoh'],2) }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<br>
</div>
<!-- <hr class="dark my-md-6 mt-2 mx-7"> -->
<div class="container col-11 shadow-lg p-3 mb-5 bg-white rounded">
<div class="card-header border-0">
<h5 class="mb-0 text-primary">Pembiayaan Yang Sudah Diselesaikan</h5>
</div>
<!-- Light table -->
<div class="table-responsive table-bordered">
<table class="table align-items-center table-flush table-hover border" id="saghistory" style="width: 100%;">
<thead class="thead-light bg-dark text-white text-center">
<tr>
<th scope="col" class="sort" data-sort="name">No Rujukan</th>
<th scope="col" class="sort" data-sort="budget">Pinjaman</th>
<th scope="col" class="sort" data-sort="budget">N. Marhun</th>
<th scope="col" class="sort" data-sort="budget">Berat(gm)</th>
<th scope="col" class="sort" data-sort="budget">JBG</th>
<th scope="col" class="sort" data-sort="budget">Upah</th>
<th scope="col" class="sort" data-sort="budget">J.Tebus</th>
<th scope="col" class="sort" data-sort="budget">T.Tebus</th>
</tr>
</thead>
<tbody class="list">
@foreach($sudah_tebus as $index=>$st)
@if($st['hargajualan'] != '')
<tr style="text-align: center;">
<th scope="row">
<div class="media align-items-center">
<div class="media-body">
<a href="{{ route('resit.tebus',['kodcaw' => $st['kodcaw'], 'norujukan' => $st['norujukan']]) }}" target="_blank"><span class="name mb-0 text-sm">{{ $st['norujukan'] }}</span></a>
</div>
</div>
</th>
<td>
{{ number_format($st['pinjaman'],2) }}
</td>
<td>
{{ number_format($st['nilaimarhun'],2) }}
</td>
<td>
{{ number_format($st['berat'],2) }}
</td>
<td>
{{ number_format($st['tempoh'],2) }}
</td>
<td>
{{ number_format($st['bakiupah'],2) }}
</td>
<td>
{{ $st['sttebus'] }}
</td>
<td>
{{ date("d-m-Y", strtotime($st['t_update'])) }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<br>
</div>
</div>
<script>
var endpoint = "{{ $api_url }}";
var historybayarandatatable = $('#tablehistorybayaran').DataTable({
"ordering": false
});
var selepastawarruqtable = $('#selepas_tawarruq').DataTable({
"bLengthChange": false,
"bFilter": true,
// "pagingType": "simple_numbers",
"pageLength": 5,
language: {
'paginate': {
'previous': '<span class="fas fa-backward"></span>',
'next': '<span class="fas fa-forward"></span>'
}
},
"scrollX": true
});
var sudahtebustable = $('#saghistory').DataTable({
"bLengthChange": false,
"bFilter": true,
// "pagingType": "simple",
"pageLength": 5,
language: {
'paginate': {
'previous': '<span class="fas fa-backward"></span>',
'next': '<span class="fas fa-forward"></span>'
}
},
"scrollX": true
});
function bayaranfunc(e){
let norujukan = $(e).data('norujukan');
let pinjaman = $(e).data('pinjaman');
let upah12 = $(e).data('upah12');
let bakipjm = $(e).data('bakipjm');
let berat = $(e).data('berat');
let nm = $(e).data('nm');
$('#pembiayaan').text('RM ' + pinjaman);
$('#bpemb').text('RM ' + bakipjm);
$('#nm').text('RM ' + nm);
$('#berat').text(berat + 'g');
$('#koskeun').text('RM ' + upah12);
$.ajax({
method: 'get',
url: endpoint + '/api/transaction/' + norujukan,
success: function(data){
historybayarantable(data);
}
});
}
function historybayarantable(data){
var counter = 1;
historybayarandatatable.clear().draw();
$.each(data,function(index,bayaran){
var urlroute = '{{ route("resit.ansuran", ":id") }}';
urlroute = urlroute.replace(':id', bayaran['id']);
var date = new Date(bayaran['created_at']);
historybayarandatatable.row.add([
counter,
// date.toLocaleDateString(),
'<a target="_blank" href='+ urlroute + '>'+date.toLocaleDateString()+'</a>',
"RM " + bayaran['duit_masuk'],
]).draw();
counter = counter + 1;
});
}
</script>
@endsection