update perubahan lelong

This commit is contained in:
BTMS2
2025-01-20 16:23:19 +08:00
parent c0d396d87a
commit bdd4beb8b1
7 changed files with 199 additions and 189 deletions
+130 -150
View File
@@ -14,164 +14,144 @@
</div>
</div>
<div class="card-body">
@if ($message = Session::get('success'))
<div class="alert alert-success">
<p>{{ $message }}</p>
@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>
@endif
<table class='table text-center table-bordered table-hover' 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>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;">
@php
$count = 1;
@endphp
@foreach ($marhun['detailmarhun'] as $item)
{{ $count++ }}.
@if($item['status_ubah'] == 1)
Mutu
@elseif($item['status_ubah'] == 2)
Tambah Marhun
@elseif($item['status_ubah'] == 3)
Hapus Marhun
@elseif($item['status_ubah'] == 4)
Berat
@elseif($item['status_ubah'] == 5)
Mutu & Berat
@elseif($item['status_ubah'] == 7)
Marhun
@elseif($item['status_ubah'] == 8)
Mutu, Berat & Marhun
@elseif($item['status_ubah'] == 9)
Mutu & Marhun
@elseif($item['status_ubah'] == 10)
Berat & Marhun
@endif
<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'] == null)
@else
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif {{$item['request_marhun']}}<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'] == null)
@else
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif{{$item['request_karat']}}<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'] == null)
@else
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif{{$item['request_berat']}}<br>
@endforeach</td>
<td>{{ $marhun['diminta_oleh'] }}</td>
<td>{{ $marhun['disahkan_oleh'] }}</td>
<td><button class="btn btn-success btn-sm hovernone-success" disabled>BERJAYA DISAHKAN</button></td>
</tr>
@empty
<tr>
<td colspan="12">No Data</td>
</tr>
@endforelse
</tbody>
</table>
<div class="modal-footer" style="margin-top:2%;">
<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>
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
var tablelelong = $('#tablelelong').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 4,
"orderable": false
}
],
order: [[0, '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();
// }
// }
// ]
$('[data-toggle="tooltip"]').tooltip();
});
// $('.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);
// })
// }
$('#tablelelong').DataTable({
columnDefs: [
{ targets: 0, orderable: false },
{ targets: 4, orderable: false },
],
order: [[0, 'asc']],
info: false,
lengthChange: false,
pageLength: 15,
});
</script>
@endsection
@@ -124,6 +124,8 @@ tr:nth-child(even) {
<th align="left">Marhun Baru</th>
<th align="center">Mutu Asal</th>
<th align="center">Mutu Baru</th>
<th align="center">Harga Asal</th>
<th align="center">Harga Baru</th>
<th align="right">Berat Asal (gm)</th>
<th align="right">Berat Baru (gm)</th>
<th align="left">Diminta Oleh</th>
@@ -177,6 +179,16 @@ tr:nth-child(even) {
<i class="btn fa fa-arrow-right" aria-hidden="true" style="font-size: 10px"></i>
@endif{{$item['request_karat']}}<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 align="right">@foreach ($marhun['detail'] as $item)
{{$item['old_berat']}}<br>
@endforeach</td>