list gadai detail

This commit is contained in:
Zakwan Hamdan
2020-10-26 13:38:29 +08:00
parent 4a83c0439e
commit 29b6272c5f
18 changed files with 103 additions and 100995 deletions
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
class LoginController extends Controller
{
@@ -57,7 +58,9 @@ class LoginController extends Controller
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
return view('homepage.home');
$auth_user = Auth::user();
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('homepage.home',compact('cawangan_info'));
}
return redirect('login')->with('error', 'Oppes! You have entered invalid credentials');
+10 -3
View File
@@ -44,12 +44,19 @@ class CustomersController extends Controller
$auth_user = Auth::user();
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$customer_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
// dd($customer_info);
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
$customer_info = $customers_info[0];
$belum_tebus = Http::get(config('api.url') . '/api/customers/'. $noic .'/gadai/belum_tebus')->json();
$sudah_tebus = Http::get(config('api.url') . '/api/customers/'. $noic .'/gadai/sudah_tebus')->json();
$lelong = Http::get(config('api.url') . '/api/customers/'. $noic .'/gadai/lelong')->json();
// dd($belum_tebus);
$search = true;
if($customer_info){
Session::put('customer_info',$customer_info);
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info] );
Session::put('belum_tebus',$belum_tebus);
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'belum_tebus'=>$belum_tebus,'sudah_tebus'=>$sudah_tebus,'lelong'=>$lelong]);
}else{
return view('customers.index',compact('customer_info','search','noic','cawangan_info'));
}
+1 -1
View File
@@ -25,7 +25,7 @@ return [
'allowed_headers' => ['*'],
'exposed_headers' => [],
'exposed_headers' => ['*'],
'max_age' => 0,
+1 -1
View File
@@ -1,5 +1,5 @@
.logo-arrahn{
width: 100px;
width: 290px !important;
}
.logo-arrahn-header{
width: 20px;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File
+2 -2
View File
@@ -4,10 +4,10 @@
*
* To rebuild or modify this file with the latest versions of the included
* software please visit:
* https://datatables.net/download/#dt/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.22/af-2.3.5/b-1.6.5/b-colvis-1.6.5/b-flash-1.6.5/b-html5-1.6.5/b-print-1.6.5/cr-1.5.2/fc-3.3.1/fh-3.1.7/kt-2.5.3/r-2.2.6/rg-1.1.2/rr-1.2.7/sc-2.0.3/sb-1.0.0/sp-1.2.1/sl-1.3.1
* https://datatables.net/download/#dt/jszip-2.5.0/dt-1.10.22/af-2.3.5/b-1.6.5/b-colvis-1.6.5/b-flash-1.6.5/b-html5-1.6.5/b-print-1.6.5/cr-1.5.2/fc-3.3.1/fh-3.1.7/kt-2.5.3/r-2.2.6/rg-1.1.2/rr-1.2.7/sc-2.0.3/sb-1.0.0/sp-1.2.1/sl-1.3.1
*
* Included libraries:
* JSZip 2.5.0, pdfmake 0.1.36, DataTables 1.10.22, AutoFill 2.3.5, Buttons 1.6.5, Column visibility 1.6.5, Flash export 1.6.5, HTML5 export 1.6.5, Print view 1.6.5, ColReorder 1.5.2, FixedColumns 3.3.1, FixedHeader 3.1.7, KeyTable 2.5.3, Responsive 2.2.6, RowGroup 1.1.2, RowReorder 1.2.7, Scroller 2.0.3, SearchBuilder 1.0.0, SearchPanes 1.2.1, Select 1.3.1
* JSZip 2.5.0, DataTables 1.10.22, AutoFill 2.3.5, Buttons 1.6.5, Column visibility 1.6.5, Flash export 1.6.5, HTML5 export 1.6.5, Print view 1.6.5, ColReorder 1.5.2, FixedColumns 3.3.1, FixedHeader 3.1.7, KeyTable 2.5.3, Responsive 2.2.6, RowGroup 1.1.2, RowReorder 1.2.7, Scroller 2.0.3, SearchBuilder 1.0.0, SearchPanes 1.2.1, Select 1.3.1
*/
/*
+3 -50479
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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">
+72 -9
View File
@@ -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>
$(document).ready( function () {
$('#myTable').DataTable();
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 () {
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
+5 -5
View File
@@ -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">