Files
lelong/resources/views/laporan/marhunpermatabycawanganallT.blade.php
2023-08-24 11:26:49 +08:00

178 lines
7.6 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col">
<div class="card">
<div class="card-header header-style">
<div class="card-header header-style">
<a href="javascript:window.history.go(-1);" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
<div class="header-style-title">
Marhun Permata Tawarruq: {{$cawanganDetail}}<br>
{{-- BatchNo: {{$senarai[0]['batchno']}} --}}
</div>
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
@hasrole('operasi')
<form id="exportpdf" action="{{route('reportbycaw.marhunpermatabycawdetailallpdfT',['cawid' => $cawid])}}" method="POST">
@endhasrole
@hasrole('pengurus-cawangan')
<form id="exportpdf" action="{{route('reportcaw.marhunpermatabycawdetailallpdfT',['cawid' => $cawid])}}" method="POST">
@endhasrole
@csrf
<input type="hidden" name="type" id="typedonwload" value="">
{{-- <input type="hidden" name="type" value="User"> --}}
<table class="table table-bordered text-center" id="tablenotislelong" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>No.Rujukan</th>
<th>Batch.No</th>
<th>No.KP</th>
<th>Kuantiti</th>
<th>Tarikh Pembiayaan/Tarikh Gadaian</th>
<th>Tarikh Lelong</th>
<th>Baki Lelong(RM)</th>
<th>Rugi Lelong(RM)</th>
<th>Tempoh Simpanan Batu Permata Selepas Lelong</th>
<th>Marhun Gadai</th>
<th>Marhun Lelong</th>
</tr>
</thead>
<tbody>
@if($senarai[0]['lelong']<> '')
@foreach ($senarai[0]['lelong'] as $index=>$bid)
{{-- {{ \Carbon\Carbon::createFromFormat('created_at', 'd-m-Y')->toDateTimeString() }} --}}
@php
$today = date('Y-m-d');
$get_start_date = new DateTime($today); // New date object
$get_end_date = date('Y-m-d',strtotime($bid['t_lelong']));
$end_date = new DateTime($get_end_date); // New date object
$months = $end_date->diff($get_start_date);
$months1 = $months->format('%y Tahun %m Bulan %d Hari');
@endphp
<tr>
<td>{{$loop->iteration}}
<td style='white-space:nowrap;'>{{ $bid['norujukan']}}</td>
<td>{{ $bid['batchno']}}</td>
<td>{{ $bid['nokp']}}</td>
<td>{{ $bid['kuantiti']}}</td>
<td style='white-space:nowrap;'> @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid['t_gadai'] );
$t_gadai = $myDateTime->format('d-m-Y');
echo($t_gadai);
@endphp</td>
<td style='white-space:nowrap;'>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid['t_lelong'] );
$t_lelong = $myDateTime->format('d-m-Y');
echo($t_lelong);
@endphp</td>
<td>@php if($bid['baki'] > 0){
$bakilelong = $bid['baki'];
echo($bakilelong);}
elseif($bid['baki'] < 0){
$bakilelong = '';
echo($bakilelong);}
@endphp
</td>
<td>@php if($bid['baki'] > 0){
$bakilelong = '';
echo($bakilelong);}
elseif($bid['baki'] < 0){
$bakilelong = $bid['baki'];
echo($bakilelong);}
@endphp
</td>
<td>{{$months1}}</td>
<td>{{ $bid['marhungadai']}}</td>
<td align='left' style='white-space:nowrap;'>
@foreach ($bid['listmarhun'] as $index1=>$bid2)
{{$loop->iteration.'. '.$bid2['marhun'].':'.$bid2['nota']}}<br>
@endforeach
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</form>
</div>
</div>
</div>
<script>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
var tablenotislelong = $('#tablenotislelong').DataTable({
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 3,
"orderable": false
}
],
order: [[0, 'asc']],
"info": false,
"lengthChange": false,
"pageLength": 99999,
dom: 'Bfrtip',
buttons: [
// {
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm export',
// target: "_blank",
// titleAttr: 'Export to Excel',
// text: '<h8><b>EXCEL</b></h8>',
// action: function ( e, dt, node, config ) {
// $('#typedonwload').val('excel');
// $("#exportpdf").submit();
// // window.open("_blank");
// }
// },
{
className: 'btn btn-outline-danger pl-4 pr-4 btn-sm export',
titleAttr: 'Export to PDF',
text: '<h8><b>PDF</b></h8>',
action: function ( e, dt, node, config ) {
$('#typedonwload').val('pdf');
$("#exportpdf").submit();
}
}
]
});
$('.export').tooltip();
$( '.export').removeClass('dt-button');
</script>
@endsection