update
parent
ddc5a9ca43
commit
f824852e8f
|
|
@ -41,55 +41,58 @@
|
||||||
<form action="{{ route('modules.form.save', ['sector' => $form->sector, 'code' => $form->code]) }}" method="POST">
|
<form action="{{ route('modules.form.save', ['sector' => $form->sector, 'code' => $form->code]) }}" method="POST">
|
||||||
<input type="hidden" name="inventoryYear" value="{{ $inventoryYear }}">
|
<input type="hidden" name="inventoryYear" value="{{ $inventoryYear }}">
|
||||||
<input type="hidden" name="instansi" value="{{ $instansi }}">
|
<input type="hidden" name="instansi" value="{{ $instansi }}">
|
||||||
<div class="table-responsive mt-3" style="overflow-x: auto;">
|
@if (@request()->instansi || @$instansi)
|
||||||
<table class="table table-bordered table-detail">
|
<div class="table-responsive mt-3" style="overflow-x: auto;">
|
||||||
|
<table class="table table-bordered table-detail">
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th>#</th>
|
|
||||||
<th>No.</th>
|
|
||||||
<th>Tahun</th>
|
|
||||||
@foreach ($formDetails as $detail)
|
|
||||||
@php
|
|
||||||
$unitCode = $detail->unit_code;
|
|
||||||
$unitCategory = $unitsMap[$unitCode]->category ?? null;
|
|
||||||
@endphp
|
|
||||||
<th style="min-width: 150px; text-decoration:normal">
|
|
||||||
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }})
|
|
||||||
|
|
||||||
@if ($unitCategory)
|
|
||||||
|
|
||||||
@else
|
|
||||||
{{ $unitCode }}
|
|
||||||
@endif
|
|
||||||
</th>
|
|
||||||
@endforeach
|
|
||||||
</tr>
|
|
||||||
@php
|
|
||||||
$years = activityYearRange($inventoryYear);
|
|
||||||
@endphp
|
|
||||||
@foreach ($years as $k => $year)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="#" data-tahun="{{ $year }}" data-instansi="{{ $instansi }}" data-sector="{{ $form->sector }}" data-code="{{ $form->code }}" class="btn btn-info btn-sm edit"><i class="bx bx-pencil"></i></a></td>
|
<th>#</th>
|
||||||
<td>{{ $k+1 }}</td>
|
<th>No.</th>
|
||||||
<td>{{ $year }}</td>
|
<th>Tahun</th>
|
||||||
@foreach ($formDetails as $detail)
|
@foreach ($formDetails as $detail)
|
||||||
@php
|
@php
|
||||||
$activity_value = isset($activityFormDetails[$year])
|
$unitCode = $detail->unit_code;
|
||||||
? $activityFormDetails[$year]
|
$unitCategory = $unitsMap[$unitCode]->category ?? null;
|
||||||
->where('activity_code', $detail->activity_code)
|
|
||||||
->where('activity_unit_code', $detail->unit_code)
|
|
||||||
->first()->activity_value ?? ''
|
|
||||||
: ''
|
|
||||||
@endphp
|
@endphp
|
||||||
<td>
|
<th style="min-width: 150px; text-decoration:normal">
|
||||||
<div class="input-group">
|
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }})
|
||||||
{{ @$activity_value == "" ? "" : getFormattedValue($activity_value)}}
|
|
||||||
</div>
|
@if ($unitCategory)
|
||||||
</td>
|
|
||||||
|
@else
|
||||||
|
{{ $unitCode }}
|
||||||
|
@endif
|
||||||
|
</th>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@php
|
||||||
</table>
|
$years = activityYearRange($inventoryYear);
|
||||||
|
@endphp
|
||||||
|
@foreach ($years as $k => $year)
|
||||||
|
<tr>
|
||||||
|
<td><a href="#" data-tahun="{{ $year }}" data-instansi="{{ $instansi }}" data-sector="{{ $form->sector }}" data-code="{{ $form->code }}" class="btn btn-info btn-sm edit"><i class="bx bx-pencil"></i></a></td>
|
||||||
|
<td>{{ $k+1 }}</td>
|
||||||
|
<td>{{ $year }}</td>
|
||||||
|
@foreach ($formDetails as $detail)
|
||||||
|
@php
|
||||||
|
$activity_value = isset($activityFormDetails[$year])
|
||||||
|
? $activityFormDetails[$year]
|
||||||
|
->where('activity_code', $detail->activity_code)
|
||||||
|
->where('activity_unit_code', $detail->unit_code)
|
||||||
|
->first()->activity_value ?? ''
|
||||||
|
: ''
|
||||||
|
@endphp
|
||||||
|
<td>
|
||||||
|
<div class="input-group">
|
||||||
|
{{ @$activity_value == "" ? "" : getFormattedValue($activity_value)}}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
@endforeach
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
</form>
|
</form>
|
||||||
{{-- @include('modules.form.table') --}}
|
{{-- @include('modules.form.table') --}}
|
||||||
{{-- @include('modules.form.copy') --}}
|
{{-- @include('modules.form.copy') --}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue