Files
2025-01-20 16:23:19 +08:00

158 lines
7.7 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container-fluid">
<div class="row ">
<div class="col mx-auto p-4">
<div class="card">
<div class="card-header header-style">
<a href="{{ route('report.lapubahmarhunlelong') }}" class="header-style-icon">
<i class="fas fa-arrow-left"></i>
</a>
<div class="header-style-title">
Senarai SAG Perubahan Marhun: {{$getpengesahan['caw_name']}}
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
</div>
@endif
<div class="table-responsive">
<table class="table table-bordered table-hover align-middle text-center" id="tablelelong" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Perubahan</th>
<th>Marhun Asal</th>
<th>Marhun Baru</th>
<th>Mutu Asal</th>
<th>Mutu Baru</th>
<th>Harga Asal</th>
<th>Harga Baru</th>
<th>Berat Asal (gm)</th>
<th>Berat Baru (gm)</th>
<th>Diminta Oleh</th>
<th>Disahkan Oleh</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@forelse($cawangan as $marhun)
<tr>
<td>{{ $loop->iteration }}</td>
<td style="white-space: nowrap;">{{ $marhun['norujukan'] }}</td>
<td style="white-space: nowrap;">
@foreach ($marhun['detailmarhun'] as $index => $item)
{{ $index + 1 }}. {{ statusUbahText($item['status_ubah']) }}<br>
@endforeach
</td>
<td>
@foreach ($marhun['detail'] as $item)
{{ $item['old_marhun'] }}<br>
@endforeach
</td>
<td style="white-space: nowrap;">
@foreach ($marhun['detailmarhun'] as $item)
@if ($item['request_marhun'])
<i class="btn fa fa-arrow-right" style="font-size: 10px"></i>
{{ $item['request_marhun'] }}
@endif
<br>
@endforeach
</td>
<td>
@foreach ($marhun['detail'] as $item)
{{ $item['old_karat'] }}<br>
@endforeach
</td>
<td style="white-space: nowrap;">
@foreach ($marhun['detailmarhun'] as $item)
@if ($item['request_karat'])
<i class="btn fa fa-arrow-right" style="font-size: 10px"></i>
{{ $item['request_karat'] }}
@endif
<br>
@endforeach
</td>
<td>
@foreach ($marhun['detail'] as $item)
{{ $item['old_harga'] }}<br>
@endforeach
</td>
<td>
@foreach ($marhun['detail'] as $item)
{{ $item['harga'] }}<br>
@endforeach
</td>
<td>
@foreach ($marhun['detail'] as $item)
{{ $item['old_berat'] }}<br>
@endforeach
</td>
<td style="white-space: nowrap;">
@foreach ($marhun['detailmarhun'] as $item)
@if ($item['request_berat'])
<i class="btn fa fa-arrow-right" style="font-size: 10px"></i>
{{ $item['request_berat'] }}
@endif
<br>
@endforeach
</td>
<td>{{ $marhun['diminta_oleh'] }}</td>
<td>{{ $marhun['disahkan_oleh'] }}</td>
<td>
<button class="btn btn-success btn-sm" disabled>BERJAYA DISAHKAN</button>
</td>
</tr>
@empty
<tr>
<td colspan="14">No Data</td>
</tr>
@endforelse
</tbody>
</table>
</div>
</div>
<div class="modal-footer mt-4"></div>
</div>
</div>
</div>
</div>
@php
function statusUbahText($statusUbah) {
switch ($statusUbah) {
case 1: return 'Mutu';
case 2: return 'Tambah Marhun';
case 3: return 'Hapus Marhun';
case 4: return 'Berat';
case 5: return 'Mutu & Berat';
case 7: return 'Marhun';
case 8: return 'Mutu, Berat & Marhun';
case 9: return 'Mutu & Marhun';
case 10: return 'Berat & Marhun';
default: return '';
}
}
@endphp
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip();
});
$('#tablelelong').DataTable({
columnDefs: [
{ targets: 0, orderable: false },
{ targets: 4, orderable: false },
],
order: [[0, 'asc']],
info: false,
lengthChange: false,
pageLength: 15,
});
</script>
@endsection