Files
2023-04-03 15:52:47 +08:00

161 lines
6.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">
<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}}">
<div style = "overflow-x:auto">
<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($customers as $customer)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$customer->kpbaru ? $customer->kpbaru : $customer->kplama}}</td>
<td>{{$customer->telefon}}</td>
<td>{{$customer->alamat1}}</td>
<td>{{$customer->alamat2}}</td>
<td>{{$customer->alamat3}}</td>
<td style="white-space: nowrap;">@foreach($customer['gadai'] as $data)
{{$data->norujukan}}<br>
@endforeach
</td>
<td>@foreach($customer['gadai'] as $data)
{{$data->tempoh}}<br>
@endforeach
</td>
<td align = "right">@foreach($customer['gadai'] as $data)
{{number_format($data->bakipjm, 2, '.', ',')}}<br>
@endforeach
</td>
<td align = "right">@foreach($customer['gadai'] as $data)
{{number_format($data->bakiupah, 2, '.', ',')}}<br>
@endforeach
</td>
<td align = "right">@foreach($customer['gadai'] as $data)
{{$data->ktlhbyr}}<br>
@endforeach
</td>
<td align="right"><b>@foreach($customer['gadai'] as $data)
{{$data->bakilelong}}<br>
@endforeach
</b>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{-- <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,
"bPaginate": false,
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