add status spatial plannings

This commit is contained in:
arifal
2025-08-19 18:15:58 +07:00
parent 71ca8dc553
commit 1b084ed485
20 changed files with 892 additions and 250 deletions

View File

@@ -91,16 +91,16 @@
</div>
<div style="position: absolute; top: 50px; left: 900px; width: 200px; height: 200px; ">
<x-custom-circle title="RAB dan Gambar" size="medium" style="background-color: #c248a7;float:left;margin-left:250px;"
<x-custom-circle title="GAMBAR" size="medium" style="background-color: #c248a7;float:left;margin-left:250px;"
visible_data="true" data_id="non-business-rab-count" data_count="0"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-business', 'year' => date('Y')]) !!}"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-business-rab', 'year' => date('Y')]) !!}"
/>
</div>
<div style="position: absolute; top: 160px; left: 900px; width: 200px; height: 200px; ">
<x-custom-circle title="KRK" size="medium" style="background-color: #295040;float:left;margin-left:250px;"
visible_data="true" data_id="non-business-krk-count" data_count="0"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-business', 'year' => date('Y')]) !!}"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'non-business-krk', 'year' => date('Y')]) !!}"
/>
</div>
@@ -114,23 +114,23 @@
</div>
<div style="position: absolute; top: 350px; left: 900px; width: 200px; height: 200px; ">
<x-custom-circle title="RAB dan Gambar" size="medium" style="background-color: #c248a7;float:left;margin-left:250px;"
<x-custom-circle title="GAMBAR" size="medium" style="background-color: #c248a7;float:left;margin-left:250px;"
visible_data="true" data_id="business-rab-count" data_count="0"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business', 'year' => date('Y')]) !!}"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business-rab', 'year' => date('Y')]) !!}"
/>
</div>
<div style="position: absolute; top: 460px; left: 900px; width: 200px; height: 200px; ">
<x-custom-circle title="KRK" size="medium" style="background-color: #1d8b1d;float:left;margin-left:250px;"
visible_data="true" data_id="business-krk-count" data_count="0"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business', 'year' => date('Y')]) !!}"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business-krk', 'year' => date('Y')]) !!}"
/>
</div>
<div style="position: absolute; top: 570px; left: 900px; width: 200px; height: 200px; ">
<x-custom-circle title="DLH" size="medium" style="background-color: #351d02;float:left;margin-left:250px;"
visible_data="true" data_id="business-dlh-count" data_count="0"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business', 'year' => date('Y')]) !!}"
document_url="{!! route('pbg-task.index') . '?' . http_build_query(['menu_id' => $menus->where('url','pbg-task.index')->first()->id, 'filter' => 'business-dlh', 'year' => date('Y')]) !!}"
/>
</div>

View File

