Select sag to serah from penilai to khazanah

This commit is contained in:
Amir
2023-02-15 13:57:31 +08:00
parent 713a04fc4d
commit 923429b0ea
2 changed files with 110 additions and 85 deletions
+1 -1
View File
@@ -1725,7 +1725,7 @@ class MarhunController extends Controller
$user = Auth::user();
$current = Carbon::now();
foreach ($request->scanKeluar_id as $index) {
foreach (json_decode($request->scanKeluar_id) as $index) {
$terimaMarhun = ScanSemak::where('id', '=', $index)->first();
$terimaMarhun->penilai_id = $user->id;
$terimaMarhun->terima_marhun = $current->toDateTimeString();
@@ -17,11 +17,11 @@
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert mt-2 alert-success">
<p>{{ $message }}</p>
{{ $message }}
</div>
@elseif ($message = Session::get('failed'))
<div class="alert mt-2 alert-danger">
<p>{{ $message }}</p>
{{ $message }}
</div>
@endif
{{-- <a href="{{route('marhun.senarailelongterimaserah')}}" class="btn mb-2 btn-secondary">Kembali</a> --}}
@@ -40,117 +40,104 @@
<div class="tab-pane fade show active" id="belum-diterima" role="tabpanel" aria-labelledby="belum-diterima-tab">
<form action="{{ route('marhun.terimamarhun') }}" method="POST">
@csrf
<input type="hidden" name="scanKeluar_id" value="{{ json_encode($senaraiScanKeluar->pluck('id')->toArray()) }}">
<table class='table table-bordered table-hover' id='table-belum-diterima'>
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh/Masa Scan Keluar</th>
<th>Status</th>
<th class="text-center">Status</th>
</tr>
</thead>
<tbody>
{{-- @foreach($senaraiScanKeluar as $index) --}}
@forelse($senaraiScanKeluar as $index)
<input type="hidden" name="scanKeluar_id[]" value="{{$index->id}}">
@foreach($senaraiScanKeluar as $index)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$index->norujukan}}</td>
<td>{{$index->scan_keluar}}</td>
<td><span class="badge badge-pill badge-danger">Belum Terima</span></td>
<td class="text-center"><span class="badge badge-danger">Belum Terima</span></td>
</tr>
@empty
<tr>
<td colspan="4">No Data</td>
</tr>
@endforelse
{{-- @endforeach --}}
@endforeach
</tbody>
</table>
@if ($senaraiScanKeluar->isNotEmpty())
<div class="d-flex mt-2 justify-content-end">
<button type="submit" class="btn btn-primary">Terima Marhun</button>
<button type="submit" class="btn btn-primary btn-sm">Terima Marhun</button>
</div>
@endif
</form>
</div>
<div class="tab-pane fade" id="sedang-dinilai" role="tabpanel" aria-labelledby="sedang-dinilai-tab">
<form action="{{ route('marhun.serahmarhun') }}" method="POST">
@csrf
<input type="hidden" name="test" value="essds">
<table class='table table-bordered table-hover' id='table-sedang-dinilai'>
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh/Masa Scan Keluar</th>
<th>Tarikh/Masa Terima Marhun</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@forelse($sedangDinilai as $index)
<input type="hidden" name="sedangDinilai_id[]" value="{{$index->id}}">
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$index->norujukan}}</td>
<td>{{$index->scan_keluar}}</td>
<td>{{$index->terima_marhun}}</td>
@if (isset($index['sdhdisemak']['status_semak']))
@if(($index['sdhdisemak']['status_semak']) == 1)
<td><span class="badge badge-pill badge-success">Telah Dinilai</span></td>
@else
<td><a href="{{route('marhun.show',[$index->lelongbid_id, $index->lelong_id])}}"><span class="badge badge-pill badge-warning">Sedang Dinilai</span></a></td>
@endif
@else
<td><a href="{{route('marhun.show',[$index->lelongbid_id, $index->lelong_id])}}"><span class="badge badge-pill badge-warning">Sedang Dinilai</span></a></td>
@endif
</tr>
@empty
<tr>
<td colspan="4">No Data</td>
</tr>
@endforelse
</tbody>
</table>
<div style="overflow-x: auto;">
<table class='table table-bordered table-hover' id='table-sedang-dinilai'>
<thead class="bg-primary text-white">
<tr>
<th class="text-center"><input type="checkbox" id="checkall"></th>
<th class="text-center">Bil</th>
<th>No Rujukan</th>
<th>Tarikh/Masa Scan Keluar</th>
<th>Tarikh/Masa Terima Marhun</th>
<th class="text-center">Status</th>
<th class="text-center">Tindakan</th>
</tr>
</thead>
<tbody>
@forelse($sedangDinilai as $index)
<tr>
<td class="text-center"><input type="checkbox" class="checkbox" name="sedangDinilai_id[]" value="{{$index->id}}"></td>
<td class="text-center">{{$loop->iteration}}</td>
<td>{{$index->norujukan}}</td>
<td>{{$index->scan_keluar}}</td>
<td>{{$index->terima_marhun}}</td>
<td class="text-center"><span class="badge badge-warning">Sedang Dinilai</span></td>
<td class="text-center"><a class="btn btn-primary btn-sm" href="{{route('marhun.show',[$index->lelongbid_id, $index->lelong_id])}}" data-toggle="tooltip" data-placement="top" title="Semak Marhun"><i class="far fa-edit"></i></a></td>
</tr>
@empty
<tr>
<td colspan="99" class="text-center">No Data</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<div class="d-flex mt-2 justify-content-end">
<button type="submit" class="btn btn-primary">Serah Marhun</button>
<button type="submit" class="btn btn-primary btn-sm" disabled id="button-serah">Serah Marhun</button>
</div>
</form>
</div>
<div class="tab-pane fade" id="sudah-serah" role="tabpanel" aria-labelledby="sudah-serah-tab">
<div style="text-align: left;"> <a href="{{ route('marhun.cetakterimaserahmarhun', $lelong_id) }}" class="btn btn-info">Laporan Serahan Marhun Penilai</a><br></div>
<table class="table table-bordered table-hover" id="table-sudah-serah" style="width: 100%;">
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh/Masa Scan Keluar</th>
<th>Tarikh/Masa Terima Marhun</th>
<th>Tarikh/Masa Serah Marhun</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{{-- @foreach($sudahSerah as $index) --}}
@forelse($sudahSerah as $index)
<tr>
<td>{{$loop->iteration}}</td>
<td>{{$index->norujukan}}</td>
<td>{{$index->scan_keluar}}</td>
<td>{{$index->terima_marhun}}</td>
<td>{{$index->serah_marhun}}</td>
<td><span class="badge badge-pill badge-success">Sudah Serah</span></td>
</tr>
@empty
<div class="mb-2"> <a href="{{ route('marhun.cetakterimaserahmarhun', $lelong_id) }}" class="btn btn-primary btn-sm">Laporan Serahan Marhun Penilai</a><br></div>
<div style="overflow-x: auto;">
<table class="table table-bordered" id="table-sudah-serah" style="width: 100%;">
<thead class="bg-primary text-white">
<tr>
<td colspan="6">No Data</td>
<th class="text-center">Bil</th>
<th>No Rujukan</th>
<th>Tarikh/Masa Scan Keluar</th>
<th>Tarikh/Masa Terima Marhun</th>
<th>Tarikh/Masa Serah Marhun</th>
<th class="text-center">Status</th>
</tr>
@endforelse
{{-- @endforeach --}}
</tbody>
</table>
</thead>
<tbody>
@foreach($sudahSerah as $index)
<tr>
<td class="text-center">{{$loop->iteration}}</td>
<td>{{$index->norujukan}}</td>
<td>{{$index->scan_keluar}}</td>
<td>{{$index->terima_marhun}}</td>
<td>{{$index->serah_marhun}}</td>
<td class="text-center"><span class="badge badge-success">Sudah Serah</span></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@@ -160,9 +147,47 @@
</div>
<script>
// var tableBelumDiterima = $('#table-belum-diterima').DataTable({});
// var tableSedangDinilai = $('#table-sedang-dinilai').DataTable({});
// var tableSudahSerah = $('#table-sudah-serah').DataTable({});
$(function() {
$('[data-toggle="tooltip"]').tooltip()
});
$(document).ready(function() {
$("#checkall").change(function() {
var checked = $(this).is(':checked');
if (checked) {
$(".checkbox").each(function() {
$(this).prop("checked", true);
$('#button-serah').removeAttr('disabled');
});
} else {
$(".checkbox").each(function() {
$(this).prop("checked", false);
$('#button-serah').attr('disabled', true);
});
}
});
$(".checkbox").click(function() {
if ($(".checkbox").length == $(".checkbox:checked").length) {
$("#checkall").prop("checked", true);
} else {
$("#checkall").prop("checked", false);
}
if ($(this).is(':checked')) {
$('#button-serah').removeAttr('disabled');
} else if ($(".checkbox:checked").length == 0) {
$('#button-serah').attr('disabled', true);
}
});
});
var tableBelumDiterima = $('#table-belum-diterima').DataTable({
"pageLength": 100,
});
var tableSudahSerah = $('#table-sudah-serah').DataTable({
"pageLength": 100,
});
</script>
@endsection