main
Ilham Wara Nugroho 2026-05-04 12:52:14 +07:00
parent f3caf46ee3
commit 8759d8d31f
4 changed files with 33 additions and 25 deletions

View File

@ -145,7 +145,7 @@ class LembarPengesahanController extends Controller
{ {
$request->validate([ $request->validate([
// 'file' => 'required', // 'file' => 'required',
'type' => 'required', // 'type' => 'required',
]); ]);
try { try {
@ -153,13 +153,13 @@ class LembarPengesahanController extends Controller
$ag = LembarPengesahan::find(decode_id(@$request->secure_id)); $ag = LembarPengesahan::find(decode_id(@$request->secure_id));
$ag->keterangan = $request->keterangan; $ag->keterangan = $request->keterangan;
if($request->type == 'inventory'){ // if($request->type == 'inventory'){
$ag->sektor = json_encode($request->sektor); // $ag->sektor = json_encode($request->sektor);
}elseif($request->type == 'adaptasi'){ // }elseif($request->type == 'adaptasi'){
$ag->form_id = json_encode($request->kegiatan_adaptasi); // $ag->form_id = json_encode($request->kegiatan_adaptasi);
}elseif($request->type == 'mitigasi'){ // }elseif($request->type == 'mitigasi'){
$ag->form_id = json_encode($request->kegiatan_mitigasi); // $ag->form_id = json_encode($request->kegiatan_mitigasi);
} // }
if (@$request->hasFile('file')) { if (@$request->hasFile('file')) {
$file = $request->file('file'); $file = $request->file('file');
@ -193,16 +193,16 @@ class LembarPengesahanController extends Controller
$ag->user_id = auth()->user()->id; $ag->user_id = auth()->user()->id;
$ag->agency_id = auth()->user()->ms_agency_id; $ag->agency_id = auth()->user()->ms_agency_id;
$ag->tahun = date('Y'); $ag->tahun = date('Y');
$ag->type = $request->type; // $ag->type = $request->type;
$ag->keterangan = $request->keterangan; // $ag->keterangan = $request->keterangan;
if($request->type == 'inventory'){ // if($request->type == 'inventory'){
$ag->sektor = json_encode($request->sektor); // $ag->sektor = json_encode($request->sektor);
}elseif($request->type == 'adaptasi'){ // }elseif($request->type == 'adaptasi'){
$ag->form_id = json_encode($request->kegiatan_adaptasi); // $ag->form_id = json_encode($request->kegiatan_adaptasi);
}elseif($request->type == 'mitigasi'){ // }elseif($request->type == 'mitigasi'){
$ag->form_id = json_encode($request->kegiatan_mitigasi); // $ag->form_id = json_encode($request->kegiatan_mitigasi);
} // }
if (@$request->hasFile('file')) { if (@$request->hasFile('file')) {
$file = $request->file('file'); $file = $request->file('file');

Binary file not shown.

View File

@ -15,17 +15,16 @@
<div class="col-md-12"> <div class="col-md-12">
<input type="hidden" name="secure_id" value="{{@$keyId}}"> <input type="hidden" name="secure_id" value="{{@$keyId}}">
</div> </div>
{{--
<div class="col-12 mb-3"> <div class="col-12 mb-3">
<div class="form-group"> <div class="form-group">
<label class="col-xl-12 form-label">Jenis Pengesahan</label> <label class="col-xl-12 form-label">Jenis Pengesahan</label>
<div class="col-12 "> <div class="col-12 ">
<select name="type" class="form-control select2 type" required> <select name="type" class="form-control select2 type" disabled>
<option value="">-- PILIH JENIS PENGESAHAN --</option> <option value="">-- PILIH JENIS PENGESAHAN --</option>
@foreach (getRoles() as $role) @foreach (getRoles() as $role)
<option {{@$item->type == $role->alias ? 'selected' : ''}} value="{{ $role->alias }}">{{ $role->name }}</option> <option {{@$item->type == $role->alias ? 'selected' : ''}} value="{{ $role->alias }}">{{ $role->name }}</option>
@endforeach @endforeach
{{-- <option {{@$item->type == 'mitigasi' ? 'selected' : ''}} value="mitigasi">Mitigasi</option> --}}
{{-- <option {{@$item->type == 'inventory' ? 'selected' : ''}} value="inventory">Inventory</option> --}}
</select> </select>
@error('type') @error('type')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span> <span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@ -106,11 +105,11 @@
</div> </div>
</div> </div>
</div> </div>
--}}
<?php <?php
$selectedForm = json_decode(@$item->form_id, true) ?? []; // $selectedForm = json_decode(@$item->form_id, true) ?? [];
?> ?>
{{--
<div class="col-12 mb-3 {{ @$item->type == 'adaptasi' ? '' : 'd-none' }} adaptasi"> <div class="col-12 mb-3 {{ @$item->type == 'adaptasi' ? '' : 'd-none' }} adaptasi">
<div class="form-group"> <div class="form-group">
<label class="col-xl-12 form-label">Kegiatan Adaptasi</label> <label class="col-xl-12 form-label">Kegiatan Adaptasi</label>
@ -165,6 +164,15 @@
</div> </div>
</div> </div>
</div> </div>
--}}
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label">File Lembar Pengesahan Data IGRK</label>
<div class="col-12 ">
<a href="{{ asset('assets/dokumen_pengesahan.docx') }}" class="btn btn-primary">Unduh Template</a>
</div>
</div>
</div>
<div class="col-12 mb-3"> <div class="col-12 mb-3">
<div class="form-group"> <div class="form-group">
<label class="col-xl-12 form-label">File Dokumen</label> <label class="col-xl-12 form-label">File Dokumen</label>

View File

@ -32,8 +32,8 @@
<tr> <tr>
<th data-width="15%" class="text-center" data-field="action">#</th> <th data-width="15%" class="text-center" data-field="action">#</th>
<th data-field="agency">Instansi</th> <th data-field="agency">Instansi</th>
<th data-field="type">Jenis Pengesahan</th> {{-- <th data-field="type">Jenis Pengesahan</th> --}}
<th data-field="data">Kegiatan/Sektor</th> {{-- <th data-field="data">Kegiatan/Sektor</th> --}}
<th data-field="file">File</th> <th data-field="file">File</th>
<th data-field="status">Status</th> <th data-field="status">Status</th>
</tr> </tr>