update
parent
508f59a7c3
commit
96459f29a6
|
|
@ -82,6 +82,11 @@ class FormController implements HasMiddleware
|
||||||
})->get();
|
})->get();
|
||||||
|
|
||||||
// Fetch activity form and activity form details using service
|
// Fetch activity form and activity form details using service
|
||||||
|
if(request()->tahun){
|
||||||
|
$inventoryYear = request()->tahun;
|
||||||
|
}else{
|
||||||
|
$inventoryYear = request()->tahun;
|
||||||
|
}
|
||||||
$activityForm = $this->formService->getActivityForm($sector, $code, $inventoryYear, $instansi);
|
$activityForm = $this->formService->getActivityForm($sector, $code, $inventoryYear, $instansi);
|
||||||
if ($instansi == 'all') {
|
if ($instansi == 'all') {
|
||||||
$activityFormId = $activityForm->pluck('id')->toArray();
|
$activityFormId = $activityForm->pluck('id')->toArray();
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div> --}}
|
</div> --}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4 d-flex gap-2">
|
||||||
<div class="form-group d-flex justify-content-center align-items-center gap-1">
|
<div class="form-group d-flex justify-content-center align-items-center gap-1">
|
||||||
<div class="">
|
{{-- <div class="">
|
||||||
<label for="instansi">Instansi: {{ $instansi }}</label>
|
<label for="instansi">Instansi</label>
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<select name="instansi" id="instansi" class="form-control">
|
<select name="instansi" id="instansi" class="form-control" style="width: 100px!important;">
|
||||||
<option value="" selected>-- Pilih Instansi --</option>
|
<option value="" selected>-- Pilih Instansi --</option>
|
||||||
@if ($scope === \App\Enums\LingkupAksesData::ALL->value)
|
@if ($scope === \App\Enums\LingkupAksesData::ALL->value)
|
||||||
<option value="none" @if ($instansi == 'none') selected @endif>DATA
|
<option value="none" @if ($instansi == 'none') selected @endif>DATA
|
||||||
|
|
@ -33,11 +33,32 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group d-flex justify-content-center align-items-center gap-1">
|
||||||
|
{{-- <div class="">
|
||||||
|
<label for="instansi">Tahun</label>
|
||||||
|
</div> --}}
|
||||||
|
<div class="input-group">
|
||||||
|
<select name="tahun" id="inventoryYear" class="form-control" style="width: 100px!important;">
|
||||||
|
<option value="" selected>-- Pilih Tahun --</option>
|
||||||
|
@foreach ($years as $k => $year)
|
||||||
|
<option value="{{ $year }}" {{ request()->tahun == $year ? 'selected' : ''}}>
|
||||||
|
{{ $year }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8 order-md-2 d-flex gap-1 justify-content-end align-items-center flex-wrap">
|
<div class="col-md-8 order-md-2 d-flex gap-1 justify-content-end align-items-center flex-wrap">
|
||||||
<div class="form-group mb-0 mr-2 d-none">
|
<div class="form-group mb-0 mr-2 d-none">
|
||||||
@include('modules.form.approve')
|
@include('modules.form.approve')
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group mb-0 mr-2">
|
||||||
|
<a title="Tambah Data" class="btn btn-info mb-2 mb-md-0" href="{{ url($form->sector.'/'.$form->code.'/update?tahun='.request()->tahun.'&&instansi='.request()->instansi) }}"
|
||||||
|
{{ !$activityForm || $instansi === 'all' || $limitInternal ? 'disabled' : '' }}>
|
||||||
|
<i class="bx bx-pencil"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="form-group mb-0 mr-2">
|
<div class="form-group mb-0 mr-2">
|
||||||
<a title="Tambah Data" class="btn btn-primary mb-2 mb-md-0" onclick="return showCreateModal()"
|
<a title="Tambah Data" class="btn btn-primary mb-2 mb-md-0" onclick="return showCreateModal()"
|
||||||
{{ !$activityForm || $instansi === 'all' || $limitInternal ? 'disabled' : '' }}>
|
{{ !$activityForm || $instansi === 'all' || $limitInternal ? 'disabled' : '' }}>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
$internal = $internal ?? null;
|
$internal = $internal ?? null;
|
||||||
$limitInternal = ($internal !== null) && !$agencies->isNotEmpty();
|
$limitInternal = ($internal !== null) && !$agencies->isNotEmpty();
|
||||||
|
|
||||||
|
$years = activityYearRange($inventoryYear);
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<div class="card shadow-sm" data-sector="{{ $form->sector }}" data-code="{{ $form->code }}">
|
<div class="card shadow-sm" data-sector="{{ $form->sector }}" data-code="{{ $form->code }}">
|
||||||
|
|
@ -46,29 +48,44 @@
|
||||||
<table class="table table-bordered table-detail">
|
<table class="table table-bordered table-detail">
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>No</th>
|
||||||
<th>No.</th>
|
|
||||||
<th>Tahun</th>
|
<th>Tahun</th>
|
||||||
@foreach ($formDetails as $detail)
|
<th>Activity</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</tr>
|
||||||
|
@foreach ($formDetails as $k => $detail)
|
||||||
@php
|
@php
|
||||||
$unitCode = $detail->unit_code;
|
$unitCode = $detail->unit_code;
|
||||||
$unitCategory = $unitsMap[$unitCode]->category ?? null;
|
$unitCategory = $unitsMap[$unitCode]->category ?? null;
|
||||||
@endphp
|
@endphp
|
||||||
<th style="min-width: 150px; text-decoration:normal">
|
<tr>
|
||||||
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }})
|
<td>{{$k+1}}</td>
|
||||||
|
<td>{{request()->tahun}}</td>
|
||||||
@if ($unitCategory)
|
<td style="min-width: 150px; text-decoration:normal">
|
||||||
|
{{ $detail->activity ? $detail->activity->name : 'N/A' }} - ({{ $detail->unit_code }})
|
||||||
@else
|
|
||||||
{{ $unitCode }}
|
@if ($unitCategory)
|
||||||
@endif
|
|
||||||
</th>
|
@else
|
||||||
|
{{ $unitCode }}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
@php
|
||||||
|
$activity_value = isset($activityFormDetails[request()->tahun])
|
||||||
|
? $activityFormDetails[request()->tahun]
|
||||||
|
->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>
|
||||||
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
{{-- @foreach ($years as $k => $year)
|
||||||
@php
|
|
||||||
$years = activityYearRange($inventoryYear);
|
|
||||||
@endphp
|
|
||||||
@foreach ($years as $k => $year)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{{ url($form->sector.'/'.$form->code.'/update?tahun='.$year.'&&instansi='.$instansi) }}" class="btn btn-info btn-sm edit"><i class="bx bx-pencil"></i></a></td>
|
<td><a href="{{ url($form->sector.'/'.$form->code.'/update?tahun='.$year.'&&instansi='.$instansi) }}" class="btn btn-info btn-sm edit"><i class="bx bx-pencil"></i></a></td>
|
||||||
<td>{{ $k+1 }}</td>
|
<td>{{ $k+1 }}</td>
|
||||||
|
|
@ -80,7 +97,7 @@
|
||||||
->where('activity_code', $detail->activity_code)
|
->where('activity_code', $detail->activity_code)
|
||||||
->where('activity_unit_code', $detail->unit_code)
|
->where('activity_unit_code', $detail->unit_code)
|
||||||
->first()->activity_value ?? ''
|
->first()->activity_value ?? ''
|
||||||
: ''
|
: '';
|
||||||
@endphp
|
@endphp
|
||||||
<td>
|
<td>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|
@ -89,7 +106,7 @@
|
||||||
</td>
|
</td>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach --}}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue