laporan yang xsiap

This commit is contained in:
hafifierahman
2020-12-28 18:38:32 +08:00
parent 0f9455c76e
commit 49751140d2
36 changed files with 6307 additions and 139 deletions
+121 -13
View File
@@ -1,5 +1,44 @@
@extends('layouts.app')
<!-- The Modal -->
<div class="modal fade" id="marhunModal">
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title"></h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<h4>Marhun</h4>
<table id="biasa" class="table table-striped table-bordered text-center" style="width:100%">
<thead>
<tr>
<th>Bil</th>
<th>Jenis Marhun</th>
<th>Berat</th>
<th>Karat</th>
<th>Nilai Marhun</th>
<th>Nota</th>
</tr>
</thead>
<tbody id="tablemarhun">
</tbody>
</table>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@section('content')
<div class="container">
<div class="row justify-content-center">
@@ -13,11 +52,19 @@
<a href="{{ url('menu') }}" class="ion-backspace" style="font-size:50px;color:blue;"></a>
</div>
<div class="col-8 justify-content-center">
<label>Scan Barcode Keluar Marhun Dari Peti Besi</label>
<input type="text" class="form-control col-4 mx-auto" />
<form action="{{ route('barcodetebus.scanned') }}" method="post">
@csrf
<label>Scan Barcode Keluar Marhun Dari Peti Besi </label>
<input type="text" class="form-control col-6 mx-auto" name="norujukan_barcode" autocomplete="off" id="norujukan_barcode" placeholder="SILA SCAN BARCODE PADA SAG"/>
<input type="submit" id="submit_button" name="submit_button" hidden>
</form>
</div>
<div class="col-2">
</div>
</div>
@@ -47,15 +94,26 @@
<th>No Rujukan</th>
<th>Penilai</th>
<th>Transaksi</th>
<th>Nilai Marhun</th>
</tr>
</thead>
<tbody>
@foreach($listserah as $ls)
<tr>
<td>1</td>
<td>31231</td>
<td>2321</td>
<td>32</td>
<td>{{ $loop->iteration }}</td>
<td>
@php
$marhun = Http::get($api_url . '/api/marhun/' . $ls['norujukan'] )->json();
// dd($marhun);
@endphp
<a href="#" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-norujukan="{{$ls['norujukan']}}" data-kodcaw="{{ $ls['kodcaw'] }}"
data-target="#marhunModal"> {{$ls['norujukan']}} </a></td>
<td></td>
<td>{{ $ls['jenistebus'] }}</td>
<td>{{ $ls['nilaimarhun'] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@@ -70,24 +128,33 @@
<th>No Rujukan</th>
<th>PO / PPO</th>
<th>Transaksi</th>
<th>Masa</th>
<th>Nilai Marhun</th>
</tr>
</thead>
<tbody>
@foreach($senaraitebus as $index)
<tr>
<td>1</td>
<td>31231</td>
<td>2321</td>
<td>32</td>
<td>323</td>
<td>{{$loop->iteration}}</td>
<td>
@php
$marhun = Http::get($api_url . '/api/marhun/' . $index['norujukan'] )->json();
@endphp
<a href="#" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-norujukan="{{$index['norujukan']}}" data-kodcaw="{{ $index['kodcaw'] }}"
data-target="#marhunModal"> {{$index['norujukan']}} </a></td>
<td></td>
<td>{{$index['jenistebus']}}</td>
<td>{{$index['nilaimarhun']}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="row mt-5">
<div class="mx-auto">
<h4>Jumlah Surat Gadai : <span class="badge badge-secondary">4 </span></h4>
<h4>Jumlah Surat Gadai : <span class="badge badge-secondary">{{ count($listserah) + count($senaraitebus) }} </span></h4>
</div>
<div class="form-group d-flex justify-content-end mr-4">
<a href="{{ url('menu') }}" class="btn btn-primary">Cetak</a>
@@ -99,4 +166,45 @@
</div>
</div>
</div>
<script>
var api_url = "<?php echo $api_url ?>";
var table_gadaian_semasa = $('#table-gadaian-semasa').DataTable({
"ordering": false
});
var table_gadaian_belum_serah = $('#table-gadaian-belum-serah').DataTable({
"ordering": false
});
//modal
$('#marhunModal').on('show.bs.modal', function(event) {
var button = $(event.relatedTarget); // button yg trigger
var arraymarhun = button.data('marhun');
var norujukan = button.data('norujukan');
var kodcaw = button.data('kodcaw');
$('#tablemarhun').empty();
$.each(arraymarhun,function(index,marhun){
$.each(marhun, function(index,marhun_detail){
var marhun_name;
$.ajax({
method:'GET',
url: api_url + '/api/jemas/nama_marhun',
dataType: 'json',
data:{
marhun:marhun_detail['marhun']
},
success:function(marhun_ajax){
$("#tablemarhun").append("<tr><td>" + marhun_detail['bil'] + "</td><td>" + marhun_ajax['descpt'] +"</td><td>" + marhun_detail['berat'] +"</td><td>" + marhun_detail['karat'] +"</td><td>RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +"</td><td>"+ marhun_detail['nota'] +"</td></tr>");
}
});
});
});
});
</script>
@endsection