update pemilihan team hanya surveyor atau penilai dan update form foto menggunakan camera
This commit is contained in:
@@ -195,7 +195,7 @@ class ActivityController extends Controller
|
||||
public function dataTablesForActivity(Request $request, $id)
|
||||
{
|
||||
// Query Penilaian dengan relasi yang diperlukan
|
||||
$query = Penilaian::with(['permohonan', 'permohonan.debiture', 'permohonan.tujuanPenilaian'])
|
||||
$query = Penilaian::with(['permohonan', 'permohonan.debiture', 'permohonan.tujuanPenilaian', 'permohonan.debiture.documents.jenisJaminan'])
|
||||
->where(function($q) use ($id) {
|
||||
$q->where('surveyor_id', $id)
|
||||
->orWhere('penilaian_id', $id)
|
||||
|
||||
@@ -222,7 +222,8 @@ class PenilaianController extends Controller
|
||||
|
||||
|
||||
|
||||
public function otorisator(Request $request){
|
||||
public function otorisator(Request $request)
|
||||
{
|
||||
|
||||
$type = $request->route('type');
|
||||
$header = '';
|
||||
@@ -248,7 +249,8 @@ class PenilaianController extends Controller
|
||||
return view('lpj::penilaian.otorisator.index', compact('header'));
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
public function show($id)
|
||||
{
|
||||
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
|
||||
@@ -32,9 +32,14 @@ use Modules\Lpj\Models\Denah;
|
||||
use Modules\Lpj\Models\FotoJaminan;
|
||||
use Modules\Lpj\Models\Lingkungan;
|
||||
use Modules\Lpj\Models\LantaiUnit;
|
||||
use Modules\Lpj\Models\Lantai;
|
||||
use Modules\Lpj\Models\ViewUnit;
|
||||
use Modules\Lpj\Models\ObjekJaminan;
|
||||
use Modules\Lpj\Models\RuteJaminan;
|
||||
use Modules\Lpj\Models\AnalisaUnit;
|
||||
use Modules\Lpj\Models\GolonganMasySekitar;
|
||||
use Modules\Lpj\Models\TingkatKeramaian;
|
||||
use Modules\Lpj\Models\LaluLintasLokasi;
|
||||
use Modules\Lpj\Models\SpekBagunanAnalisaDetail;
|
||||
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||
@@ -552,6 +557,8 @@ class SurveyorController extends Controller
|
||||
{
|
||||
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
|
||||
|
||||
|
||||
|
||||
$branches = Branch::all();
|
||||
$provinces = Province::all();
|
||||
|
||||
@@ -570,6 +577,11 @@ class SurveyorController extends Controller
|
||||
$spekBangunan = SpekBangunan::all();
|
||||
$saranaPelengkap = SaranaPelengkap::all();
|
||||
$arahMataAngin = ArahMataAngin::all();
|
||||
$lantai = Lantai::all();
|
||||
$viewUnit = ViewUnit::all();
|
||||
$golMasySekitar = GolonganMasySekitar::all();
|
||||
$tingkatKeramaian = TingkatKeramaian::all();
|
||||
$laluLintasLokasi = LaluLintasLokasi::all();
|
||||
|
||||
|
||||
$analisa = Analisa::with('analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
|
||||
@@ -597,6 +609,12 @@ class SurveyorController extends Controller
|
||||
'spekBangunan',
|
||||
'saranaPelengkap',
|
||||
'arahMataAngin',
|
||||
'lantai',
|
||||
'viewUnit',
|
||||
'golMasySekitar',
|
||||
'tingkatKeramaian',
|
||||
'laluLintasLokasi'
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
@@ -625,10 +643,6 @@ class SurveyorController extends Controller
|
||||
$provinces = Province::all();
|
||||
|
||||
$fotoJaminan = FotoJaminan::with(['objekJaminan', 'lantaiUnit' ,'ruteJaminan', 'lingkungan'])->where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
|
||||
// return response()->json([
|
||||
// 'data' => $fotoJaminan,
|
||||
// ]);
|
||||
return view('lpj::surveyor.components.foto', compact('permohonan', 'surveyor', 'branches', 'provinces', 'fotoJaminan'));
|
||||
}
|
||||
|
||||
@@ -658,25 +672,18 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function getHeader(string $type): array
|
||||
{
|
||||
return self::HEADERS[$type] ?? [];
|
||||
}
|
||||
|
||||
public function data(Request $request)
|
||||
{
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
|
||||
$header = $this->getHeader($request->route('type'));
|
||||
return view('lpj::surveyor.data.index', compact('header'));
|
||||
}
|
||||
|
||||
@@ -684,21 +691,9 @@ class SurveyorController extends Controller
|
||||
public function createData($type)
|
||||
{
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
return view('lpj::surveyor.data.form', compact('header'));
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
$header = $this->getHeader($type);
|
||||
return view('lpj::surveyor.data.form', compact('header','spekKategoriBagunan'));
|
||||
}
|
||||
|
||||
|
||||
@@ -710,30 +705,21 @@ class SurveyorController extends Controller
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
if (!$modelClass) {
|
||||
return redirect()
|
||||
->route('basicdata.'. $type .'.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
$data = $request->all();
|
||||
$data['status'] = true;
|
||||
if($type == 'spek-bangunan') {
|
||||
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$data = array_merge($validate, ['status' => true]);
|
||||
$modelClass::create($data);
|
||||
|
||||
return redirect()
|
||||
@@ -757,6 +743,9 @@ class SurveyorController extends Controller
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class],
|
||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::class],
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit', Lantai::class],
|
||||
'view-unit' => ['View Unit', 'view-unit', ViewUnit::class],
|
||||
'gol-mas-sekitar' => ['Golongan Masyarakat Sekitar', 'gol-mas-sekitar', GolonganMasySekitar::class],
|
||||
];
|
||||
|
||||
|
||||
@@ -769,7 +758,13 @@ class SurveyorController extends Controller
|
||||
$header = $dataMap[$type] ?? '';
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
return view('lpj::surveyor.data.form', compact('header', 'model'));
|
||||
if ($type == 'spek-bangunan') {
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return view('lpj::surveyor.data.form', compact('header', 'model','spekKategoriBagunan'));
|
||||
}
|
||||
|
||||
|
||||
@@ -777,26 +772,22 @@ class SurveyorController extends Controller
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
];
|
||||
if($type == 'spek-bangunan') {
|
||||
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||
|
||||
}
|
||||
|
||||
// Check if the provided type exists in the modelClasses
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
if (!$modelClass) {
|
||||
return redirect()
|
||||
->route('basicdata.' . $type . '.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
$modelClass = $modelClasses[$type];
|
||||
|
||||
|
||||
|
||||
$model = $modelClass::findOrFail($id);
|
||||
$model->update($validate);
|
||||
|
||||
@@ -817,8 +808,6 @@ class SurveyorController extends Controller
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
|
||||
$models = [
|
||||
'Bentuk Tanah' => BentukTanah::class,
|
||||
'Kontur Tanah' => KonturTanah::class,
|
||||
@@ -828,9 +817,14 @@ class SurveyorController extends Controller
|
||||
'Jenis Bangunan' => JenisBangunan::class,
|
||||
'Kondisi Bangunan' => KondisiBangunan::class,
|
||||
'Sifat Bangunan' => SifatBangunan::class,
|
||||
// 'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||
// 'Spek Bangunan' => SpekBangunan::class,
|
||||
'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||
'Spek Bangunan' => SpekBangunan::class,
|
||||
'Sarana Pelengkap' => SaranaPelengkap::class,
|
||||
'Lalu Lintas Depan Lokasi' => LaluLintasLokasi::class,
|
||||
'Tingkat Keramaian' => TingkatKeramaian::class,
|
||||
'Golongan Masyarakat Sekitar' => GolonganMasySekitar::class,
|
||||
'Lantai Unit' => Lantai::class,
|
||||
'View Unit' => ViewUnit::class,
|
||||
];
|
||||
|
||||
|
||||
@@ -840,8 +834,6 @@ class SurveyorController extends Controller
|
||||
throw new InvalidArgumentException("Invalid type: $type");
|
||||
}
|
||||
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
@@ -897,24 +889,13 @@ class SurveyorController extends Controller
|
||||
{
|
||||
try {
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
if (!$modelClass) {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
$model->delete();
|
||||
@@ -948,6 +929,47 @@ class SurveyorController extends Controller
|
||||
->findOrFail($id);
|
||||
}
|
||||
|
||||
public function submitSurveyor(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
]);
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('success', 'form surveyor submitted successfully');
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function getModelClass(string $type): ?string
|
||||
{
|
||||
return $this->modelClasses[$type] ?? null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private $modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
'lalu-lintas-lokasi' => LaluLintasLokasi::class,
|
||||
'tingkat-keramaian' => TingkatKeramaian::class,
|
||||
'gol-mas-sekitar' => GolonganMasySekitar::class,
|
||||
'spek-kategori-bangunan' => SpekKategoritBangunan::class,
|
||||
'lantai-unit' => Lantai::class,
|
||||
'view-unit' => ViewUnit::class,
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
private function getCommonData()
|
||||
{
|
||||
return [
|
||||
@@ -964,21 +986,34 @@ class SurveyorController extends Controller
|
||||
'spekKategoriBangunan' => SpekKategoritBangunan::all(),
|
||||
'spekBangunan' => SpekBangunan::all(),
|
||||
'saranaPelengkap' => SaranaPelengkap::all(),
|
||||
'arahMataAngin' => ArahMataAngin::all()
|
||||
'arahMataAngin' => ArahMataAngin::all(),
|
||||
'lantai' => Lantai::all(),
|
||||
'viewUnit' => ViewUnit::all(),
|
||||
'golMasySekitar' => GolonganMasySekitar::all(),
|
||||
'tingkatKeramaian' => TingkatKeramaian::all(),
|
||||
'laluLintasLokasi' => LaluLintasLokasi::all(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function submitSurveyor(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
]);
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('success', 'form surveyor submitted successfully');
|
||||
|
||||
}
|
||||
private const HEADERS = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
'lalu-lintas-lokasi' => ['Lalu Lintas Depan Lokasi', 'lalu-lintas-lokasi'],
|
||||
'tingkat-keramaian' => ['Tingkat Keramaian', 'tingkat-keramaian'],
|
||||
'gol-mas-sekitar' => ['Golongan Masyarakat Sekitar', 'gol-mas-sekitar'],
|
||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan'],
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan'],
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit'],
|
||||
'view-unit' => ['View Unit', 'view-unit'],
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -31,20 +31,26 @@ class TeamsController extends Controller
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
{
|
||||
|
||||
// cek region apakah sudah ada di tabel teams
|
||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||
$region = Regions::whereNotIn('id', $regionTeam)->get();
|
||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||
$regions = Regions::whereNotIn('id', $regionTeam)->get();
|
||||
|
||||
// cek user apakah sudah ada di tabel teams_users
|
||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||
$user = User::whereNotIn('id', $userTeam)
|
||||
->with('roles')
|
||||
->get();
|
||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||
$usersWithRole = User::whereNotIn('id', $userTeam)
|
||||
->with('roles') // Eager load roles
|
||||
->get();
|
||||
|
||||
return view('lpj::teams.form', compact('region', 'user'));
|
||||
}
|
||||
$user = $usersWithRole->filter(function ($user) {
|
||||
return $user->roles->contains(function ($role) {
|
||||
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai';
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
return view('lpj::teams.form', compact('regions', 'user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
@@ -97,12 +103,19 @@ class TeamsController extends Controller
|
||||
{
|
||||
$teams = Teams::find($id);
|
||||
|
||||
|
||||
$region = Regions::all();
|
||||
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
||||
$user = User::whereNotIn('id', $usedUsers)
|
||||
$usersWithRole = User::whereNotIn('id', $usedUsers)
|
||||
->with('roles')
|
||||
->get();
|
||||
|
||||
|
||||
$user = $usersWithRole->filter(function ($user) {
|
||||
return $user->roles->contains(function ($role) {
|
||||
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai';
|
||||
});
|
||||
});
|
||||
|
||||
// Ambil user yang sudah ada di tim ini
|
||||
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
||||
|
||||
|
||||
@@ -4,62 +4,137 @@ namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class SurveyorRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
* Table mapping for different actionszz
|
||||
*/
|
||||
public function rules()
|
||||
: array
|
||||
{
|
||||
|
||||
$action = $this->input('action');
|
||||
|
||||
$uniqueTable = [
|
||||
'bentuk-tanah' => 'bentuk_tanah',
|
||||
'kontur-tanah' => 'kontur_tanah',
|
||||
'posisi-kavling' => 'posisi_kavling',
|
||||
'ketinggian-tanah' => 'ketinggian_tanah',
|
||||
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
|
||||
'kondisi-bangunan' => 'kondisi_bangunan',
|
||||
'jenis-bangunan' => 'jenis_bangunan',
|
||||
'sifat-bangunan' => 'sifat_bangunan',
|
||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||
'lalu_lintas_lokasi' => 'lalu_lintas_lokasi',
|
||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
||||
];
|
||||
|
||||
|
||||
|
||||
$rules = [
|
||||
'name' => 'required|max:255',
|
||||
|
||||
];
|
||||
|
||||
$id = $this->route('id');
|
||||
|
||||
if ($this->method() == 'PUT' || $this->method() == 'PATCH') {
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code,' . $id;
|
||||
} else {
|
||||
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
private const TABLE_MAPPING = [
|
||||
'bentuk-tanah' => 'bentuk_tanah',
|
||||
'kontur-tanah' => 'kontur_tanah',
|
||||
'posisi-kavling' => 'posisi_kavling',
|
||||
'ketinggian-tanah' => 'ketinggian_tanah',
|
||||
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
|
||||
'kondisi-bangunan' => 'kondisi_bangunan',
|
||||
'jenis-bangunan' => 'jenis_bangunan',
|
||||
'sifat-bangunan' => 'sifat_bangunan',
|
||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||
'lalu-lintas-lokasi' => 'lalu_lintas_lokasi',
|
||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
||||
'gol-mas-sekitar' => 'gol_mas_sekitar',
|
||||
'spek-kategori-bangunan' => 'spek_kategori_bangunan',
|
||||
'spek-bangunan' => 'spek_bangunan',
|
||||
'lantai-unit' => 'lantai',
|
||||
'view-unit' => 'view_unit',
|
||||
];
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize()
|
||||
: bool
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return array_merge(
|
||||
$this->getBaseRules(),
|
||||
$this->getActionSpecificRules(),
|
||||
$this->getCodeValidationRules()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get base validation rules
|
||||
*/
|
||||
private function getBaseRules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action specific validation rules
|
||||
*/
|
||||
private function getActionSpecificRules(): array
|
||||
{
|
||||
$action = $this->input('action');
|
||||
|
||||
return match ($action) {
|
||||
'spek-bangunan' => [
|
||||
'spek_kategori_bangunan_id' => [
|
||||
'required'
|
||||
],
|
||||
],
|
||||
// Add more action specific rules here
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code validation rules
|
||||
*/
|
||||
private function getCodeValidationRules(): array
|
||||
{
|
||||
$action = $this->input('action');
|
||||
$table = self::TABLE_MAPPING[$action] ?? null;
|
||||
|
||||
if (!$table) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$rules = ['required', 'max:50'];
|
||||
|
||||
if ($this->isMethod('PUT') || $this->isMethod('PATCH')) {
|
||||
$rules[] = Rule::unique($table, 'code')->ignore($this->route('id'));
|
||||
} else {
|
||||
$rules[] = Rule::unique($table, 'code');
|
||||
}
|
||||
|
||||
return ['code' => $rules];
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom messages for validator errors.
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Nama harus diisi',
|
||||
'name.max' => 'Nama tidak boleh lebih dari 255 karakter',
|
||||
'code.required' => 'Kode harus diisi',
|
||||
'code.max' => 'Kode tidak boleh lebih dari 50 karakter',
|
||||
'code.unique' => 'Kode sudah digunakan',
|
||||
'spek_kategori_bangunan_id.required' => 'Kategori bangunan harus dipilih',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom attributes for validator errors.
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'Nama',
|
||||
'code' => 'Kode',
|
||||
'spek_kategori_bangunan_id' => 'Kategori Bangunan',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,12 @@ class GolonganMasySekitar extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'gol_mas_sekitar';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
|
||||
protected static function newFactory(): GolonganMasySekitarFactory
|
||||
{
|
||||
|
||||
23
app/Models/Lantai.php
Normal file
23
app/Models/Lantai.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\LokasiUnitFactory;
|
||||
|
||||
class Lantai extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'lantai';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'code', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_by', 'updated_by', 'deleted_by'];
|
||||
|
||||
protected static function newFactory(): LokasiUnitFactory
|
||||
{
|
||||
//return LokasiUnitFactory::new();
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ class SpekBangunan extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code','name','status','spek_kategori_bangunan_id','authorized_status'];
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class SpekKategoritBangunan extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code','name','status','authorized_status'];
|
||||
|
||||
|
||||
public function bangunan()
|
||||
|
||||
@@ -10,6 +10,7 @@ class TingkatKeramaian extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tingkat_keramaian';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
|
||||
23
app/Models/ViewUnit.php
Normal file
23
app/Models/ViewUnit.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\ViewUnitFactory;
|
||||
|
||||
class ViewUnit extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'view_unit';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'code'];
|
||||
|
||||
protected static function newFactory(): ViewUnitFactory
|
||||
{
|
||||
//return ViewUnitFactory::new();
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ return new class extends Migration
|
||||
$table->unsignedBigInteger('permohonan_id');
|
||||
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
||||
$table->string('luas');
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -18,7 +18,7 @@ return new class () extends Migration {
|
||||
|
||||
$table->string('foto_denah');
|
||||
$table->string('luas');
|
||||
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -16,7 +16,7 @@ return new class () extends Migration {
|
||||
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
||||
|
||||
$table->string('pendamping');
|
||||
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -19,6 +19,7 @@ return new class () extends Migration {
|
||||
$table->string('name');
|
||||
$table->string('foto_objek');
|
||||
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('lantai', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->boolean('status')->default(true);
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('lokasi_unit');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('view_unit', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->boolean('status')->default(true);
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('view_unit');
|
||||
}
|
||||
};
|
||||
60
module.json
60
module.json
@@ -344,7 +344,7 @@
|
||||
"roles": ["administrator", "admin"]
|
||||
},
|
||||
{
|
||||
"title": "Bentuk Tanah",
|
||||
"title": "Bentuk",
|
||||
"path": "basicdata.bentuk-tanah",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
@@ -415,8 +415,66 @@
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Lalu Lintas Sekitar",
|
||||
"path": "basicdata.lalu-lintas-lokasi",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Tingkat Keramaian",
|
||||
"path": "basicdata.tingkat-keramaian",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Masyarakat Sekitar",
|
||||
"path": "basicdata.gol-mas-sekitar",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Lantai Unit",
|
||||
"path": "basicdata.lantai-unit",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "View unit",
|
||||
"path": "basicdata.view-unit",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Spesifikasi Bangunan",
|
||||
"path": "basicdata.spek-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kategori Speksikasi Bangunan",
|
||||
"path": "basicdata.spek-kategori-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) => `${data.jenis_asset || ''}`,
|
||||
render: (item, data) => `${data.permohonan.debiture.documents.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
|
||||
@@ -280,15 +280,14 @@
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang Dilakukan oleh
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="nomor_registrasi"
|
||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input"
|
||||
type="hidden" name="jenis_penilaian_id" value="{{ $jenisPenilaian->id }}"
|
||||
>
|
||||
<input class="input" type="hidden" name="jenis_penilaian_id"
|
||||
value="{{ $jenisPenilaian->id }}">
|
||||
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $jenisPenilaian->name }}"
|
||||
readonly>
|
||||
type="text" value="{{ $jenisPenilaian->name }}" readonly>
|
||||
@error('jenis_penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
@@ -300,9 +299,7 @@
|
||||
Tim Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input"
|
||||
type="hidden" name="teams_id" value="{{ $regionName->id }}"
|
||||
>
|
||||
<input class="input" type="hidden" name="teams_id" value="{{ $regionName->id }}">
|
||||
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $regionName->name }}" readonly>
|
||||
@error('teams_id')
|
||||
@@ -311,62 +308,115 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor yang di tunjuk
|
||||
Pilih Surveyor dan Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_selection" name="surveyor_selection"
|
||||
class="tomselect input @error('surveyor_selection') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
<option value="penilai_dan_surveyor">Penilai dan Surveyor Sama</option>
|
||||
<option value="berbeda">Berbeda</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@error('surveyor_id')
|
||||
@error('surveyor_selection')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="penilaian_id" name="penilaian_id"
|
||||
class="input tomselect @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<div id="same_surveyor_penilai" class="hidden">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor dan Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor dan penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<div id="different_surveyor_penilai" class="hidden">
|
||||
|
||||
<div id="surveyorId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
<option value="pilih_dari_region">pilih dari region berdeda</option>
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="surveyorRegion" class="hidden items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Pilih Region
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Region</option>
|
||||
<option value="pilih_dari_region">Pilih dari region berdeda</option>
|
||||
</select>
|
||||
</div>
|
||||
@error('surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div id="penilaiId" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilaian_id" name="penilaian_id"
|
||||
class="input tomselect @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button type="button" id="btnPenilai" class="btn btn-light">
|
||||
<i class="ki-outline ki-notepad-edit"></i> Pilih dari region berbeda
|
||||
</button>
|
||||
</div>
|
||||
@error('penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Jadwal Kunjungan
|
||||
@@ -404,16 +454,9 @@
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -473,8 +516,51 @@
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
document.getElementById('surveyor_selection').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const sameSurveyorPenilai = document.getElementById('same_surveyor_penilai');
|
||||
const differentSurveyorPenilai = document.getElementById('different_surveyor_penilai');
|
||||
|
||||
if (selectedValue === 'penilai_dan_surveyor') {
|
||||
sameSurveyorPenilai.classList.remove('hidden');
|
||||
differentSurveyorPenilai.classList.add('hidden');
|
||||
} else if (selectedValue === 'berbeda') {
|
||||
sameSurveyorPenilai.classList.add('hidden');
|
||||
differentSurveyorPenilai.classList.remove('hidden');
|
||||
} else {
|
||||
sameSurveyorPenilai.classList.add('hidden');
|
||||
differentSurveyorPenilai.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('surveyor_id').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const surveyorRegion = document.getElementById('surveyorRegion');
|
||||
|
||||
if (selectedValue === 'pilih_dari_region') {
|
||||
surveyorRegion.classList.remove('hidden');
|
||||
}else{
|
||||
surveyorRegion.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function handleRegionBerbeda(params) {
|
||||
const surveyor = document.getElementById('btnSurveyor');
|
||||
const penilai = document.getElementById('btnPenilai');
|
||||
const surveyorId = document.getElementById('surveyorRegion');
|
||||
|
||||
surveyor.addEventListener('click', function() {
|
||||
surveyorId.classList.add('hidden');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const revisiForm = document.getElementById('revisiForm');
|
||||
const btnSubmit = document.getElementById('btnSubmit');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('penilaian') }}
|
||||
@endsection --}}
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('otorisator.'. strtolower($header)) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@@ -86,6 +86,42 @@
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
function otorisator(){
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`permohonan/${data}`, {
|
||||
type: 'POST'
|
||||
}).then((response) => {
|
||||
swal.fire('eddited!', 'Pelaporan has been edited.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
@@ -142,6 +178,12 @@
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-success " onclick="otorisator(${data.id})">
|
||||
<i class="ki-filled ki-check-squared"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="otorisator/show/${data.id}">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<form action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
|
||||
<form id="approveForm" action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@csrf
|
||||
<div class="card-body lg:py-7.5">
|
||||
@@ -160,14 +160,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer flex justify-end">
|
||||
<button type="submit" name="status" value="preregister" class="btn btn-success">
|
||||
<button onclick="return otorisator()" type="button" name="status" value="preregister" class="btn btn-success">
|
||||
Approve
|
||||
</button>
|
||||
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
|
||||
<script>
|
||||
function otorisator(){
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
document.getElementById('approveForm').submit();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
192
resources/views/surveyor/components/alat-berat.blade.php
Normal file
192
resources/views/surveyor/components/alat-berat.blade.php
Normal file
@@ -0,0 +1,192 @@
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Nama Jalan', 'index' => 0],
|
||||
['label' => 'Perumahan/Gang', 'index' => 1],
|
||||
['label' => 'Blok/Nomor', 'index' => 2],
|
||||
['label' => 'Desa/Kelurahan', 'index' => 3],
|
||||
['label' => 'Kecamatan', 'index' => 4],
|
||||
['label' => 'Kota/Kotamadya', 'index' => 5],
|
||||
['label' => 'Provinsi', 'index' => 6]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Nomor Lambung', 'index' => 0],
|
||||
['label' => 'Model Unit', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Merk', 'index' => 3],
|
||||
['label' => 'Negara Pembuat', 'index' => 4],
|
||||
['label' => 'Tahun Pembelian', 'index' => 5],
|
||||
['label' => 'Nomor Faktur/Invoice', 'index' => 6],
|
||||
['label' => 'Nomor Kontrak Pembelian', 'index' => 7],
|
||||
['label' => 'Nama Pemilik', 'index' => 8],
|
||||
['label' => 'Alamaat Pemilik', 'index' => 9],
|
||||
['label' => 'Nomor Asuransi', 'index' => 10],
|
||||
['label' => 'Nomor Rangka', 'index' => 11],
|
||||
['label' => 'Nomor Mesin', 'index' => 12],
|
||||
['label' => 'Hour Mesin', 'index' => 13],
|
||||
['label' => 'Overhaul Mesin', 'index' => 14],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataJaminan) > 0)
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Kondisi Objek Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$kondisiObjeck = [];
|
||||
|
||||
$kondisiObjeck = [
|
||||
['label' => 'Mesin dan Panel Instrument', 'index' => 0],
|
||||
['label' => 'Fungsi mesin dan panel instrument', 'index' => 1],
|
||||
['label' => 'Interior (jok, dll)', 'index' => 2],
|
||||
['label' => 'Rangka dan Karoseri', 'index' => 3],
|
||||
['label' => 'Ban', 'index' => 4],
|
||||
['label' => 'Velg', 'index' => 5],
|
||||
['label' => 'Air Conditioner', 'index' => 6],
|
||||
['label' => 'Aksesoris Tambahan lainnya', 'index' => 7],
|
||||
['label' => 'LCD', 'index' => 8],
|
||||
['label' => 'Perlengkapan Keamanan', 'index' => 9],
|
||||
['label' => 'Asuransi', 'index' => 10],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($kondisiObjeck) > 0)
|
||||
@foreach ($kondisiObjeck as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class=" py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Unit</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -104,8 +104,8 @@
|
||||
class="input tomselect w-full @error('lantai') border-danger bg-danger-light @enderror"
|
||||
name="lantai">
|
||||
<option value="">Select Lantai</option>
|
||||
@if (isset($posisiKavling))
|
||||
@foreach ($posisiKavling as $item)
|
||||
@if (isset($lantai))
|
||||
@foreach ($lantai as $item)
|
||||
<option value="{{ $item->name }}" {{ old('lantai', isset($analisa) && optional($analisa->analisaUnit)->lantai) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -126,8 +126,8 @@
|
||||
class="input tomselect w-full @error('view') border-danger bg-danger-light @enderror"
|
||||
name="view">
|
||||
<option value="">Select View</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
@if (isset($viewUnit))
|
||||
@foreach ($viewUnit as $item)
|
||||
<option value="{{ $item->name }}" {{ old('view', isset($analisa) && optional($analisa->analisaUnit)->view) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -146,8 +146,8 @@
|
||||
class="input tomselect w-full @error('bentuk_unit') border-danger bg-danger-light @enderror"
|
||||
name="bentuk_unit">
|
||||
<option value="">Select Bentuk Unit</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
@if (isset($bentukTanah))
|
||||
@foreach ($bentukTanah as $item)
|
||||
<option value="{{ $item->name }}" {{ old('bentuk_unit', isset($analisa) && optional($analisa->analisaUnit)->bentuk_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card min-w-full">
|
||||
<div class="card min-w-full">
|
||||
@@ -120,7 +121,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('surveyor.storeFoto') }}" method="POST" class="grid gap-5"
|
||||
@@ -167,6 +167,8 @@
|
||||
}
|
||||
@endphp
|
||||
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
|
||||
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Rute Menuju Lokasi</h1>
|
||||
@@ -177,25 +179,33 @@
|
||||
|
||||
@if (isset($fotoJaminan))
|
||||
@foreach ($fotoJaminan->ruteJaminan as $item)
|
||||
|
||||
@if (isset($item->foto_rute))
|
||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<div id="inputContainerRute" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
@if (isset($item->foto_rute))
|
||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@error('foto_rute.*')
|
||||
<span class="alert text-danger text-sm">{{ $message }}</span>
|
||||
@@ -211,9 +221,17 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||
</label>
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -231,7 +249,7 @@
|
||||
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
|
||||
</div>
|
||||
@php
|
||||
@@ -267,9 +285,16 @@
|
||||
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
||||
style="width: 12rem;">
|
||||
@endif
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<textarea name="name_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]) ? str_replace($view['label'] . ': ', '', $fotoJaminan->objekJaminan[$view['index']]->name_objek) : '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -289,7 +314,7 @@
|
||||
|
||||
|
||||
<div class="flex flex-wrap gap-4 w-full">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<label class="form-label">
|
||||
<span class="form-label">Lantai</span>
|
||||
</label>
|
||||
@@ -336,10 +361,16 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Lantai 1</span>
|
||||
</label>
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -377,10 +408,16 @@
|
||||
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -401,9 +438,18 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -436,8 +482,16 @@
|
||||
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input id="inputPendamping" type="file" name="pendamping"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputPendamping" type="file" name="pendamping"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -459,11 +513,266 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal Kamera -->
|
||||
|
||||
<div class="modal fade" data-modal="true" id="cameraModal" data-backdrop="" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Ambil Foto</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true" id="closeModal">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Camera Interface -->
|
||||
<div class="modal-body">
|
||||
<div class="camera-container relative">
|
||||
<video id="video" class="w-full h-auto" autoplay playsinline></video>
|
||||
<canvas id="canvas" class="hidden w-full h-auto"></canvas>
|
||||
<canvas id="drawingCanvas" class="hidden absolute top-0 left-0 w-full h-full"></canvas>
|
||||
<div id="textOverlay" class="position-absolute top-0 left-0 w-100 h-100 pointer-events-none">
|
||||
<!-- Text elements will be added here dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer mt-2">
|
||||
<div id="cameraControls" class="flex justify-center gap-2 mt-4">
|
||||
<button id="startButton" class="btn btn-primary">
|
||||
<i class="ki-outline ki-camera"></i> Start Camera
|
||||
</button>
|
||||
<button id="takePhotoButton" class="btn btn-success" disabled>
|
||||
<i class="ki-outline ki-photograph"></i> Ambil Foto
|
||||
</button>
|
||||
<button id="switchButton" class="btn btn-info" disabled>
|
||||
<i class="ki-outline ki-arrows-circle"></i> Switch Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Editor Controls -->
|
||||
<div id="editorControls" class=" flex flex-wrap gap-2 mt-4">
|
||||
<div class="drawing-tools flex gap-2">
|
||||
|
||||
<button class="tool-btn btn btn-sm" data-tool="brush">
|
||||
<i class="ki-filled ki-brush"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="rectangle">
|
||||
<i class="ki-filled ki-frame"></i>
|
||||
</button>
|
||||
<button class="btn btn-light btn-sm tool-btn" data-tool="arrow">
|
||||
<i class="ki-duotone ki-arrow-right fs-2"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="circle">
|
||||
<i class="ki-filled ki-mouse-circle"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="text">
|
||||
<i class="ki-filled ki-text"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="drawing-settings flex gap-2">
|
||||
<input type="color" id="colorPicker" class="w-8 h-8 rounded">
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="range" id="brushSize" min="1" max="20" value="5"
|
||||
class="range range-sm">
|
||||
<span id="brushSizeValue" class="text-sm">5px</span>
|
||||
</div>
|
||||
<input type="text" id="textInput" class="input" placeholder="Enter text">
|
||||
<button type="button" class="btn btn-primary" id="confirmTextBtn">Add Text</button>
|
||||
</div>
|
||||
|
||||
<div class="history-controls flex gap-2">
|
||||
<button id="undoButton" class="btn btn-sm">
|
||||
<i class="ki-filled ki-arrows-loop"></i>
|
||||
</button>
|
||||
<button id="resetButton" class="btn btn-sm">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="final-controls flex gap-2">
|
||||
<button type="button" class="btn btn-light btn-sm" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="backButton" class="btn btn-warning btn-sm">
|
||||
<i class="ki-outline ki-arrow-left"></i> Kembali
|
||||
</button>
|
||||
<button id="saveButton" class="btn btn-success btn-sm">
|
||||
<i class="ki-outline ki-check"></i> Simpan
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('js/camera-editor.js') }}"></script>
|
||||
<script>
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
.draggable-text {
|
||||
z-index: 1000;
|
||||
}
|
||||
.draggable-text:hover {
|
||||
outline: 1px dashed #666;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Initialize camera editor
|
||||
const editor = new UniversalCameraEditor();
|
||||
|
||||
// Get all camera buttons
|
||||
const cameraButtons = document.querySelectorAll('#btnCamera');
|
||||
const modal = document.getElementById('cameraModal');
|
||||
const closeModal = document.getElementById('closeModal');
|
||||
|
||||
// Current input field to update
|
||||
let currentInputField = null;
|
||||
|
||||
// Confirm text button
|
||||
|
||||
|
||||
// Handle camera button click
|
||||
cameraButtons.forEach(button => {
|
||||
button.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const inputContainer = this.closest('.input-group');
|
||||
currentInputField = inputContainer.querySelector('input[type="file"]');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('modal-open');
|
||||
editor.startCamera();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
closeModal.addEventListener('click', function() {
|
||||
modal.classList.add('hidden');
|
||||
editor.closeCamera();
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Override save function
|
||||
editor.saveAndUpload = async function() {
|
||||
try {
|
||||
// Membuat canvas akhir
|
||||
const finalCanvas = document.createElement('canvas');
|
||||
finalCanvas.width = this.canvas.width;
|
||||
finalCanvas.height = this.canvas.height;
|
||||
const ctx = finalCanvas.getContext('2d');
|
||||
|
||||
// Menggambar foto asli dan hasil edit di canvas akhir
|
||||
ctx.drawImage(this.canvas, 0, 0);
|
||||
ctx.drawImage(this.drawingCanvas, 0, 0);
|
||||
|
||||
// Konversi canvas ke Blob dan buat file
|
||||
finalCanvas.toBlob(async (blob) => {
|
||||
const file = new File([blob], `camera_photo_${Date.now()}.jpg`, {
|
||||
type: "image/jpeg"
|
||||
});
|
||||
|
||||
// Membuat FileList dan memperbarui field input
|
||||
const dataTransfer = new DataTransfer();
|
||||
dataTransfer.items.add(file);
|
||||
|
||||
if (currentInputField) {
|
||||
currentInputField.files = dataTransfer.files;
|
||||
|
||||
// Trigger event "change" untuk memperbarui tampilan
|
||||
const event = new Event('change', {
|
||||
bubbles: true
|
||||
});
|
||||
currentInputField.dispatchEvent(event);
|
||||
|
||||
// Tampilkan preview jika container preview ada
|
||||
const previewContainer = currentInputField.closest('.input-group')
|
||||
.querySelector('.preview-container');
|
||||
if (previewContainer) {
|
||||
const img = document.createElement('img');
|
||||
img.src = URL.createObjectURL(file);
|
||||
img.className = 'w-full h-32 object-cover rounded-lg';
|
||||
previewContainer.innerHTML = ''; // Bersihkan container preview
|
||||
previewContainer.appendChild(img); // Tambah gambar preview
|
||||
}
|
||||
}
|
||||
|
||||
// Menutup modal
|
||||
const modal = document.getElementById('cameraModal');
|
||||
modal.classList.remove('show');
|
||||
modal.style.display = 'none';
|
||||
modal.setAttribute('aria-hidden', 'true');
|
||||
document.body.classList.remove('modal-open');
|
||||
|
||||
// Menghapus backdrop modal jika ada
|
||||
const backdrop = document.querySelector('.modal-backdrop');
|
||||
if (backdrop) {
|
||||
backdrop.remove();
|
||||
}
|
||||
|
||||
// Hentikan stream kamera
|
||||
if (editor.stream) {
|
||||
editor.stream.getTracks().forEach(track => track.stop());
|
||||
editor.stream = null;
|
||||
}
|
||||
|
||||
// Mengatur ulang ke kondisi awal (reset kamera)
|
||||
editor.closeCamera()
|
||||
|
||||
}, 'image/jpeg', 0.8);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error saving photo:', error);
|
||||
alert('Error saving photo. Please try again.');
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Preview for regular file input change
|
||||
document.addEventListener('change', function(e) {
|
||||
if (e.target && e.target.type === 'file') {
|
||||
const file = e.target.files[0];
|
||||
if (file && file.type.startsWith('image/')) {
|
||||
const previewContainer = e.target.closest('.input-group').querySelector('.preview-container');
|
||||
if (previewContainer) {
|
||||
const img = document.createElement('img');
|
||||
img.src = URL.createObjectURL(file);
|
||||
img.className = 'w-full h-32 object-cover rounded-lg';
|
||||
previewContainer.innerHTML = '';
|
||||
previewContainer.appendChild(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Handle escape key
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
const modal = document.getElementById('cameraModal');
|
||||
if (modal.classList.contains('modal-open')) {
|
||||
modal.classList.remove('modal-open');
|
||||
modal.classList.add('hidden');
|
||||
if (editor.stream) {
|
||||
editor.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
// Generic function to handle adding new input and delete functionality
|
||||
|
||||
@@ -139,34 +139,35 @@
|
||||
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
|
||||
|
||||
@php
|
||||
$analisaType = 'unknown';
|
||||
$data = [
|
||||
'tanah' => 'Tanah',
|
||||
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
|
||||
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
|
||||
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
|
||||
'tanah_bangunan' => 'Mall',
|
||||
];
|
||||
$analisaType = 'unknown';
|
||||
$data = [
|
||||
'tanah' => 'Tanah',
|
||||
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
|
||||
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
|
||||
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
|
||||
'tanah_bangunan' => 'Mall',
|
||||
];
|
||||
|
||||
|
||||
if (isset($analisa->id)) {
|
||||
$analisaType = $analisa->type;
|
||||
} else {
|
||||
foreach ($data as $key => $value) {
|
||||
if (isset($jenisJaminanData) &&
|
||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))) {
|
||||
$analisaType = $key;
|
||||
break;
|
||||
if (isset($analisa->id)) {
|
||||
$analisaType = $analisa->type;
|
||||
} else {
|
||||
foreach ($data as $key => $value) {
|
||||
if (
|
||||
isset($jenisJaminanData) &&
|
||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
|
||||
) {
|
||||
$analisaType = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($analisaType === 'tanah') {
|
||||
$analisaType = 'tanah_bangunan';
|
||||
}
|
||||
if ($analisaType === 'tanah') {
|
||||
$analisaType = 'kendaraan';
|
||||
}
|
||||
|
||||
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
|
||||
$analisaType = 'unit';
|
||||
}
|
||||
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
|
||||
$analisaType = 'unit';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<input type="hidden" name="action" value="{{ $analisaType }}">
|
||||
@@ -174,13 +175,15 @@
|
||||
|
||||
@if ($analisaType == 'tanah_bangunan')
|
||||
@include('lpj::surveyor.components.tanah-bangunan')
|
||||
@else
|
||||
@elseif($analisaType == 'unit')
|
||||
@include('lpj::surveyor.components.apartemen-kantor')
|
||||
@elseif($analisaType == 'kendaraan')
|
||||
@include('lpj::surveyor.components.alat-berat')
|
||||
@endif
|
||||
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-green-600 text-white py-4 px-6">
|
||||
<div class=" text-white py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -244,9 +247,9 @@
|
||||
<select
|
||||
class="input tomselect w-full @error('lalu_lintas') border-danger bg-danger-light @enderror"
|
||||
name="lalu_lintas">
|
||||
<option value="">Select PLalulintas Depan Lokasi</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
<option value="">Select Lalulintas Depan Lokasi</option>
|
||||
@if (isset($laluLintasLokasi))
|
||||
@foreach ($laluLintasLokasi as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('lalu_lintas', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lalu_lintas : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -268,8 +271,9 @@
|
||||
class="input tomselect w-full @error('gol_mas_sekitar') border-danger bg-danger-light @enderror"
|
||||
name="gol_mas_sekitar">
|
||||
<option value="">Select Golongan Hidup Sekitar</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
|
||||
@if (isset($golMasySekitar))
|
||||
@foreach ($golMasySekitar as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('gol_mas_sekitar', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->gol_mas_sekitar : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -291,8 +295,8 @@
|
||||
class="input tomselect w-full @error('tingkat_keramaian') border-danger bg-danger-light @enderror"
|
||||
name="tingkat_keramaian">
|
||||
<option value="">Select Tingkat Keramaian</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
@if (isset($tingkatKeramaian))
|
||||
@foreach ($tingkatKeramaian as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('tingkat_keramaian', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->tingkat_keramaian : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -448,7 +452,7 @@
|
||||
</div>
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class=" py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -544,9 +548,9 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container mx-auto ">
|
||||
<div class="">
|
||||
<!-- Header -->
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
|
||||
</div>
|
||||
|
||||
@@ -656,9 +660,37 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Gistaru</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute" class="file-input file-input-bordered w-full" accept="image/*">
|
||||
<button id="mod" type="button" class="btn btn-light" onclick="openModal('gistaru')">
|
||||
<i class="ki-outline ki-abstract-33"></i> Gistaru
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Bumi</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute" class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button id="mod" type="button" class="btn btn-light" onclick="openModal('bumi')">
|
||||
<i class="ki-outline ki-abstract-33"></i> Bumi
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Peta Section -->
|
||||
|
||||
<div class="mt-2" style="margin-top: 20px">
|
||||
<input type="hidden" name="lat" id="lat"
|
||||
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
|
||||
@@ -717,8 +749,68 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" data-modal="true" id="modal" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="screenshotContainer" style="height: 500px">
|
||||
<iframe id="mapFrameGis" frameborder="0" style="width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer flex justify-end">
|
||||
<button id="takeScreenshot" class="btn btn-success">Take Screenshot</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script>
|
||||
function getMap(params) {
|
||||
const iframe = document.getElementById('mapFrameGis');
|
||||
const maps = [
|
||||
'https://gistaru.atrbpn.go.id/rtronline/',
|
||||
'https://bhumi.atrbpn.go.id/peta'
|
||||
];
|
||||
|
||||
iframe.src = maps[params];
|
||||
}
|
||||
|
||||
function openModal(type) {
|
||||
const modal = document.getElementById('mod');
|
||||
modal.setAttribute('data-modal-toggle', '#modal');
|
||||
|
||||
getMap(type === 'gistaru' ? 0 : 1);
|
||||
}
|
||||
|
||||
document.getElementById('takeScreenshot').addEventListener('click', () => {
|
||||
const screenshotContainer = document.getElementById('screenshotContainer');
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = screenshotContainer.offsetWidth;
|
||||
canvas.height = screenshotContainer.offsetHeight;
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(document.getElementById('mapFrame'), 0, 0, canvas.width, canvas.height);
|
||||
const dataURL = canvas.toDataURL('image/jpeg');
|
||||
|
||||
// Tampilkan gambar di atas input
|
||||
const inputRute = document.getElementById('inputRute');
|
||||
const img = document.createElement('img');
|
||||
img.src = dataURL;
|
||||
img.style.maxWidth = '100%';
|
||||
img.style.maxHeight = '200px';
|
||||
inputRute.parentNode.insertBefore(img, inputRute);
|
||||
|
||||
// Isi input dengan data URL gambar
|
||||
inputRute.value = dataURL;
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
<script>
|
||||
// Fungsi untuk mengambil lokasi pengguna
|
||||
function getUserLocation() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Tanah</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@@ -33,7 +33,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $model->code ?? '' }}" >
|
||||
name="code" value="{{ $model->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
@@ -51,6 +51,41 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (isset($header[1]) && $header[1] == 'spek-bangunan')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kategori
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('spek_kategori_bangunan_id') border-danger bg-danger-light @enderror"
|
||||
name="spek_kategori_bangunan_id">
|
||||
<option value="">Select Kategori Bangunan</option>
|
||||
@if (isset($spekKategoriBagunan))
|
||||
@foreach ($spekKategoriBagunan as $item)
|
||||
@if (isset($model->spek_kategori_bangunan_id))
|
||||
<option value="{{ $model->spek_kategori_bangunan_id }}"
|
||||
{{ $model->spek_kategori_bangunan_id == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $item->id }}"
|
||||
{{ old('spek_kategori_bangunan_id') == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('spek_kategori_bangunan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('surveyor.bentuk-tanah') }}
|
||||
@endsection --}}
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.' . $header[1]) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
@endforeach
|
||||
</option>
|
||||
@else
|
||||
|
||||
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
||||
|
||||
@foreach ($users->roles as $role)
|
||||
|
||||
@@ -489,3 +489,75 @@ Breadcrumbs::for('otorisator.pelaporan.index', function (BreadcrumbTrail $trail)
|
||||
$trail->parent('otorisator');
|
||||
$trail->push('Otorisator', route('otorisator.pelaporan.index'));
|
||||
});
|
||||
|
||||
|
||||
// basic data surveyor
|
||||
$basicDataRoutes = [
|
||||
'bentuk-tanah' => 'Bentuk Tanah',
|
||||
'kontur-tanah' => 'Kontur Tanah',
|
||||
'posisi-kavling' => 'Posisi Kavling',
|
||||
'ketinggian-tanah' => 'Ketinggian Tanah',
|
||||
'kondisi-fisik-tanah' => 'Kondisi Fisik Tanah',
|
||||
'jenis-bangunan' => 'Jenis Bangunan',
|
||||
'kondisi-bangunan' => 'Kondisi Bangunan',
|
||||
'sifat-bangunan' => 'Sifat Bangunan',
|
||||
'spek-bangunan' => 'Speksifikasi Bangunan',
|
||||
'spek-kategori-bangunan' => 'Speksifikasi Kategori Bangunan',
|
||||
'sarana-pelengkap' => 'Sarana Pelengkap',
|
||||
'lalu-lintas-lokasi' => 'Lalu Lintas',
|
||||
'tingkat-keramaian' => 'Tingkat Keramaian',
|
||||
'gol-mas-sekitar' => 'Golongan Masyarakat Sekitar',
|
||||
'lantai-unit' => 'Lantai Unit',
|
||||
'view-unit' => 'View Unit',
|
||||
'bentuk-unit' => 'Bentuk unit',
|
||||
];
|
||||
|
||||
|
||||
foreach ($basicDataRoutes as $route => $title) {
|
||||
Breadcrumbs::for("basicdata.{$route}", function (BreadcrumbTrail $trail) use ($route, $title) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push($title, route("basicdata.{$route}.index"));
|
||||
});
|
||||
}
|
||||
|
||||
Breadcrumbs::for('basicdata.createData', function (BreadcrumbTrail $trail, $type = null) {
|
||||
$trail->parent('basicdata');
|
||||
|
||||
if ($type) {
|
||||
|
||||
$title = $basicDataRoutes[$type] ?? ucwords(str_replace('-', ' ', $type));
|
||||
$trail->push("Tambah $title");
|
||||
} else {
|
||||
$trail->push("Tambah Data");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('basicdata.editData', function (BreadcrumbTrail $trail, $type = null) {
|
||||
$trail->parent('basicdata');
|
||||
|
||||
if ($type) {
|
||||
|
||||
$title = $basicDataRoutes[$type] ?? ucwords(str_replace('-', ' ', $type));
|
||||
$trail->push("Edit $title");
|
||||
} else {
|
||||
$trail->push("Edit Data");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// otorisator surveyor
|
||||
$otorisatorSurveyor = [
|
||||
'pelaporan' => 'Pelaporan',
|
||||
'pembayaran' => 'Pembayaran',
|
||||
'pembayaran' => 'Pembayaran'
|
||||
];
|
||||
|
||||
foreach ($otorisatorSurveyor as $route => $title) {
|
||||
Breadcrumbs::for("otorisator.{$route}", function (BreadcrumbTrail $trail) use ($route, $title) {
|
||||
|
||||
$trail->push($title, route("otorisator.{$route}.index"));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -374,9 +374,15 @@ Route::middleware(['auth'])->group(function () {
|
||||
'jenis-bangunan' => 'Jenis Bangunan',
|
||||
'kondisi-bangunan' => 'Kondisi Bangunan',
|
||||
'sifat-bangunan' => 'Sifat Bangunan',
|
||||
// 'spek-bangunan' => 'Speksifikasi Bangunan',
|
||||
// 'spek-kategori-bagunan' => 'Speksifikasi Kategori Bangunan',
|
||||
'spek-bangunan' => 'Speksifikasi Bangunan',
|
||||
'spek-kategori-bangunan' => 'Speksifikasi Kategori Bangunan',
|
||||
'sarana-pelengkap' => 'Sarana Pelengkap',
|
||||
'lalu-lintas-lokasi' => 'Lalu Lintas',
|
||||
'tingkat-keramaian' => 'Tingkat Keramaian',
|
||||
'gol-mas-sekitar' => 'Golongan Masyarakat Sekitar',
|
||||
'lantai-unit' => 'Lantai Unit',
|
||||
'view-unit' => 'View Unit',
|
||||
'bentuk-unit' => 'Bentuk unit',
|
||||
];
|
||||
|
||||
foreach ($headers as $type => $header) {
|
||||
|
||||
Reference in New Issue
Block a user