@@ -1,5 +1,76 @@
@extends('layouts.vertical', ['subtitle' => $subtitle]) <!-- Menggunakan subtitle dari controller -->
@section('css')
<style>
.form-check.form-switch {
padding-left: 0;
.form-check-input {
width: 3.25rem;
height: 1.75rem;
border-radius: 1rem;
background-color: #dc3545; // Default to red (belum terbit)
border: none;
transition: all 0.3s ease;
position: relative;
cursor: pointer;
margin-left: 0;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
&:checked {
background-color: #28a745; // Green when checked (sudah terbit)
box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}
&:focus {
box-shadow: 0 0 0 0.2rem rgba(93, 135, 255, 0.25);
outline: none;
}
&::before {
content: "";
position: absolute;
top: 0.125rem;
left: 0.125rem;
width: 1.5rem;
height: 1.5rem;
background-color: #fff;
border-radius: 50%;
transition: all 0.3s ease;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
z-index: 1;
}
&:checked::before {
transform: translateX(1.5rem);
}
}
.form-check-label {
margin-left: 1rem;
cursor: pointer;
padding-left: 0;
.status-text {
font-weight: 600;
font-size: 1rem;
color: #2c3e50;
transition: color 0.3s ease;
}
small {
font-size: 0.85rem;
margin-top: 0.25rem;
line-height: 1.3;
}
}
}
</style>
@endsection
@section('content')
@include('layouts.partials/page-title', ['title' => $title, 'subtitle' => $subtitle]) <!-- Menggunakan title dan subtitle dari controller -->
@@ -38,38 +109,83 @@
<div class="row">
@foreach($fields as $field => $label)
<div class="col-md-6 form-group mb-3">
<label for="{{ $field }}">{{ $label }}</label>
@php
$fieldType = $fieldTypes[$field] ?? 'text'; // Default text jika tidak ditemukan tipe
@endphp
@if($field == 'is_terbit')
<!-- Special handling for is_terbit toggle -->
<div class="col-md-6 form-group mb-3">
<label class="form-label">{{ $label }}</label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="is_terbit" name="is_terbit" value="1"
{{ old('is_terbit', isset($modelInstance) && $modelInstance->is_terbit ? 'checked' : '') }}>
<label class="form-check-label" for="is_terbit">
<span class="status-text">{{ old('is_terbit', isset($modelInstance) && $modelInstance->is_terbit) ? 'Sudah Terbit' : 'Belum Terbit' }}</span>
<small class="text-muted d-block">
{{ old('is_terbit', isset($modelInstance) && $modelInstance->is_terbit) ? 'Status PBG sudah diterbitkan' : 'Status PBG belum diterbitkan' }}
</small>
</label>
</div>
<!-- Hidden input to ensure false value is sent when unchecked -->
<input type="hidden" name="is_terbit" value="0">
</div>
@elseif($field == 'calculated_retribution' && isset($modelInstance))
<!-- Special handling for calculated retribution (read-only) -->
<div class="col-md-6 form-group mb-3">
<label class="form-label">{{ $label }}</label>
<div class="form-control bg-light" readonly>
<strong class="text-success">{{ $modelInstance->formatted_retribution ?? '0' }}</strong>
</div>
<small class="text-muted">
Rumus: LUAS LAHAN × BCR (decimal) × HARGA SATUAN<br>
Detail: {{ $modelInstance->land_area ?? 0 }} × {{ ($modelInstance->site_bcr ?? 0) / 100 }} ×
<strong class="{{ $modelInstance->is_business_type ? 'text-success' : 'text-primary' }}">
{{ $modelInstance->is_business_type ? 'Rp 44.300 (USAHA)' : 'Rp 16.000 (NON USAHA)' }}
</strong>
</small>
</div>
@elseif($field == 'business_type_info' && isset($modelInstance))
<!-- Business type information (read-only) -->
<div class="col-md-6 form-group mb-3">
<label class="form-label">Jenis Usaha</label>
<div class="form-control bg-light" readonly>
<span class="badge {{ $modelInstance->is_business_type ? 'bg-success' : 'bg-primary' }}">
{{ $modelInstance->is_business_type ? 'USAHA' : 'NON USAHA' }}
</span>
</div>
<small class="text-muted">Terdeteksi otomatis dari fungsi bangunan: "{{ $modelInstance->building_function ?? $modelInstance->activities ?? 'N/A' }}"</small>
</div>
@else
<div class="col-md-6 form-group mb-3">
<label for="{{ $field }}">{{ $label }}</label>
@php
$fieldType = $fieldTypes[$field] ?? 'text'; // Default text jika tidak ditemukan tipe
@endphp
@if($fieldType == 'textarea')
<textarea id="{{ $field }}" name="{{ $field }}" class="form-control">{{ old($field, isset($modelInstance) ? $modelInstance->{$field} : '') }}</textarea>
@elseif($fieldType == 'select' && isset($dropdownOptions[$field]))
<select id="{{ $field }}" name="{{ $field }}" class="form-control">
@foreach($dropdownOptions[$field] as $code => $name)
@php
// $selectedValue = old($field, $modelInstance->{$field});
$selectedValue = old($field, $modelInstance->$field ?? '');
$isSelected = strval($selectedValue) === strval($code);
@endphp
<option value="{{ $code }}" class="{{ $isSelected ? 'selected' : '' }}" {{ $isSelected ? 'selected' : '' }}>
{{ $name }}
</option>
@endforeach
</select>
@elseif($fieldType == 'combobox' && isset($dropdownOptions[$field]))
<input class="form-control" list="{{ $field }}Options" id="{{ $field }}" name="{{ $field }}"
value="{{ old($field, isset($modelInstance) ? $modelInstance->{$field} : '') }}" placeholder="Type to search..." oninput="fetchOptions('{{ $field }}')">
<datalist id="{{ $field }}Options"></datalist>
@elseif($fieldType == 'date')
<input type="date" id="{{ $field }}" name="{{ $field }}" class="form-control"
value="{{ old($field, isset($modelInstance) && $modelInstance->{$field} ? \Carbon\Carbon::parse($modelInstance->{$field})->format('Y-m-d') : '') }}">
@else
<input type="{{ $fieldType }}" id="{{ $field }}" name="{{ $field }}" class="form-control" value="{{ old($field, isset($modelInstance) ? $modelInstance->{$field} : '') }}">
@endif
</div>
@if($fieldType == 'textarea')
<textarea id="{{ $field }}" name="{{ $field }}" class="form-control">{{ old($field, isset($modelInstance) ? $modelInstance->{$field} : '') }}</textarea>
@elseif($fieldType == 'select' && isset($dropdownOptions[$field]))
<select id="{{ $field }}" name="{{ $field }}" class="form-control">
@foreach($dropdownOptions[$field] as $code => $name)
@php
// $selectedValue = old($field, $modelInstance->{$field});
$selectedValue = old($field, $modelInstance->$field ?? '');
$isSelected = strval($selectedValue) === strval($code);
@endphp
<option value="{{ $code }}" class="{{ $isSelected ? 'selected' : '' }}" {{ $isSelected ? 'selected' : '' }}>
{{ $name }}
</option>
@endforeach
</select>
@elseif($fieldType == 'combobox' && isset($dropdownOptions[$field]))
<input class="form-control" list="{{ $field }}Options" id="{{ $field }}" name="{{ $field }}"
value="{{ old($field, isset($modelInstance) ? $modelInstance->{$field} : '') }}" placeholder="Type to search..." oninput="fetchOptions('{{ $field }}')">
<datalist id="{{ $field }}Options"></datalist>
@elseif($fieldType == 'date')
<input type="date" id="{{ $field }}" name="{{ $field }}" class="form-control"
value="{{ old($field, isset($modelInstance) && $modelInstance->{$field} ? \Carbon\Carbon::parse($modelInstance->{$field})->format('Y-m-d') : '') }}">
@else
<input type="{{ $fieldType }}" id="{{ $field }}" name="{{ $field }}" class="form-control" value="{{ old($field, isset($modelInstance) ? $modelInstance->{$field} : '') }}">
@endif
</div>
@endif
@endforeach
</div>

View File

@@ -73,10 +73,7 @@
<div class="col-lg-4 col-md-4 mb-2">
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary btn-sm py-2 fw-semibold shadow-sm">
<i class="fas fa-filter me-1"></i>Terapkan
</button>
<button type="button" id="reset-filter" class="btn btn-outline-secondary btn-sm py-2 fw-semibold">
<i class="fas fa-undo me-1"></i>Reset
Terapkan
</button>
</div>
</div>