e29a5891c8
Reviewed-on: #5 Co-authored-by: ISMAIL MASSERAN <ismail@koppkb.com> Co-committed-by: ISMAIL MASSERAN <ismail@koppkb.com>
162 lines
8.0 KiB
PHP
162 lines
8.0 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container-fluid">
|
|
<div class="col">
|
|
<div class="card">
|
|
<div class="card-header header-style">
|
|
<div class="header-style-title">
|
|
Jana Notis Lelong
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
@if ($message = Session::get('success'))
|
|
<div class="alert alert-success">
|
|
<p>{{ $message }}</p>
|
|
</div>
|
|
@endif
|
|
@if ($message = Session::get('error'))
|
|
<div class="alert alert-danger">
|
|
<p>{{ $message }}</p>
|
|
</div>
|
|
@endif
|
|
<form id="exportform" action="" method="POST">
|
|
<input type="hidden" name="type" value="User">
|
|
<table class="table text-center table-bordered" id="tablenotislelong" style="width:100%">
|
|
<thead class="bg-primary text-white">
|
|
<tr>
|
|
{{-- <th><input type="checkbox" aria-label="Checkbox for following text input" onclick="selectall(this)"></th> --}}
|
|
<th>Batch Lelong</th>
|
|
<th>Tarikh Lelong</th>
|
|
<th>Fasa</th>
|
|
<th>Bilangan SAG</th>
|
|
<th class="text-center">Tindakan</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
@foreach ($lelongid as $bid)
|
|
@php
|
|
$exportKey = $bid->lelong_id . '_' . $bid->fasa;
|
|
$export = $latestExports[$exportKey] ?? null;
|
|
@endphp
|
|
<tr>
|
|
{{-- <td><input type="checkbox" aria-label="Checkbox for following text input" name="checkboxdata[]" value="{{ $bid->id }}"></td> --}}
|
|
<td>{{ $bid->lelong_id }}</td>
|
|
<td> @php
|
|
$myDateTime = DateTime::createFromFormat('Y-m-d', $bid->tarikh_lelong );
|
|
$datez = $myDateTime->format('d-m-Y');
|
|
echo($datez);
|
|
@endphp</td>
|
|
<td>{{ $bid->fasa }}</td>
|
|
<td>{{ $bid['bilangan'] }}</td>
|
|
<td class="text-center">
|
|
<a class="btn m-1 btn-primary" href="{{ route('jananotis.senarainotis',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Butiran Senarai Notis" ><i class="far fa-edit"></i></a>
|
|
@if($bid->fasa == '1')
|
|
@if($export && $export->isInProgress())
|
|
<button type="button" class="btn m-1 btn-secondary" disabled data-toggle="tooltip" title="Sedang dijana">
|
|
<i class="fas fa-spinner fa-spin"></i>
|
|
</button>
|
|
@elseif($export && $export->isReady())
|
|
<button type="button" class="btn m-1 btn-secondary" disabled data-toggle="tooltip" title="Telah dijana">
|
|
<i class="fas fa-file-pdf"></i>
|
|
</button>
|
|
<a class="btn m-1 btn-success" href="{{ route('jananotis.download_export', $export->id) }}" data-toggle="tooltip" data-placement="top" title="Muat Turun PDF Fasa 1"><i class="fas fa-download"></i></a>
|
|
@else
|
|
<a class="confirmrefresh btn m-1 btn-warning" href="{{ route('jananotis.jananotis_new',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Jana Notis Fasa 1" ><i class="fas fa-file-pdf"></i></a>
|
|
@if($export && $export->status === 'failed')
|
|
<span class="badge badge-danger m-1" data-toggle="tooltip" title="{{ $export->error_message }}">Gagal</span>
|
|
@endif
|
|
@endif
|
|
@elseif($bid->fasa == '2')
|
|
@if($export && $export->isInProgress())
|
|
<button type="button" class="btn m-1 btn-secondary" disabled data-toggle="tooltip" title="Sedang dijana">
|
|
<i class="fas fa-spinner fa-spin"></i>
|
|
</button>
|
|
@elseif($export && $export->isReady())
|
|
<button type="button" class="btn m-1 btn-secondary" disabled data-toggle="tooltip" title="Telah dijana">
|
|
<i class="fas fa-file-pdf"></i>
|
|
</button>
|
|
<a class="btn m-1 btn-success" href="{{ route('jananotis.download_export', $export->id) }}" data-toggle="tooltip" data-placement="top" title="Muat Turun PDF Fasa 2"><i class="fas fa-download"></i></a>
|
|
@else
|
|
<a class="confirmrefresh btn m-1 btn-warning" href="{{ route('jananotis.jananotis_new2',$bid->lelong_id) }}" data-toggle="tooltip" data-placement="top" title="Jana Notis Fasa 2" ><i class="fas fa-file-pdf"></i></a>
|
|
@if($export && $export->status === 'failed')
|
|
<span class="badge badge-danger m-1" data-toggle="tooltip" title="{{ $export->error_message }}">Gagal</span>
|
|
@endif
|
|
@endif
|
|
@endif
|
|
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
//Enable tooltips everywhere
|
|
$(function () {
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
})
|
|
|
|
$('a.confirmrefresh').confirm({
|
|
title: 'Jana Notis Lelong',
|
|
content: 'Adakah anda pasti? Sistem akan menjana PDF notis dan menghantar notis WhatsApp kepada pelanggan. Tindakan ini tidak dapat dikembalikan.',
|
|
icon: 'fa fa-exclamation-triangle',
|
|
type: 'orange',
|
|
boxWidth: '500px',
|
|
useBootstrap: false,
|
|
typeAnimated: true,
|
|
buttons: {
|
|
Batal: {
|
|
btnClass: 'btn-default',
|
|
action: function() {}
|
|
},
|
|
Jana: {
|
|
btnClass: 'btn-orange',
|
|
action: function() {
|
|
location.href = this.$target.attr('href');
|
|
$.dialog({
|
|
icon: 'fa fa-spinner fa-spin',
|
|
title: 'Dalam Proses !',
|
|
content: 'Penjanaan notis telah dimulakan. Halaman akan dikemaskini selepas proses selesai.',
|
|
closeIcon: false,
|
|
boxWidth: '500px',
|
|
useBootstrap: false,
|
|
});
|
|
}
|
|
},
|
|
}
|
|
});
|
|
|
|
@if(!empty($hasPendingExport))
|
|
setTimeout(function () {
|
|
window.location.reload();
|
|
}, 15000);
|
|
@endif
|
|
var tablenotislelong = $('#tablenotislelong').DataTable({
|
|
"columnDefs": [
|
|
{
|
|
"targets": 0,
|
|
"orderable": false
|
|
},
|
|
{
|
|
"targets": 3,
|
|
"orderable": false
|
|
}
|
|
],
|
|
order: [[1, 'asc']],
|
|
"info": false,
|
|
"lengthChange": false,
|
|
"pageLength": 15,
|
|
dom: 'Bfrtip',
|
|
});
|
|
</script>
|
|
@endsection
|