Files
lelong/resources/views/simulasi/senaraitempsimulasi.blade.php
2022-12-03 23:27:25 +08:00

204 lines
8.9 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col mx-auto p-4">
<div class="card">
<div class="card-header header-style">
<div class="header-style-title">
Butiran Gadaian Mengikut Cawangan Lelongan Fasa {{$fasa}}
</div>
</div>
<div class="card-body">
@if ($message = Session::get('failed'))
<div class="alert alert-danger" style="margin-top:1%;">
<p>{{ $message }}</p>
</div>
@endif
{{-- @if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif --}}
{{-- <h3 class="pt-3" style="margin-left:1%;">Butiran Gadaian Mengikut Cawangan Lelongan Fasa {{$fasa}}</h3> --}}
<!-- <form action="{{route('analisa.janadata')}}" method="POST" enctype="multipart/form-data"> -->
<form action="{{route('analisa.janadata2')}}" method="POST" enctype="multipart/form-data">
<!-- <form action="{{route('analisa.importgadaifrommaster')}}" method="POST" enctype="multipart/form-data"> -->
@csrf
<input type="hidden" class="form-control" id="fasa" name="fasa" value="{{$fasa}}">
<div id='loader'><img id="loader-image" src="../img/loadingmsg.gif" alt="Sila Tunggu Sebentar..." /></div>
<div class="container">
<div>
<div style="margin-top:2%; margin-bottom:2%;">
<p> <b>Tarikh Lelong : </b> {{ $t_lelong1 }}</p>
<p> <b>Tarikh Gadai Sehingga : </b> @php
if($fasa == '1'){
$myDateTime = DateTime::createFromFormat('Y-m-d', $jbgadai );
$t_gadai = $myDateTime->format('d-m-Y');
$t_gadai1 = $myDateTime->format('Y-m-d');
echo($t_gadai);
}else{
$myDateTime = DateTime::createFromFormat('Y-m-d', $t_lelong2 );
$tarikhlelong = $myDateTime->modify('-12 month')->format('d-m-Y');
//$t_gadai1 = $myDateTime->modify('-12 month')->format('Y-m-d');
//$t_gadai = $myDateTime->modify('-12 month')->format('Y-m-d');
$t_gadai1 = $myDateTime->format('Y-m-d');
echo($tarikhlelong);
}
@endphp</p>
<p> <b>Lelongan Kali Ke -</b> {{ $tetapan->kali }}</p>
<input type="hidden" class="form-control" id="tarikh_lelong" name="tarikh_lelong" value="{{$t_lelong2}}">
<input type="hidden" class="form-control" id="t_gadai" name="t_gadai" value="@php echo($t_gadai1) @endphp">
<input type="hidden" class="form-control" id="jbg" name="jbg" value="{{$jbg}}">
<input type="hidden" class="form-control" id="hargaasas" name="hargaasas" value="0.00">
<input type="hidden" class="form-control" id="cajlelong" name="cajlelong" value="{{$cajlelong}}">
<input type="hidden" class="form-control" id="kali" name="kali" value="{{$tetapan->kali}}">
</div>
</div>
</div>
<table class="table text-right table-bordered" id="senaraitemp" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th><input type="checkbox" aria-label="Checkbox for following text input" id="checkall"></th>
<th>Bil</th>
<th>Kod Cawangan</th>
<th>Cawangan</th>
<th>Bil Lelong</th>
<th>Berat (gm)</th>
<th>Nilai Marhun</th>
<th>Pembiayaan (RM)</th>
<th>Baki Pembiayaan (RM)</th>
<th class="text-center">Tindakan</th>
</tr>
</thead>
<tbody>
@php $count = 1; @endphp
@foreach($senarai as $send)
@if($send['bil_lelong'] > 0)
<tr>
<td><input type="checkbox" aria-label="Checkbox for following text input" name="caw[]" id="caw" value = "{{ $send['kodcaw'] }}" class="checkbox"></td>
<td>{{ $count++ }}</td>
<td>{{ $send['kodcaw'] }}</td>
<td >{{ $send['caw_name'] }}</td>
<td>{{ $send['bil_lelong'] }} </td>
<td>{{ number_format($send['total_berat'], 2) }} </td>
<td>{{ number_format($send['total_nilaimarhun'], 2) }} </td>
<td>{{ number_format($send['total_pembiayaan'] , 2) }} </td>
<td>{{ number_format($send['total_bakipjm'] , 2) }} </td>
<td>
<a href=" {{ route('analisa.tempbycawsimulasi', [$send['kodcaw'],$t_gadai1,$fasa]) }} " data-toggle="tooltip" data-placement="top" title="Butiran Gadaian"><i class="far fa-edit"></i></a>
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<div class="modal-footer; text-center" style="margin-top:2%; margin-bottom:2%;">
<a href="{{ route('analisa.janasimulasi') }}" class="btn btn-primary" style="width:8%;">Kembali</a>
<button type="submit" class="btn btn-success">Jana Simulasi</button>
</div>
</form>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
var tablesenaraitemp = $('#senaraitempsimulasi').DataTable({
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 8,
"orderable": false
}
],
order: [[1, 'asc']],
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
// buttons: [
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addcaw',
// text: '<i class="fas fa-plus" id="test"></i>',
// titleAttr: 'Tambah Cawangan',
// action: function ( e, dt, node, config ) {
// // alert( 'Button activated' );
// // console.log('hye');
// $('#myModal').modal("show");
// $('#myModal').on('shown.bs.modal', function () {
// $('#rolename').trigger('focus')
// })
// }
// },
// {
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
// titleAttr: 'Export to CSV',
// text: '<i class="fas fa-download"></i>',
// action: function ( e, dt, node, config ) {
// $("#exportform").submit();
// }
// }
// ]
});
// $('.addcaw').tooltip();
// $('.export').tooltip();
// // $( '.dt-buttons').addClass('btn-group');
// $( '.addcaw').removeClass('dt-button');
// $( '.export').removeClass('dt-button');
</script>
<script type='text/javascript'>
$(document).ready(function(){
// Check or Uncheck All checkboxes
$("#checkall").change(function(){
var checked = $(this).is(':checked');
if(checked){
$(".checkbox").each(function(){
$(this).prop("checked",true);
});
}else{
$(".checkbox").each(function(){
$(this).prop("checked",false);
});
}
});
// Changing state of CheckAll checkbox
$(".checkbox").click(function(){
if($(".checkbox").length == $(".checkbox:checked").length) {
$("#checkall").prop("checked", true);
} else {
$("#checkall").prop("checked", false);
}
});
});
</script>
<script>
$(function() {
$( "form" ).submit(function() {
$('#loader').show();
});
});
</script>
@endsection