list gadai detail
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="text-center">
|
||||
<img src="{{ asset('img/logo_arrahn.png') }}" class="logo-arrahn" alt="Logo Ar Rahn" />
|
||||
<img src="{{ asset('img/logo_arrahn_baru.png') }}" class="logo-arrahn" alt="Logo Ar Rahn" />
|
||||
<h1>SISTEM AR-RAHN</h1>
|
||||
</div>
|
||||
<div class="card">
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
@section('content')
|
||||
<?php
|
||||
$customer_info = Session::get('customer_info');
|
||||
$belum_tebus = Session::get('belum_tebus');
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
@@ -64,13 +65,13 @@
|
||||
<div class="col-12 mt-3 form-group row">
|
||||
<div class="btn-group btn-group-toggle col-6" data-toggle="buttons">
|
||||
<label class="btn btn-primary">
|
||||
<input type="radio" name="options" id="option1" autocomplete="off"> BELUM TEBUS
|
||||
<input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked> BELUM TEBUS
|
||||
</label>
|
||||
<label class="btn btn-primary">
|
||||
<input type="radio" name="options" id="option2" autocomplete="off"> SUDAH TEBUS
|
||||
<input type="radio" name="options" id="option2" value="sudah_tebus" autocomplete="off"> SUDAH TEBUS
|
||||
</label>
|
||||
<label class="btn btn-primary">
|
||||
<input type="radio" name="options" id="option3" autocomplete="off"> LELONG
|
||||
<input type="radio" name="options" id="option3" value="lelong" autocomplete="off"> LELONG
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
@@ -86,11 +87,11 @@
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Tarikh Gadai</th>
|
||||
<th>Pinjaman</th>
|
||||
<th>Pembiayaan</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>JBG</th>
|
||||
<th>Upah</th>
|
||||
<th>Tebus/Upah</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Keuntungan</th>
|
||||
<!-- <th>Tebus/Upah</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
@@ -100,8 +101,70 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var tablegadai = $('#myTable').DataTable();
|
||||
function gadaiTable(data){
|
||||
var counter = 1;
|
||||
tablegadai.clear();
|
||||
$.each(data,function(index,gadai){
|
||||
$.each(gadai, function(index,gadai_detail){
|
||||
tablegadai.row.add([
|
||||
counter,
|
||||
gadai_detail['norujukan'],
|
||||
gadai_detail['t_gadai'],
|
||||
'RM '+ gadai_detail['pinjaman'].toLocaleString("en-GB"),
|
||||
'RM '+ gadai_detail['nilaimarhun'].toLocaleString("en-GB"),
|
||||
'0',
|
||||
'RM '+ ((gadai_detail['kadarupah']/100)*gadai_detail['pinjaman']*gadai_detail['tempoh'])
|
||||
]).draw();
|
||||
|
||||
counter = counter + 1;
|
||||
});
|
||||
});
|
||||
}
|
||||
$(document).ready( function () {
|
||||
$('#myTable').DataTable();
|
||||
var noic = $("#noic").val();
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url:"http://localhost:8000/api/customers/"+noic+"/gadai/belum_tebus",
|
||||
success: function(data){
|
||||
gadaiTable(data);
|
||||
}
|
||||
});
|
||||
$("input[name='options']").click(function(){
|
||||
gadaiOptionButton(noic)
|
||||
});
|
||||
} );
|
||||
|
||||
function gadaiOptionButton(noic){
|
||||
tablegadai.clear();
|
||||
if($("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
// console.log(noic);
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url:"http://localhost:8000/api/customers/"+noic+"/gadai/belum_tebus",
|
||||
success: function(data){
|
||||
gadaiTable(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url:"http://localhost:8000/api/customers/"+noic+"/gadai/sudah_tebus",
|
||||
success: function(data){
|
||||
gadaiTable(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
if($("input[name='options']:checked").val() == 'lelong'){
|
||||
$.ajax({
|
||||
method:"GET",
|
||||
url:"http://localhost:8000/api/customers/"+noic+"/gadai/lelong",
|
||||
success: function(data){
|
||||
gadaiTable(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<link href="{{ asset('vendor/fontawesome-free/css/all.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('vendor/DataTables/datatables.min.css') }}" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
|
||||
<script src="{{ asset('vendor/DataTables/datatables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
@@ -57,7 +57,7 @@
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
<img src="{{ asset('img/logo_arrahn.png') }}" class="logo-arrahn-header" alt="Logo Ar Rahn" /> AR-RAHN
|
||||
<img src="{{ asset('img/logo_arrahn_baru.png') }}" class="logo-arrahn-header" alt="Logo Ar Rahn" /> AR-RAHN
|
||||
</a>
|
||||
<div id="displaytime"></div>
|
||||
<div class="navbar-brand ml-md-3">
|
||||
|
||||
Reference in New Issue
Block a user