Files
2023-03-27 14:35:26 +08:00

141 lines
6.3 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">
<a href="{{ route('jananotis.notislelong') }}" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
<div class="header-style-title">
Senarai SAG Lelongan
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<form id="exportpdf" action="{{route('jananotis.listnotis')}}" method="POST">
{{-- <form id="exportexcel" action="{{route('jananotis.listnotis_excel')}}" method="POST"> --}}
@csrf
<input type="hidden" name="type" id="typedonwload" value="">
<input type="hidden" name="lelong_id" value="{{ $lelong_id}}">
<table class="table table-bordered"" id="notis" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>No</th>
<th align="left">No KP</th>
<th align="left">No Telefon</th>
<th align="left">Alamat 1</th>
<th align="left">Alamat 2</th>
<th align="left">Alamat 3</th>
<th align="left">No Rujukan</th>
<th>Tempoh</th>
<th>Pembiayaan (RM)</th>
<th>Keuntungan 6 Bulan (RM)</th>
<th>Bayaran Telah Dibuat (RM)</th>
{{-- <th>Baki Lelong (simulasi) (RM)</th> --}}
</tr>
</thead>
<tbody>
@foreach($marhuns as $index1=> $notis)
<tr>
<td>{{ $loop->iteration }} </td>
<td>{{ $notis['nokp']}}</td>
<td>{{ $notis['nama']->telefon}}</td>
<td>{{ $notis['nama']->alamat1 }}</td>
<td>{{ $notis['nama']->alamat2 }}</td>
<td>{{ $notis['nama']->alamat3 }}</td>
{{-- <td style='word-wrap'>{{ $notis['nama']['nama']}}</td> --}}
<td style="white-space: nowrap;">@foreach($notis['listsag'] as $item){{ $item['norujukan']}}<br>@endforeach</td>
<td align="center">@foreach($notis['listsag'] as $item){{ $item['tempoh']}}<br>@endforeach</td>
<td align="right">@foreach($notis['listsag'] as $item){{ number_format($item['pinjaman'], 2, '.', ',')}}<br>@endforeach</td>
<td align="right">@foreach($notis['listsag'] as $item){{ number_format($item['bakiupah'], 2, '.', ',')}}<br>@endforeach</td>
<td align="right">@foreach($notis['listsag'] as $index=> $bayar){{ number_format($bayar['bayaran'], 2, '.', ',')}}<br>@endforeach</td>
{{-- <td>@foreach($notis['datalelongbid'] as $index=> $baki){{ number_format($baki['baki'], 2, '.', ',')}}<br>@endforeach</td> --}}
@endforeach
</tbody>
</table>
<div class="modal-footer" style="margin-top:2%;">
<a href="{{ route('jananotis.notislelong') }}" class="btn btn-primary">Kembali</a>
</div>
</div>
</div>
</div>
<script>
var tablelelongbid= $('#notis').DataTable( {
"columnDefs": [
{
"targets": 0,
"target": '_blank',
"orderable": false
},
{
"targets": 5,
"orderable": false
}
],
// order: [[1, 'asc']],
// // "ordering": false,
"info": false,
"lengthChange": false,
"pageLength": 9999999,
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-info pl-4 pr-4 btn-sm export',
target: "_blank",
titleAttr: 'Export to Excel by SAG',
text: '<h8><b>EXCEL By SAG</b></h8>',
action: function ( e, dt, node, config ) {
$('#typedonwload').val('excelbysag');
$("#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