664151e866
add function tangguhlelong, migrate table tangguhlelong
265 lines
11 KiB
PHP
265 lines
11 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<div class="container-fluid">
|
|
<div class="row ">
|
|
<div class="col-md-11 mx-auto card p-4">
|
|
|
|
@if ($message = Session::get('success'))
|
|
<div class="alert alert-success">
|
|
<p>{{ $message }}</p>
|
|
</div>
|
|
@endif
|
|
<form id="exportform" action="" method="POST">
|
|
<input type="hidden" name="type" value="User">
|
|
<table class="table table-striped table-xl text-center" id="tablelelong" style="width:100%">
|
|
<thead class="bg-primary text-white">
|
|
<tr>
|
|
<th>No</th>
|
|
<th>ID Lelong</th>
|
|
<th>Tarikh Lelong</th>
|
|
<th>No Rujukan</th>
|
|
<th>Tarikh Mohon / Lulus</th>
|
|
<th>Status</th>
|
|
<th class="text-center">Tindakan</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
@foreach ($tangguh as $index1=>$mohon)
|
|
@if(empty($mohon))
|
|
<tr>
|
|
</tr>
|
|
@else
|
|
<tr>
|
|
<td>{{$loop->iteration}}</td>
|
|
<td>{{ $mohon['lelong_id']}}</td>
|
|
<td>
|
|
@if($mohon['status'] == 4)
|
|
|
|
|
|
@php
|
|
$myDateTime = DateTime::createFromFormat('Y-m-d', $mohon['tdet'][0]['tarikh_lelong']);
|
|
$datez = $myDateTime->format('d-m-Y');
|
|
echo($datez);
|
|
|
|
@endphp
|
|
@else
|
|
|
|
|
|
@php
|
|
$myDateTime = DateTime::createFromFormat('Y-m-d', $mohon['tdet'][0]['t_lelong']);
|
|
$datez = $myDateTime->format('d-m-Y');
|
|
echo($datez);
|
|
|
|
@endphp
|
|
@endif
|
|
</td>
|
|
<td align = 'left'><span class="m-2">{{$mohon['norujukan']}}</span></td>
|
|
<td>{{$mohon['ditangguh_pada']}}</td>
|
|
<td>
|
|
@if($mohon['status'] == 0)
|
|
<button class="btn btn-warning btn-sm" disabled>Cwgn Baru Mohon</button>
|
|
@elseif($mohon['status'] == 1)
|
|
<button class="btn btn-warning btn-sm" disabled>Cwgn Telah Muat Naik Borang</button>
|
|
@elseif($mohon['status'] == 2)
|
|
<button class="btn btn-warning btn-sm" disabled>Operasi Telah Muat Turun Borang</button>
|
|
@elseif($mohon['status'] == 3)
|
|
<button class="btn btn-warning btn-sm" disabled>Operasi Telah Muat Naik Borang</button>
|
|
@elseif($mohon['status'] == 4)
|
|
<button class="btn btn-success btn-sm" disabled>Telah Dilulus Operasi</button>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($mohon['status'] == 0)
|
|
<button type="button" class="btn btn-outline-secondary" id="btn-upload" data-toggle="modal" data-lelongbidid="{{ $mohon['lelongbid_id'] }}" data-norujukan="{{ $mohon['norujukan'] }}" data-userid="{{ $user['user_id'] }}" data-lelongid="{{ $mohon['lelong_id'] }}" data-target="#upload">
|
|
Muat Naik Borang <i class="fas fa-file-alt"></i>
|
|
</button>
|
|
@elseif($mohon['status'] == 4)
|
|
<a href=" {{ route('tangguhlelong.cwgndownloadboranglulus', ['lelongbid_id'=>$mohon['lelongbid_id']]) }} " data-toggle="tooltip" data-placement="top" title="Muat Turun Borang"><i class="fas fa-download"></i></a>
|
|
@endif
|
|
</td>
|
|
|
|
</tr>
|
|
@endif
|
|
@endforeach
|
|
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="upload" data-backdrop="static" data-keyboard="false" role="dialog" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
|
|
<div class="modal-content text-center">
|
|
<form action="{{ route('tangguhlelong.uploadborang') }}" method="POST" id="formupload" enctype="multipart/form-data">
|
|
@csrf
|
|
|
|
<input type="hidden" name="user_id" id="user_id" />
|
|
<input type="hidden" name="lelongbid_id" id="lelongbid_id" />
|
|
<input type="hidden" name="lelong_id" id="lelong_id" />
|
|
<input type="hidden" name="norujukan" id="norujukan" />
|
|
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="exampleModalLabel">Borang Permohonan Tangguh Lelong</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="tab-content">
|
|
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="flamingo-tab">
|
|
<div class="input-group">
|
|
<div class="custom-file">
|
|
<input type="file" name="borang" id="inputGroupFile04">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-danger" onclick="funccdmbatal()">Batal</button>
|
|
<button type="submit" class="btn btn-success" >Muat Naik</button>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
//modal upload
|
|
$('#upload').on('show.bs.modal', function(event) {
|
|
var button = $(event.relatedTarget);
|
|
var lelongbidid =button.data('lelongbidid');
|
|
var norujukan =button.data('norujukan');
|
|
var lelongid =button.data('lelongid');
|
|
var userid =button.data('userid');
|
|
|
|
$('#norujukan').val(norujukan);
|
|
$('#lelongbid_id').val(lelongbidid);
|
|
$('#lelong_id').val(lelongid);
|
|
$('#user_id').val(userid);
|
|
});
|
|
|
|
//Enable tooltips everywhere
|
|
$(function () {
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
})
|
|
$('a.confirmdel').confirm({
|
|
title: 'Confirmation',
|
|
content: 'Anda pasti?',
|
|
type: 'orange',
|
|
typeAnimated: true,
|
|
buttons: {
|
|
Delete: {
|
|
btnClass: 'btn-warning',
|
|
action: function () {
|
|
location.href = this.$target.attr('href');
|
|
}
|
|
},
|
|
Batal: {
|
|
btnClass: 'btn-default',
|
|
action: function () {}
|
|
}
|
|
}
|
|
});
|
|
|
|
// var tablelelong = $('#tablelelong').DataTable({
|
|
// "columnDefs": [
|
|
// {
|
|
// "targets": 0,
|
|
// "orderable": false
|
|
// },
|
|
// {
|
|
// "targets": 7,
|
|
// "orderable": false
|
|
// }
|
|
// ],
|
|
// order: [[1, 'asc']],
|
|
// // "ordering": false,
|
|
// "info": false,
|
|
// "lengthChange": false,
|
|
// "pageLength": 99999999,
|
|
// dom: 'Bfrtip',
|
|
// buttons: [
|
|
// // 'copy', 'excel', 'pdf'
|
|
// // { text: 'copy', className: 'btn btn-primary' },
|
|
// // {
|
|
// // className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
|
|
// // text: '<i class="fas fa-plus" id="test"></i>',
|
|
// // titleAttr: 'Tambah Simulasi',
|
|
// // action: function ( e, dt, node, config ) {
|
|
// // alert( 'Button activated' );
|
|
// // }
|
|
// // },
|
|
// {
|
|
// 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();
|
|
// }
|
|
// }
|
|
// ]
|
|
// });
|
|
|
|
var tablelelong = $('#tablelelong').DataTable( {
|
|
"columnDefs": [
|
|
{
|
|
"targets": 0,
|
|
"orderable": false
|
|
},
|
|
{
|
|
"targets": 4,
|
|
"orderable": false
|
|
}
|
|
],
|
|
order: [[1, 'asc']],
|
|
// "ordering": false,
|
|
"info": false,
|
|
"lengthChange": false,
|
|
"pageLength": 15,
|
|
dom: 'Bfrtip',
|
|
// buttons: [
|
|
// // 'copy', 'excel', 'pdf'
|
|
// // { text: 'copy', className: 'btn btn-primary' },
|
|
// {
|
|
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
|
|
// text: '<i class="fas fa-plus" id="test"></i>',
|
|
// titleAttr: 'Tambah Simulasi',
|
|
// action: function ( e, dt, node, config ) {
|
|
// alert( 'Button activated' );
|
|
// }
|
|
// },
|
|
// {
|
|
// 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();
|
|
// }
|
|
// }
|
|
// ]
|
|
});
|
|
|
|
$('.addsim').tooltip();
|
|
$('.export').tooltip();
|
|
// $( '.dt-buttons').addClass('btn-group');
|
|
$( '.addsim').removeClass('dt-button');
|
|
$( '.export').removeClass('dt-button');
|
|
|
|
function selectall(cb) {
|
|
tablelelong.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
|
$(this).prop('checked', cb.checked);
|
|
})
|
|
}
|
|
</script>
|
|
|
|
@endsection
|