Merge remote-tracking branch 'composer/feature/senior-officer' into staging
This commit is contained in:
@@ -35,28 +35,41 @@ class ActivityController extends Controller
|
|||||||
// Ambil user yang sedang login
|
// Ambil user yang sedang login
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
$roles = $user->load('roles');
|
$roles = $user->load('roles');
|
||||||
$regionId = null;
|
|
||||||
|
|
||||||
// Cek apakah user memiliki role 'senior officer'
|
// Inisialisasi regionId dan teamId sebagai null agar bisa dinamis
|
||||||
if ($roles->roles->pluck('name')->contains('senior officer')) {
|
$regionId = null;
|
||||||
$regionId = TeamsUsers::with('team.regions')
|
$teamId = null;
|
||||||
|
|
||||||
|
if ($roles->roles->pluck('name')->contains('senior-officer')) {
|
||||||
|
$userTeam = TeamsUsers::with('team')
|
||||||
->where('user_id', $user->id)
|
->where('user_id', $user->id)
|
||||||
->first()?->team->regions_id;
|
->first();
|
||||||
|
$regionId = $userTeam?->team->regions_id;
|
||||||
|
$teamId = $userTeam?->teams_id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions'])
|
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles'])
|
||||||
->whereHas('team', function ($q) use ($regionId) {
|
->whereHas('team', function ($q) use ($regionId, $teamId) {
|
||||||
if ($regionId) {
|
if ($regionId) {
|
||||||
$q->where('regions_id', $regionId);
|
$q->where('regions_id', $regionId);
|
||||||
}
|
}
|
||||||
|
if ($teamId) {
|
||||||
|
$q->where('id', $teamId); // Hanya tim yang sama
|
||||||
|
}
|
||||||
})
|
})
|
||||||
->where('user_id', '!=', $user->id)
|
->where('user_id', '!=', $user->id)
|
||||||
|
->whereHas('user.roles', function ($query) {
|
||||||
|
// Filter hanya peran 'surveyor' atau 'surveyor-penilai'
|
||||||
|
$query->whereIn('name', ['surveyor', 'surveyor-penilai']);
|
||||||
|
})
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return view('lpj::activity.progres_activity.index', compact('teamsActivity'));
|
return view('lpj::activity.progres_activity.index', compact('teamsActivity'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function senior()
|
public function senior()
|
||||||
{
|
{
|
||||||
return view('lpj::activity.senior_officer.index');
|
return view('lpj::activity.senior_officer.index');
|
||||||
@@ -194,14 +207,24 @@ class ActivityController extends Controller
|
|||||||
|
|
||||||
public function dataTablesForActivity(Request $request, $id)
|
public function dataTablesForActivity(Request $request, $id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||||
|
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
|
}
|
||||||
// Query Penilaian dengan relasi yang diperlukan
|
// Query Penilaian dengan relasi yang diperlukan
|
||||||
$query = Penilaian::with(['permohonan', 'permohonan.debiture', 'permohonan.tujuanPenilaian'])
|
$query = Penilaian::with([
|
||||||
->where(function($q) use ($id) {
|
'permohonan',
|
||||||
$q->where('surveyor_id', $id)
|
'permohonan.debiture',
|
||||||
->orWhere('penilaian_id', $id)
|
'permohonan.tujuanPenilaian',
|
||||||
->orWhere('penilai_surveyor_id', $id);
|
'permohonan.debiture.documents.jenisJaminan',
|
||||||
|
'userPenilai'
|
||||||
|
])
|
||||||
|
->whereHas('userPenilai', function ($q) use ($id) {
|
||||||
|
$q->where('user_id', $id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Filter pencarian
|
// Filter pencarian
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
|
|||||||
@@ -5,14 +5,18 @@ namespace Modules\Lpj\Http\Controllers;
|
|||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Modules\Lpj\Http\Requests\PenilaianRequest;
|
use Modules\Lpj\Http\Requests\PenilaianRequest;
|
||||||
use Modules\Lpj\Models\JenisPenilaian;
|
use Modules\Lpj\Models\JenisPenilaian;
|
||||||
use Modules\Lpj\Models\Penilaian;
|
use Modules\Lpj\Models\Penilaian;
|
||||||
|
use Modules\Lpj\Models\PenilaianTeam;
|
||||||
use Modules\Lpj\Models\Permohonan;
|
use Modules\Lpj\Models\Permohonan;
|
||||||
use Modules\Lpj\Models\StatusPermohonan;
|
use Modules\Lpj\Models\StatusPermohonan;
|
||||||
use Modules\Lpj\Models\Teams;
|
use Modules\Lpj\Models\Teams;
|
||||||
|
use Modules\Lpj\Models\Regions;
|
||||||
use Modules\Lpj\Models\TeamsUsers;
|
use Modules\Lpj\Models\TeamsUsers;
|
||||||
use Modules\Usermanagement\Models\User;
|
use Modules\Usermanagement\Models\User;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class PenilaianController extends Controller
|
class PenilaianController extends Controller
|
||||||
{
|
{
|
||||||
@@ -37,17 +41,84 @@ class PenilaianController extends Controller
|
|||||||
|
|
||||||
if ($validatedData) {
|
if ($validatedData) {
|
||||||
try {
|
try {
|
||||||
$penilaian = Penilaian::create($validatedData);
|
DB::beginTransaction();
|
||||||
|
|
||||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
$penilaian = Penilaian::create($validatedData);
|
||||||
|
$validatedData['penilaian_id'] = $penilaian->id;
|
||||||
|
|
||||||
|
$teams_ids = [];
|
||||||
|
$user_ids = [];
|
||||||
|
$roles = [];
|
||||||
|
|
||||||
|
if ($validatedData['surveyor_id'] === 'pilih_dari_region') {
|
||||||
|
$surveyor_region_id = $validatedData['surveyor_region_id'];
|
||||||
|
|
||||||
|
// Hapus team_id sebelumnya di Permohonan jika ada
|
||||||
|
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||||
|
if ($permohonan) {
|
||||||
$permohonan->update([
|
$permohonan->update([
|
||||||
'status' => 'assign',
|
'region_id' => $surveyor_region_id,
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$teams_ids[] = $surveyor_region_id;
|
||||||
|
$user_ids[] = null;
|
||||||
|
$roles[] = 'surveyor';
|
||||||
|
} else {
|
||||||
|
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||||
|
$teams_ids[] = $validatedData['teams_id'];
|
||||||
|
$user_ids[] = $validatedData['surveyor_id'];
|
||||||
|
$roles[] = 'surveyor';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($validatedData['penilai_id'] === 'pilih_dari_region') {
|
||||||
|
$penilaian_region_id = $validatedData['penilai_region_id'];
|
||||||
|
|
||||||
|
// Hapus team_id sebelumnya di Permohonan jika ada
|
||||||
|
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||||
|
if ($permohonan) {
|
||||||
|
$permohonan->update([
|
||||||
|
'region_id' => $penilaian_region_id,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$teams_ids[] = $penilaian_region_id;
|
||||||
|
$user_ids[] = null;
|
||||||
|
$roles[] = 'penilai';
|
||||||
|
} else {
|
||||||
|
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||||
|
$teams_ids[] = $validatedData['teams_id'];
|
||||||
|
$user_ids[] = $validatedData['penilai_id'];
|
||||||
|
$roles[] = 'penilai';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($teams_ids as $key => $teams_id) {
|
||||||
|
PenilaianTeam::create([
|
||||||
|
'penilaian_id' => $validatedData['penilaian_id'],
|
||||||
|
'team_id' => $teams_id,
|
||||||
|
'user_id' => $user_ids[$key],
|
||||||
|
'role' => $roles[$key],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($validatedData['surveyor_id'] === 'pilih_dari_region' || $validatedData['penilai_id'] === 'pilih_dari_region') {
|
||||||
|
$status = 'registered';
|
||||||
|
} else {
|
||||||
|
$status = 'assign';
|
||||||
|
}
|
||||||
|
|
||||||
|
$permohonan->update([
|
||||||
|
'status' => $status,
|
||||||
|
]);
|
||||||
|
|
||||||
|
DB::commit();
|
||||||
|
|
||||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
return response()->json(array('error' => $e->getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,22 +134,43 @@ class PenilaianController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Update the specified resource in storage.
|
* Update the specified resource in storage.
|
||||||
*/
|
*/
|
||||||
public function update(PenilaianRequest $request, $id)
|
public function update(Request $request, $id)
|
||||||
{
|
{
|
||||||
$validate = $request->validated();
|
|
||||||
if ($validate) {
|
|
||||||
try {
|
try {
|
||||||
$penilaian = Penilaian::where('nomor_registrasi', $request->nomor_registrasi)->firstOrFail();
|
DB::beginTransaction();
|
||||||
$penilaian->update($validate);
|
$penilaian = Penilaian::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||||
|
|
||||||
|
$penilaianId = $penilaian->id;
|
||||||
|
|
||||||
|
$penilainTeam = PenilaianTeam::where('penilaian_id', $penilaianId)->get();
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($penilainTeam as $item) {
|
||||||
|
if ($item->role === 'surveyor' && $item->user_id === null) {
|
||||||
|
$item->update([
|
||||||
|
'user_id' => $request->surveyor_id,
|
||||||
|
'role' => 'surveyor',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($item->role === 'penilai' && $item->user_id === null) {
|
||||||
|
$item->update([
|
||||||
|
'user_id' => $request->penilai_id,
|
||||||
|
'role' => 'penilai',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||||
$permohonan->update([
|
$permohonan->update([
|
||||||
'status' => 'assign',
|
'status' => 'assign',
|
||||||
]);
|
]);
|
||||||
|
DB::commit();
|
||||||
return redirect()->route('penilaian.index', $id)->with('success', 'Penilaian berhasil diubah');
|
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return redirect()->route('penilaian.index', $id)->with('error', $e->getMessage());
|
DB::rollBack();
|
||||||
}
|
return response()->json(array('error' => $e->getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +179,7 @@ class PenilaianController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function assignment($id)
|
public function assignment($id)
|
||||||
{
|
{
|
||||||
$permohonan = Permohonan::with(
|
$permohonan = Permohonan::with([
|
||||||
[
|
|
||||||
'user',
|
'user',
|
||||||
'debiture.province',
|
'debiture.province',
|
||||||
'debiture.city',
|
'debiture.city',
|
||||||
@@ -96,33 +187,58 @@ class PenilaianController extends Controller
|
|||||||
'debiture.village',
|
'debiture.village',
|
||||||
'branch',
|
'branch',
|
||||||
'tujuanPenilaian',
|
'tujuanPenilaian',
|
||||||
],
|
])->findOrFail($id);
|
||||||
)->findOrFail($id);
|
|
||||||
|
|
||||||
$idPenilaian = $permohonan->jenis_penilaian_id;
|
$idPenilaian = $permohonan->jenis_penilaian_id;
|
||||||
$idRegion = $permohonan->region_id;
|
$idRegion = $permohonan->region_id;
|
||||||
|
|
||||||
$jenisPenilaian = JenisPenilaian::find($idPenilaian);
|
$jenisPenilaian = JenisPenilaian::find($idPenilaian);
|
||||||
|
|
||||||
|
$userTeam = Teams::with(['regions', 'teamsUsers.user'])
|
||||||
$teamPenilai = Teams::with(['regions', 'teamsUsers', 'teamsUsers.user', ])
|
|
||||||
->whereHas('regions', function ($q) use ($idRegion) {
|
->whereHas('regions', function ($q) use ($idRegion) {
|
||||||
$q->where('id', $idRegion);
|
$q->where('id', $idRegion);
|
||||||
})->get();
|
})
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$teamPenilai = $userTeam->flatMap(function ($team) {
|
||||||
|
return $team->teamsUsers->filter(function ($teamUser) {
|
||||||
|
return $teamUser->user->roles->contains(function ($role) {
|
||||||
|
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai';
|
||||||
|
});
|
||||||
|
})->map(function ($teamUser) {
|
||||||
|
return $teamUser->user;
|
||||||
|
});
|
||||||
|
})->unique('id');
|
||||||
|
|
||||||
|
$existingTeamIds = $teamPenilai->pluck('id')->toArray();
|
||||||
|
|
||||||
|
$updateTeamPenilai = Teams::with(['regions', 'teamsUsers', 'teamsUsers.user'])
|
||||||
|
->whereNotIn('id', $existingTeamIds)
|
||||||
|
->get();
|
||||||
|
|
||||||
$regionName = null;
|
$regionName = null;
|
||||||
foreach ($teamPenilai as $item) {
|
foreach ($userTeam as $item) {
|
||||||
$regionName = $item->regions;
|
$regionName = $item->regions;
|
||||||
}
|
}
|
||||||
|
// $regionName = $userTeam->first()?->regions->name;
|
||||||
|
|
||||||
|
|
||||||
// dd($teamPenilai);
|
|
||||||
|
|
||||||
$penilaian = Penilaian::where('nomor_registrasi', $permohonan->nomor_registrasi)->first();
|
$penilaian = Penilaian::where('nomor_registrasi', $permohonan->nomor_registrasi)->first();
|
||||||
|
|
||||||
return view('lpj::penilaian.form', compact('permohonan', 'teamPenilai', 'jenisPenilaian', 'penilaian', 'regionName'));
|
|
||||||
|
$penilaianTeam = collect();
|
||||||
|
if ($penilaian && $penilaian->id) {
|
||||||
|
$penilaianTeam = PenilaianTeam::where('penilaian_id', $penilaian->id)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return response()->json([
|
||||||
|
// 'penilaianTeam' => $penilaianTeam
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
|
||||||
|
return view('lpj::penilaian.form', compact('permohonan', 'teamPenilai', 'jenisPenilaian', 'penilaian', 'regionName', 'updateTeamPenilai', 'penilaianTeam'));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*/
|
*/
|
||||||
@@ -160,8 +276,9 @@ class PenilaianController extends Controller
|
|||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = Permohonan::query();
|
$query = Permohonan::query();
|
||||||
@@ -180,6 +297,9 @@ class PenilaianController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$query->whereRaw('LOWER(status) = ?', ['registered']);
|
$query->whereRaw('LOWER(status) = ?', ['registered']);
|
||||||
|
$query->whereHas('region.teams.teamsUsers.user', function ($q) {
|
||||||
|
$q->where('id', Auth::user()->id);
|
||||||
|
});
|
||||||
|
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
$order = $request->get('sortOrder');
|
$order = $request->get('sortOrder');
|
||||||
@@ -202,7 +322,7 @@ class PenilaianController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$filteredRecords = $query->count();
|
$filteredRecords = $query->count();
|
||||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'region.teams.teamsUsers.user'])->get();
|
||||||
|
|
||||||
$pageCount = ceil($totalRecords / $size);
|
$pageCount = ceil($totalRecords / $size);
|
||||||
|
|
||||||
@@ -222,7 +342,8 @@ class PenilaianController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function otorisator(Request $request){
|
public function otorisator(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
$type = $request->route('type');
|
$type = $request->route('type');
|
||||||
$header = '';
|
$header = '';
|
||||||
@@ -248,7 +369,8 @@ class PenilaianController extends Controller
|
|||||||
return view('lpj::penilaian.otorisator.index', compact('header'));
|
return view('lpj::penilaian.otorisator.index', compact('header'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id){
|
public function show($id)
|
||||||
|
{
|
||||||
|
|
||||||
$permohonan = Permohonan::find($id);
|
$permohonan = Permohonan::find($id);
|
||||||
|
|
||||||
@@ -272,7 +394,10 @@ class PenilaianController extends Controller
|
|||||||
$status = 'proses paparan';
|
$status = 'proses paparan';
|
||||||
break;
|
break;
|
||||||
case 'Pembayaran':
|
case 'Pembayaran':
|
||||||
$status = 'proses pembayaran';
|
$status = 'proses';
|
||||||
|
break;
|
||||||
|
case 'Pembatalan':
|
||||||
|
$status = 'order';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$status = '';
|
$status = '';
|
||||||
@@ -298,8 +423,12 @@ class PenilaianController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
if (!empty($otorisator)) {
|
if (!empty($otorisator)) {
|
||||||
|
if ($status == 'proses') {
|
||||||
|
$query->whereIn('status_bayar', ['sudah_bayar', 'belum_bayar']);
|
||||||
|
} else {
|
||||||
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Sorting berdasarkan sortField dan sortOrder
|
// Sorting berdasarkan sortField dan sortOrder
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
|||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Modules\Lpj\Models\Permohonan;
|
use Modules\Lpj\Models\Permohonan;
|
||||||
use Modules\Lpj\Models\Branch;
|
use Modules\Lpj\Models\Branch;
|
||||||
@@ -32,9 +33,14 @@ use Modules\Lpj\Models\Denah;
|
|||||||
use Modules\Lpj\Models\FotoJaminan;
|
use Modules\Lpj\Models\FotoJaminan;
|
||||||
use Modules\Lpj\Models\Lingkungan;
|
use Modules\Lpj\Models\Lingkungan;
|
||||||
use Modules\Lpj\Models\LantaiUnit;
|
use Modules\Lpj\Models\LantaiUnit;
|
||||||
|
use Modules\Lpj\Models\Lantai;
|
||||||
|
use Modules\Lpj\Models\ViewUnit;
|
||||||
use Modules\Lpj\Models\ObjekJaminan;
|
use Modules\Lpj\Models\ObjekJaminan;
|
||||||
use Modules\Lpj\Models\RuteJaminan;
|
use Modules\Lpj\Models\RuteJaminan;
|
||||||
use Modules\Lpj\Models\AnalisaUnit;
|
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\Models\SpekBagunanAnalisaDetail;
|
||||||
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||||
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||||
@@ -42,6 +48,7 @@ use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
|||||||
class SurveyorController extends Controller
|
class SurveyorController extends Controller
|
||||||
{
|
{
|
||||||
public $user;
|
public $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
@@ -113,6 +120,8 @@ class SurveyorController extends Controller
|
|||||||
->where('permohonan_id', $id)
|
->where('permohonan_id', $id)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return view('lpj::surveyor.detail', compact(
|
return view('lpj::surveyor.detail', compact(
|
||||||
'buttonDisable',
|
'buttonDisable',
|
||||||
'fotojaminan',
|
'fotojaminan',
|
||||||
@@ -508,6 +517,11 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
$query->whereRaw('LOWER(status) = ?', ['assign']);
|
$query->whereRaw('LOWER(status) = ?', ['assign']);
|
||||||
|
|
||||||
|
$query->whereHas('region.teams.teamsUsers.user', function ($q) {
|
||||||
|
$q->where('id', Auth::user()->id);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
$order = $request->get('sortOrder');
|
$order = $request->get('sortOrder');
|
||||||
$column = $request->get('sortField');
|
$column = $request->get('sortField');
|
||||||
@@ -552,6 +566,8 @@ class SurveyorController extends Controller
|
|||||||
{
|
{
|
||||||
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
|
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$branches = Branch::all();
|
$branches = Branch::all();
|
||||||
$provinces = Province::all();
|
$provinces = Province::all();
|
||||||
|
|
||||||
@@ -570,6 +586,11 @@ class SurveyorController extends Controller
|
|||||||
$spekBangunan = SpekBangunan::all();
|
$spekBangunan = SpekBangunan::all();
|
||||||
$saranaPelengkap = SaranaPelengkap::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();
|
||||||
|
|
||||||
|
|
||||||
$analisa = Analisa::with('analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
|
$analisa = Analisa::with('analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
|
||||||
@@ -597,6 +618,11 @@ class SurveyorController extends Controller
|
|||||||
'spekBangunan',
|
'spekBangunan',
|
||||||
'saranaPelengkap',
|
'saranaPelengkap',
|
||||||
'arahMataAngin',
|
'arahMataAngin',
|
||||||
|
'lantai',
|
||||||
|
'viewUnit',
|
||||||
|
'golMasySekitar',
|
||||||
|
'tingkatKeramaian',
|
||||||
|
'laluLintasLokasi'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,10 +651,6 @@ class SurveyorController extends Controller
|
|||||||
$provinces = Province::all();
|
$provinces = Province::all();
|
||||||
|
|
||||||
$fotoJaminan = FotoJaminan::with(['objekJaminan', 'lantaiUnit' ,'ruteJaminan', 'lingkungan'])->where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
$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'));
|
return view('lpj::surveyor.components.foto', compact('permohonan', 'surveyor', 'branches', 'provinces', 'fotoJaminan'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -658,25 +680,18 @@ class SurveyorController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private function getHeader(string $type): array
|
||||||
|
{
|
||||||
|
return self::HEADERS[$type] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
public function data(Request $request)
|
public function data(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$type = $request->route('type');
|
$type = $request->route('type');
|
||||||
|
$header = $this->getHeader($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] ?? '';
|
|
||||||
|
|
||||||
return view('lpj::surveyor.data.index', compact('header'));
|
return view('lpj::surveyor.data.index', compact('header'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,21 +699,9 @@ class SurveyorController extends Controller
|
|||||||
public function createData($type)
|
public function createData($type)
|
||||||
{
|
{
|
||||||
|
|
||||||
$headers = [
|
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
$header = $this->getHeader($type);
|
||||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
return view('lpj::surveyor.data.form', compact('header', 'spekKategoriBagunan'));
|
||||||
'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'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -710,30 +713,21 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
$type = $request->route('type');
|
$type = $request->route('type');
|
||||||
|
|
||||||
$modelClasses = [
|
$modelClass = $this->getModelClass($type);
|
||||||
'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,
|
|
||||||
];
|
|
||||||
|
|
||||||
if (!array_key_exists($type, $modelClasses)) {
|
if (!$modelClass) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('basicdata.'. $type .'.index')
|
->route('basicdata.'. $type .'.index')
|
||||||
->with('error', 'Invalid type specified.');
|
->with('error', 'Invalid type specified.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$modelClass = $modelClasses[$type];
|
if ($type == 'spek-bangunan') {
|
||||||
$data = $request->all();
|
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||||
$data['status'] = true;
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$data = array_merge($validate, ['status' => true]);
|
||||||
$modelClass::create($data);
|
$modelClass::create($data);
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
@@ -757,6 +751,9 @@ class SurveyorController extends Controller
|
|||||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class],
|
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class],
|
||||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class],
|
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class],
|
||||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::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 +766,13 @@ class SurveyorController extends Controller
|
|||||||
$header = $dataMap[$type] ?? '';
|
$header = $dataMap[$type] ?? '';
|
||||||
$model = $modelClass::findOrFail($id);
|
$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 +780,22 @@ class SurveyorController extends Controller
|
|||||||
{
|
{
|
||||||
$validate = $request->validated();
|
$validate = $request->validated();
|
||||||
if ($validate) {
|
if ($validate) {
|
||||||
$modelClasses = [
|
$modelClass = $this->getModelClass($type);
|
||||||
'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,
|
|
||||||
|
|
||||||
];
|
if ($type == 'spek-bangunan') {
|
||||||
|
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the provided type exists in the modelClasses
|
// Check if the provided type exists in the modelClasses
|
||||||
if (!array_key_exists($type, $modelClasses)) {
|
if (!$modelClass) {
|
||||||
return redirect()
|
return redirect()
|
||||||
->route('basicdata.' . $type . '.index')
|
->route('basicdata.' . $type . '.index')
|
||||||
->with('error', 'Invalid type specified.');
|
->with('error', 'Invalid type specified.');
|
||||||
}
|
}
|
||||||
$modelClass = $modelClasses[$type];
|
|
||||||
|
|
||||||
|
|
||||||
$model = $modelClass::findOrFail($id);
|
$model = $modelClass::findOrFail($id);
|
||||||
$model->update($validate);
|
$model->update($validate);
|
||||||
|
|
||||||
@@ -817,8 +816,6 @@ class SurveyorController extends Controller
|
|||||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve data from the database
|
|
||||||
|
|
||||||
$models = [
|
$models = [
|
||||||
'Bentuk Tanah' => BentukTanah::class,
|
'Bentuk Tanah' => BentukTanah::class,
|
||||||
'Kontur Tanah' => KonturTanah::class,
|
'Kontur Tanah' => KonturTanah::class,
|
||||||
@@ -828,9 +825,14 @@ class SurveyorController extends Controller
|
|||||||
'Jenis Bangunan' => JenisBangunan::class,
|
'Jenis Bangunan' => JenisBangunan::class,
|
||||||
'Kondisi Bangunan' => KondisiBangunan::class,
|
'Kondisi Bangunan' => KondisiBangunan::class,
|
||||||
'Sifat Bangunan' => SifatBangunan::class,
|
'Sifat Bangunan' => SifatBangunan::class,
|
||||||
// 'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||||
// 'Spek Bangunan' => SpekBangunan::class,
|
'Spek Bangunan' => SpekBangunan::class,
|
||||||
'Sarana Pelengkap' => SaranaPelengkap::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 +842,6 @@ class SurveyorController extends Controller
|
|||||||
throw new InvalidArgumentException("Invalid type: $type");
|
throw new InvalidArgumentException("Invalid type: $type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Apply search filter if provided
|
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
$query->where(function ($q) use ($search) {
|
$query->where(function ($q) use ($search) {
|
||||||
@@ -897,24 +897,13 @@ class SurveyorController extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$modelClasses = [
|
$modelClass = $this->getModelClass($type);
|
||||||
'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,
|
|
||||||
];
|
|
||||||
|
|
||||||
|
if (!$modelClass) {
|
||||||
if (!array_key_exists($type, $modelClasses)) {
|
|
||||||
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$modelClass = $modelClasses[$type];
|
|
||||||
$model = $modelClass::findOrFail($id);
|
$model = $modelClass::findOrFail($id);
|
||||||
|
|
||||||
$model->delete();
|
$model->delete();
|
||||||
@@ -948,6 +937,54 @@ class SurveyorController extends Controller
|
|||||||
->findOrFail($id);
|
->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');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function validateSubmit(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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()
|
private function getCommonData()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -964,21 +1001,34 @@ class SurveyorController extends Controller
|
|||||||
'spekKategoriBangunan' => SpekKategoritBangunan::all(),
|
'spekKategoriBangunan' => SpekKategoritBangunan::all(),
|
||||||
'spekBangunan' => SpekBangunan::all(),
|
'spekBangunan' => SpekBangunan::all(),
|
||||||
'saranaPelengkap' => SaranaPelengkap::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)
|
private const HEADERS = [
|
||||||
{
|
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||||
$permohonan = Permohonan::find($id);
|
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||||
$permohonan->update([
|
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||||
'status' => 'done',
|
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||||
]);
|
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||||
return redirect()
|
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||||
->route('surveyor.index')
|
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||||
->with('success', 'form surveyor submitted successfully');
|
'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.
|
* Show the form for creating a new resource.
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
|
|
||||||
// cek region apakah sudah ada di tabel teams
|
|
||||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||||
$region = Regions::whereNotIn('id', $regionTeam)->get();
|
$regions = Regions::whereNotIn('id', $regionTeam)->get();
|
||||||
|
|
||||||
// cek user apakah sudah ada di tabel teams_users
|
|
||||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||||
$user = User::whereNotIn('id', $userTeam)
|
$usersWithRole = User::whereNotIn('id', $userTeam)
|
||||||
->with('roles')
|
->with('roles') // Eager load roles
|
||||||
->get();
|
->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' || $role->name === 'senior-officer';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return view('lpj::teams.form', compact('regions', 'user'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
@@ -97,12 +103,19 @@ class TeamsController extends Controller
|
|||||||
{
|
{
|
||||||
$teams = Teams::find($id);
|
$teams = Teams::find($id);
|
||||||
|
|
||||||
|
|
||||||
$region = Regions::all();
|
$region = Regions::all();
|
||||||
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
||||||
$user = User::whereNotIn('id', $usedUsers)
|
$usersWithRole = User::whereNotIn('id', $usedUsers)
|
||||||
->with('roles')
|
->with('roles')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
|
||||||
|
$user = $usersWithRole->filter(function ($user) {
|
||||||
|
return $user->roles->contains(function ($role) {
|
||||||
|
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai' || $role->name === 'senior-officer';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Ambil user yang sudah ada di tim ini
|
// Ambil user yang sudah ada di tim ini
|
||||||
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,12 @@ class PenilaianRequest extends FormRequest
|
|||||||
'tanggal_kunjungan' => 'required|max:255',
|
'tanggal_kunjungan' => 'required|max:255',
|
||||||
'status' => 'required|string',
|
'status' => 'required|string',
|
||||||
'nomor_registrasi' => 'required|string',
|
'nomor_registrasi' => 'required|string',
|
||||||
'surveyor_id' => 'nullable|required_without:penilai_surveyor_id',
|
'surveyor_id' => 'nullable| required_without:penilai_surveyor_id',
|
||||||
'penilaian_id' => 'nullable|required_without:penilai_surveyor_id',
|
'penilai_id' => 'nullable|required_without:penilai_surveyor_id',
|
||||||
'penilai_surveyor_id' => 'nullable|required_without_all:surveyor_id,penilaian_id',
|
'penilai_surveyor_id' => 'nullable|required_without_all:surveyor_id,penilai_id',
|
||||||
|
'surveyor_region_id' => 'nullable|required_without:surveyor_id',
|
||||||
|
'penilai_region_id' => 'nullable|required_without:penilai_id',
|
||||||
|
|
||||||
'keterangan' => 'nullable',
|
'keterangan' => 'nullable',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,18 +4,14 @@ namespace Modules\Lpj\Http\Requests;
|
|||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
class SurveyorRequest extends FormRequest
|
class SurveyorRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Table mapping for different actionszz
|
||||||
*/
|
*/
|
||||||
public function rules()
|
private const TABLE_MAPPING = [
|
||||||
: array
|
|
||||||
{
|
|
||||||
|
|
||||||
$action = $this->input('action');
|
|
||||||
|
|
||||||
$uniqueTable = [
|
|
||||||
'bentuk-tanah' => 'bentuk_tanah',
|
'bentuk-tanah' => 'bentuk_tanah',
|
||||||
'kontur-tanah' => 'kontur_tanah',
|
'kontur-tanah' => 'kontur_tanah',
|
||||||
'posisi-kavling' => 'posisi_kavling',
|
'posisi-kavling' => 'posisi_kavling',
|
||||||
@@ -25,41 +21,120 @@ class SurveyorRequest extends FormRequest
|
|||||||
'jenis-bangunan' => 'jenis_bangunan',
|
'jenis-bangunan' => 'jenis_bangunan',
|
||||||
'sifat-bangunan' => 'sifat_bangunan',
|
'sifat-bangunan' => 'sifat_bangunan',
|
||||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||||
'lalu_lintas_lokasi' => 'lalu_lintas_lokasi',
|
'lalu-lintas-lokasi' => 'lalu_lintas_lokasi',
|
||||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
'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',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
||||||
*/
|
*/
|
||||||
public function authorize()
|
public function authorize(): bool
|
||||||
: bool
|
|
||||||
{
|
{
|
||||||
return true;
|
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([
|
$this->merge([
|
||||||
'status' => true,
|
'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;
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $table = 'gol_mas_sekitar';
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*/
|
*/
|
||||||
protected $fillable = [];
|
protected $fillable = ['code', 'name', 'status'];
|
||||||
|
|
||||||
|
|
||||||
protected static function newFactory(): GolonganMasySekitarFactory
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ class Penilaian extends Model
|
|||||||
*/
|
*/
|
||||||
protected $table = 'penilaian';
|
protected $table = 'penilaian';
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'jenis_penilaian_id', 'teams_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi','penilaian_id','surveyor_id','penilai_surveyor_id',
|
'jenis_penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi',
|
||||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||||
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||||
];
|
];
|
||||||
@@ -39,18 +39,9 @@ class Penilaian extends Model
|
|||||||
|
|
||||||
public function userPenilai()
|
public function userPenilai()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'penilaian_id', 'id');
|
return $this->hasMany(PenilaianTeam::class, 'penilaian_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function userSurveyor()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(User::class, 'surveyor_id', 'id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function userPenilaiSurveyor()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(User::class, 'penilai_surveyor_id', 'id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function permohonan()
|
public function permohonan()
|
||||||
{
|
{
|
||||||
|
|||||||
39
app/Models/PenilaianTeam.php
Normal file
39
app/Models/PenilaianTeam.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Modules\Lpj\Database\Factories\PenilaianTeamFactory;
|
||||||
|
|
||||||
|
class PenilaianTeam extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $table = 'penilaian_team';
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*/
|
||||||
|
protected $fillable = ['penilaian_id', 'team_id', 'user_id','role'];
|
||||||
|
|
||||||
|
|
||||||
|
public function userPenilaiTeam()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function team(){
|
||||||
|
|
||||||
|
return $this->belongsTo(Team::class, 'team_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function penilaian(){
|
||||||
|
|
||||||
|
return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function newFactory(): PenilaianTeamFactory
|
||||||
|
{
|
||||||
|
//return PenilaianTeamFactory::new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,4 +84,9 @@ class Permohonan extends Base
|
|||||||
{
|
{
|
||||||
return $this->hasMany(PenawaranTender::class, 'nomor_registrasi');
|
return $this->hasMany(PenawaranTender::class, 'nomor_registrasi');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function region()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Regions::class, 'region_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class SpekBangunan extends Model
|
|||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* 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.
|
* The attributes that are mass assignable.
|
||||||
*/
|
*/
|
||||||
protected $fillable = [];
|
protected $fillable = ['code','name','status','authorized_status'];
|
||||||
|
|
||||||
|
|
||||||
public function bangunan()
|
public function bangunan()
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class Teams extends Model
|
|||||||
return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
|
return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function penilaian(){
|
public function penilaianTeam(){
|
||||||
return $this->hasMany(Penilaian::class, 'teams_id', 'id');
|
return $this->hasMany(penilaianTeam::class, 'team_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class TingkatKeramaian extends Model
|
|||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $table = 'tingkat_keramaian';
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* 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->unsignedBigInteger('permohonan_id');
|
||||||
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
||||||
$table->string('luas');
|
$table->string('luas');
|
||||||
|
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||||
$table->char('authorized_status', 1)->nullable();
|
$table->char('authorized_status', 1)->nullable();
|
||||||
$table->timestamp('authorized_at')->nullable();
|
$table->timestamp('authorized_at')->nullable();
|
||||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ return new class () extends Migration {
|
|||||||
|
|
||||||
$table->string('foto_denah');
|
$table->string('foto_denah');
|
||||||
$table->string('luas');
|
$table->string('luas');
|
||||||
|
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||||
$table->char('authorized_status', 1)->nullable();
|
$table->char('authorized_status', 1)->nullable();
|
||||||
$table->timestamp('authorized_at')->nullable();
|
$table->timestamp('authorized_at')->nullable();
|
||||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ return new class () extends Migration {
|
|||||||
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
||||||
|
|
||||||
$table->string('pendamping');
|
$table->string('pendamping');
|
||||||
|
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||||
$table->char('authorized_status', 1)->nullable();
|
$table->char('authorized_status', 1)->nullable();
|
||||||
$table->timestamp('authorized_at')->nullable();
|
$table->timestamp('authorized_at')->nullable();
|
||||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ return new class () extends Migration {
|
|||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('foto_objek');
|
$table->string('foto_objek');
|
||||||
|
|
||||||
|
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||||
$table->char('authorized_status', 1)->nullable();
|
$table->char('authorized_status', 1)->nullable();
|
||||||
$table->timestamp('authorized_at')->nullable();
|
$table->timestamp('authorized_at')->nullable();
|
||||||
$table->unsignedBigInteger('authorized_by')->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');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -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('kategori_jenis_aset', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('code');
|
||||||
|
$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('kategori_jenis_aset');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?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::table('penilaian', function (Blueprint $table) {
|
||||||
|
|
||||||
|
$table->dropColumn('teams_id');
|
||||||
|
|
||||||
|
|
||||||
|
$table->dropColumn('surveyor_id');
|
||||||
|
$table->dropColumn('penilaian_id');
|
||||||
|
|
||||||
|
$table->dropColumn('penilai_surveyor_id');
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('penilaian', function (Blueprint $table) {
|
||||||
|
$table->foreignIdFor(Teams::class);
|
||||||
|
$table->foreignIdFor(User::class);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?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('penilaian_team', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->unsignedBigInteger('penilaian_id');
|
||||||
|
$table->unsignedBigInteger('team_id');
|
||||||
|
$table->unsignedBigInteger('user_id');
|
||||||
|
$table->string('role');
|
||||||
|
$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('penilai_team');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?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('kategori_form_analisa_inspeksi', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('code');
|
||||||
|
$table->foreign('kategori_jenis_aset_id')->references('id')->on('kategori_jenis_aset');
|
||||||
|
$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('kategori_form_analisa_inspeksi');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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('label_name_inspeksi', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('label_name_inspeksi');
|
||||||
|
}
|
||||||
|
};
|
||||||
61
module.json
61
module.json
@@ -439,7 +439,7 @@
|
|||||||
"roles": ["administrator", "admin"]
|
"roles": ["administrator", "admin"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "Bentuk Tanah",
|
"title": "Bentuk",
|
||||||
"path": "basicdata.bentuk-tanah",
|
"path": "basicdata.bentuk-tanah",
|
||||||
"classes": "",
|
"classes": "",
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
@@ -510,7 +510,66 @@
|
|||||||
"attributes": [],
|
"attributes": [],
|
||||||
"permission": "",
|
"permission": "",
|
||||||
"roles": ["surveyor"]
|
"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"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -46,14 +46,14 @@
|
|||||||
@php
|
@php
|
||||||
|
|
||||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||||
return $item->team->penilaian
|
|
||||||
->filter(function ($penilaian) use ($item) {
|
return $item->team->penilaianTeam
|
||||||
return $penilaian->penilaian_id == $item->user->id ||
|
->filter(function ($penilaianTeam) use ($item) {
|
||||||
$penilaian->surveyor_id == $item->user->id ||
|
return $penilaianTeam->user_id == $item->user->id;
|
||||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
|
||||||
})
|
})
|
||||||
->count();
|
->count();
|
||||||
});
|
});
|
||||||
|
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@foreach ($sortedTeamsActivity as $index => $item)
|
@foreach ($sortedTeamsActivity as $index => $item)
|
||||||
@@ -70,11 +70,9 @@
|
|||||||
<th class="min-w-[150px]">
|
<th class="min-w-[150px]">
|
||||||
<span class="text-base text-gray-900 font-normal">
|
<span class="text-base text-gray-900 font-normal">
|
||||||
@php
|
@php
|
||||||
$totalTasks = $item->team->penilaian
|
$totalTasks = $item->team->penilaianTeam
|
||||||
->filter(function ($penilaian) use ($item) {
|
->filter(function ($penilaianTeam) use ($item) {
|
||||||
return $penilaian->penilaian_id == $item->user->id ||
|
return $penilaianTeam->user_id == $item->user->id;
|
||||||
$penilaian->surveyor_id == $item->user->id ||
|
|
||||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
|
||||||
})
|
})
|
||||||
->count();
|
->count();
|
||||||
@endphp
|
@endphp
|
||||||
@@ -156,8 +154,6 @@
|
|||||||
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
||||||
'data-api-url');
|
'data-api-url');
|
||||||
|
|
||||||
console.log("This is the API URL: " + apiUrl);
|
|
||||||
|
|
||||||
const dataTableOptions = {
|
const dataTableOptions = {
|
||||||
apiEndpoint: apiUrl,
|
apiEndpoint: apiUrl,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
@@ -180,7 +176,7 @@
|
|||||||
},
|
},
|
||||||
jenis_asset: {
|
jenis_asset: {
|
||||||
title: '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: {
|
jenis_report: {
|
||||||
title: 'Jenis Report',
|
title: 'Jenis Report',
|
||||||
|
|||||||
@@ -183,15 +183,14 @@
|
|||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
Penilai yang Dilakukan oleh
|
Penilai yang Dilakukan oleh
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<input type="hidden" name="nomor_registrasi"
|
<input type="hidden" name="nomor_registrasi"
|
||||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input"
|
<input class="input" type="hidden" name="jenis_penilaian_id"
|
||||||
type="hidden" name="jenis_penilaian_id" value="{{ $jenisPenilaian->id }}"
|
value="{{ $jenisPenilaian->id }}">
|
||||||
>
|
|
||||||
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
|
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
|
||||||
type="text" value="{{ $jenisPenilaian->name }}"
|
type="text" value="{{ $jenisPenilaian->name }}" readonly>
|
||||||
readonly>
|
|
||||||
@error('jenis_penilaian_id')
|
@error('jenis_penilaian_id')
|
||||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -203,9 +202,7 @@
|
|||||||
Tim Penilai yang di tunjuk
|
Tim Penilai yang di tunjuk
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input"
|
<input class="input" type="hidden" name="teams_id" value="{{ $regionName->id }}">
|
||||||
type="hidden" name="teams_id" value="{{ $regionName->id }}"
|
|
||||||
>
|
|
||||||
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
|
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
|
||||||
type="text" value="{{ $regionName->name }}" readonly>
|
type="text" value="{{ $regionName->name }}" readonly>
|
||||||
@error('teams_id')
|
@error('teams_id')
|
||||||
@@ -214,62 +211,217 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
{{-- @php
|
||||||
|
var_dump($penilaianTeam);
|
||||||
|
@endphp --}}
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 {{ $penilaianTeam->isEmpty() ? '' : 'hidden' }}">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
Surveyor yang di tunjuk
|
Pilih Surveyor dan Penilai
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select id="surveyor_id" name="surveyor_id"
|
<div class="input-group w-full">
|
||||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
<select id="surveyor_selection" name="surveyor_selection"
|
||||||
<option value="">Pilih Surveyor</option>
|
class="tomselect input @error('surveyor_selection') border-danger bg-danger-light @enderror w-full">
|
||||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
<option value="">Pilih Surveyor dan Penilai</option>
|
||||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
<option value="penilai_dan_surveyor">Penilai dan Surveyor Sama</option>
|
||||||
@endforeach
|
<option value="berbeda">Berbeda</option>
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
@error('surveyor_id')
|
@error('surveyor_selection')
|
||||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="same_surveyor_penilai" class="hidden">
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
Penilai yang di tunjuk
|
Surveyor dan 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>
|
|
||||||
</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>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<div class="input-group w-full">
|
||||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||||
<option value="">Pilih Surveyor dan Penilai</option>
|
<option value="">Pilih Surveyor dan Penilai</option>
|
||||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
@foreach ($teamPenilai as $item)
|
||||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
@error('penilai_surveyor_id')
|
@error('penilai_surveyor_id')
|
||||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="different_surveyor_penilai" class="{{ $penilaianTeam->isNotEmpty() ? '' : 'hidden' }}">
|
||||||
|
<div class="grid gap-2.5">
|
||||||
|
|
||||||
|
@if (
|
||||||
|
$penilaianTeam->isNotEmpty() &&
|
||||||
|
$penilaianTeam->contains(fn($item) => $item->role == 'surveyor' && is_null($item->user_id))
|
||||||
|
)
|
||||||
|
<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 as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
@if ($penilaianTeam->isEmpty())
|
||||||
|
<option value="pilih_dari_region">pilih dari region berdeda
|
||||||
|
</option>
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@error('surveyor_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@elseif($penilaianTeam->isEmpty())
|
||||||
|
<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 as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
@if ($penilaianTeam->isEmpty())
|
||||||
|
<option value="pilih_dari_region">pilih dari region berdeda
|
||||||
|
</option>
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@error('surveyor_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
<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_region_id" name="surveyor_region_id"
|
||||||
|
class="tomselect input @error('surveyor_region_id') border-danger bg-danger-light @enderror w-full">
|
||||||
|
<option value="">Pilih Region</option>
|
||||||
|
|
||||||
|
@if (isset($updateTeamPenilai))
|
||||||
|
@foreach ($updateTeamPenilai as $item)
|
||||||
|
<option value="{{ $item->regions->id }}">
|
||||||
|
{{ $item->regions->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@error('surveyor_region_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@if (
|
||||||
|
$penilaianTeam->isNotEmpty() &&
|
||||||
|
$penilaianTeam->contains(fn($item) => $item->role == 'penilai' && is_null($item->user_id))
|
||||||
|
)
|
||||||
|
|
||||||
|
<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="penilai_id" name="penilai_id"
|
||||||
|
class="input tomselect @error('penilai_id') border-danger bg-danger-light @enderror w-full">
|
||||||
|
<option value="">Pilih Penilai</option>
|
||||||
|
@foreach ($teamPenilai as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@if ($penilaianTeam->isEmpty())
|
||||||
|
<option value="pilih_dari_region">pilih dari region berdeda
|
||||||
|
</option>
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@error('penilai_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@elseif($penilaianTeam->isEmpty())
|
||||||
|
<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="penilai_id" name="penilai_id"
|
||||||
|
class="input tomselect @error('penilai_id') border-danger bg-danger-light @enderror w-full">
|
||||||
|
<option value="">Pilih Penilai</option>
|
||||||
|
@foreach ($teamPenilai as $item)
|
||||||
|
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@if ($penilaianTeam->isEmpty())
|
||||||
|
<option value="pilih_dari_region">pilih dari region berdeda
|
||||||
|
</option>
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@error('penilai_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
<div id="penilaiRegion" 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="penilai_region_id" name="penilai_region_id"
|
||||||
|
class="tomselect input @error('penilai_region_id') border-danger bg-danger-light @enderror w-full">
|
||||||
|
<option value="">Pilih Region</option>
|
||||||
|
|
||||||
|
@if (isset($updateTeamPenilai))
|
||||||
|
@foreach ($updateTeamPenilai as $item)
|
||||||
|
<option value="{{ $item->regions->id }}">
|
||||||
|
{{ $item->regions->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
@error('penilai_region_id')
|
||||||
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
|
@enderror
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
Jadwal Kunjungan
|
Jadwal Kunjungan
|
||||||
@@ -307,16 +459,9 @@
|
|||||||
Revisi
|
Revisi
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -376,8 +521,57 @@
|
|||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
|
|
||||||
<script>
|
<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');
|
||||||
|
surveyorRegion.classList.add('flex');
|
||||||
|
} else {
|
||||||
|
surveyorRegion.classList.add('hidden');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById('penilaian_id').addEventListener('change', function() {
|
||||||
|
const selectedValue = this.value;
|
||||||
|
const penilaiRegion = document.getElementById('penilaiRegion');
|
||||||
|
|
||||||
|
if (selectedValue === 'pilih_dari_region') {
|
||||||
|
penilaiRegion.classList.remove('hidden');
|
||||||
|
penilaiRegion.classList.add('flex');
|
||||||
|
} else {
|
||||||
|
penilaiRegion.classList.add('hidden');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
const revisiForm = document.getElementById('revisiForm');
|
const revisiForm = document.getElementById('revisiForm');
|
||||||
const btnSubmit = document.getElementById('btnSubmit');
|
const btnSubmit = document.getElementById('btnSubmit');
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@extends('layouts.main')
|
@extends('layouts.main')
|
||||||
|
|
||||||
{{-- @section('breadcrumbs')
|
@section('breadcrumbs')
|
||||||
{{ Breadcrumbs::render('penilaian') }}
|
{{ Breadcrumbs::render('otorisator.'. strtolower($header)) }}
|
||||||
@endsection --}}
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
@@ -57,10 +57,7 @@
|
|||||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||||
<span class="sort-icon"> </span> </span>
|
<span class="sort-icon"> </span> </span>
|
||||||
</th>
|
</th>
|
||||||
<th class="min-w-[150px]" data-datatable-column="status">
|
|
||||||
<span class="sort"> <span class="sort-label"> Status </span>
|
|
||||||
<span class="sort-icon"> </span> </span>
|
|
||||||
</th>
|
|
||||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -86,10 +83,48 @@
|
|||||||
|
|
||||||
|
|
||||||
@push('scripts')
|
@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">
|
<script type="module">
|
||||||
const element = document.querySelector('#permohonan-table');
|
const element = document.querySelector('#permohonan-table');
|
||||||
const searchInput = document.getElementById('search');
|
const searchInput = document.getElementById('search');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const apiUrl = element.getAttribute('data-api-url');
|
const apiUrl = element.getAttribute('data-api-url');
|
||||||
const dataTableOptions = {
|
const dataTableOptions = {
|
||||||
apiEndpoint: apiUrl,
|
apiEndpoint: apiUrl,
|
||||||
@@ -135,9 +170,6 @@
|
|||||||
return `${data.tujuan_penilaian.name}`;
|
return `${data.tujuan_penilaian.name}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
status: {
|
|
||||||
title: 'Status'
|
|
||||||
},
|
|
||||||
actions: {
|
actions: {
|
||||||
title: 'Status',
|
title: 'Status',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<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">
|
<input type="hidden" name="_method" value="PUT">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="card-body lg:py-7.5">
|
<div class="card-body lg:py-7.5">
|
||||||
@@ -160,14 +160,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer flex justify-end">
|
<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
|
Approve
|
||||||
</button>
|
</button>
|
||||||
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
|
|
||||||
Revisi
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@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=""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>
|
<h1 class="text-md font-medium text-gray-900">Analisa Unit</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-5">
|
<div class="grid gap-5">
|
||||||
@@ -104,8 +104,8 @@
|
|||||||
class="input tomselect w-full @error('lantai') border-danger bg-danger-light @enderror"
|
class="input tomselect w-full @error('lantai') border-danger bg-danger-light @enderror"
|
||||||
name="lantai">
|
name="lantai">
|
||||||
<option value="">Select Lantai</option>
|
<option value="">Select Lantai</option>
|
||||||
@if (isset($posisiKavling))
|
@if (isset($lantai))
|
||||||
@foreach ($posisiKavling as $item)
|
@foreach ($lantai as $item)
|
||||||
<option value="{{ $item->name }}" {{ old('lantai', isset($analisa) && optional($analisa->analisaUnit)->lantai) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
<option value="{{ $item->name }}" {{ old('lantai', isset($analisa) && optional($analisa->analisaUnit)->lantai) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
@@ -126,8 +126,8 @@
|
|||||||
class="input tomselect w-full @error('view') border-danger bg-danger-light @enderror"
|
class="input tomselect w-full @error('view') border-danger bg-danger-light @enderror"
|
||||||
name="view">
|
name="view">
|
||||||
<option value="">Select View</option>
|
<option value="">Select View</option>
|
||||||
@if (isset($kondisiFisikTanah))
|
@if (isset($viewUnit))
|
||||||
@foreach ($kondisiFisikTanah as $item)
|
@foreach ($viewUnit as $item)
|
||||||
<option value="{{ $item->name }}" {{ old('view', isset($analisa) && optional($analisa->analisaUnit)->view) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
<option value="{{ $item->name }}" {{ old('view', isset($analisa) && optional($analisa->analisaUnit)->view) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
@@ -146,8 +146,8 @@
|
|||||||
class="input tomselect w-full @error('bentuk_unit') border-danger bg-danger-light @enderror"
|
class="input tomselect w-full @error('bentuk_unit') border-danger bg-danger-light @enderror"
|
||||||
name="bentuk_unit">
|
name="bentuk_unit">
|
||||||
<option value="">Select Bentuk Unit</option>
|
<option value="">Select Bentuk Unit</option>
|
||||||
@if (isset($kondisiFisikTanah))
|
@if (isset($bentukTanah))
|
||||||
@foreach ($kondisiFisikTanah as $item)
|
@foreach ($bentukTanah as $item)
|
||||||
<option value="{{ $item->name }}" {{ old('bentuk_unit', isset($analisa) && optional($analisa->analisaUnit)->bentuk_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
<option value="{{ $item->name }}" {{ old('bentuk_unit', isset($analisa) && optional($analisa->analisaUnit)->bentuk_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
@endsection --}}
|
@endsection --}}
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<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">
|
||||||
<div class="card min-w-full">
|
<div class="card min-w-full">
|
||||||
@@ -120,7 +121,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="{{ route('surveyor.storeFoto') }}" method="POST" class="grid gap-5"
|
<form action="{{ route('surveyor.storeFoto') }}" method="POST" class="grid gap-5"
|
||||||
@@ -167,6 +167,8 @@
|
|||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
|
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
|
||||||
|
|
||||||
|
|
||||||
<div class="bg-white rounded-lg shadow-md">
|
<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="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>
|
<h1 class="text-md font-medium text-gray-900">Rute Menuju Lokasi</h1>
|
||||||
@@ -177,20 +179,28 @@
|
|||||||
|
|
||||||
@if (isset($fotoJaminan))
|
@if (isset($fotoJaminan))
|
||||||
@foreach ($fotoJaminan->ruteJaminan as $item)
|
@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 id="inputContainerRute" style="margin-top: 10px">
|
||||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="w-full grid gap-5">
|
<div class="w-full grid gap-5">
|
||||||
@if (isset($item->foto_rute))
|
|
||||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
<div class="input-group w-full flex gap-2">
|
||||||
alt="Gambar Pendamping" style="width: 12rem;">
|
|
||||||
@endif
|
|
||||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||||
<input id="inputRute" type="file" name="foto_rute[]"
|
<input id="inputRute" type="file" name="foto_rute[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
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"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
style="display: none;" id="btnDelete">
|
style="display: none;" id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
@@ -211,9 +221,17 @@
|
|||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||||
<input id="inputRute" type="file" name="foto_rute[]"
|
<input id="inputRute" type="file" name="foto_rute[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
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"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
style="display: none;" id="btnDelete">
|
style="display: none;" id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
@@ -231,7 +249,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="bg-white rounded-lg shadow-md">
|
<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>
|
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
|
||||||
</div>
|
</div>
|
||||||
@php
|
@php
|
||||||
@@ -267,9 +285,16 @@
|
|||||||
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
||||||
style="width: 12rem;">
|
style="width: 12rem;">
|
||||||
@endif
|
@endif
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
<input type="file" name="foto_objek[]"
|
<input type="file" name="foto_objek[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*"
|
class="file-input file-input-bordered w-full" accept="image/*"
|
||||||
capture="camera">
|
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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
@@ -289,7 +314,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="flex flex-wrap gap-4 w-full">
|
<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">
|
<label class="form-label">
|
||||||
<span class="form-label">Lantai</span>
|
<span class="form-label">Lantai</span>
|
||||||
</label>
|
</label>
|
||||||
@@ -336,10 +361,16 @@
|
|||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
<span class="form-label">Foto Lantai 1</span>
|
<span class="form-label">Foto Lantai 1</span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*"
|
class="file-input file-input-bordered w-full" accept="image/*"
|
||||||
capture="camera">
|
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"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
style="display: none;" id="btnDelete">
|
style="display: none;" id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
@@ -377,10 +408,16 @@
|
|||||||
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
|
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
|
||||||
alt="Gambar Pendamping" style="width: 12rem;">
|
alt="Gambar Pendamping" style="width: 12rem;">
|
||||||
@endif
|
@endif
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*"
|
class="file-input file-input-bordered w-full" accept="image/*"
|
||||||
capture="camera">
|
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"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
style="display: none;" id="btnDelete">
|
style="display: none;" id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
@@ -401,9 +438,18 @@
|
|||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
<span class="form-label">Lingkungan</span>
|
<span class="form-label">Lingkungan</span>
|
||||||
</label>
|
</label>
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
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"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
style="display: none;" id="btnDelete">
|
style="display: none;" id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
@@ -436,8 +482,16 @@
|
|||||||
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
|
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
|
||||||
alt="Gambar Pendamping" style="width: 12rem;">
|
alt="Gambar Pendamping" style="width: 12rem;">
|
||||||
@endif
|
@endif
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
<input id="inputPendamping" type="file" name="pendamping"
|
<input id="inputPendamping" type="file" name="pendamping"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
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"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
style="display: none;" id="btnDelete">
|
style="display: none;" id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
@@ -459,11 +513,266 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
|
@include('lpj::surveyor.js.camera-editor')
|
||||||
<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() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
// Generic function to handle adding new input and delete functionality
|
// Generic function to handle adding new input and delete functionality
|
||||||
|
|||||||
@@ -148,13 +148,14 @@
|
|||||||
'tanah_bangunan' => 'Mall',
|
'tanah_bangunan' => 'Mall',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
if (isset($analisa->id)) {
|
if (isset($analisa->id)) {
|
||||||
$analisaType = $analisa->type;
|
$analisaType = $analisa->type;
|
||||||
} else {
|
} else {
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
if (isset($jenisJaminanData) &&
|
if (
|
||||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))) {
|
isset($jenisJaminanData) &&
|
||||||
|
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
|
||||||
|
) {
|
||||||
$analisaType = $key;
|
$analisaType = $key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -174,13 +175,15 @@
|
|||||||
|
|
||||||
@if ($analisaType == 'tanah_bangunan')
|
@if ($analisaType == 'tanah_bangunan')
|
||||||
@include('lpj::surveyor.components.tanah-bangunan')
|
@include('lpj::surveyor.components.tanah-bangunan')
|
||||||
@else
|
@elseif($analisaType == 'unit')
|
||||||
@include('lpj::surveyor.components.apartemen-kantor')
|
@include('lpj::surveyor.components.apartemen-kantor')
|
||||||
|
@elseif($analisaType == 'kendaraan')
|
||||||
|
@include('lpj::surveyor.components.alat-berat')
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
<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>
|
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-5">
|
<div class="grid gap-5">
|
||||||
@@ -244,9 +247,9 @@
|
|||||||
<select
|
<select
|
||||||
class="input tomselect w-full @error('lalu_lintas') border-danger bg-danger-light @enderror"
|
class="input tomselect w-full @error('lalu_lintas') border-danger bg-danger-light @enderror"
|
||||||
name="lalu_lintas">
|
name="lalu_lintas">
|
||||||
<option value="">Select PLalulintas Depan Lokasi</option>
|
<option value="">Select Lalulintas Depan Lokasi</option>
|
||||||
@if (isset($konturTanah))
|
@if (isset($laluLintasLokasi))
|
||||||
@foreach ($konturTanah as $item)
|
@foreach ($laluLintasLokasi as $item)
|
||||||
<option value="{{ $item->name }}"
|
<option value="{{ $item->name }}"
|
||||||
{{ old('lalu_lintas', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lalu_lintas : '') == $item->name ? 'selected' : '' }}>
|
{{ old('lalu_lintas', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lalu_lintas : '') == $item->name ? 'selected' : '' }}>
|
||||||
{{ $item->name }}</option>
|
{{ $item->name }}</option>
|
||||||
@@ -268,8 +271,9 @@
|
|||||||
class="input tomselect w-full @error('gol_mas_sekitar') border-danger bg-danger-light @enderror"
|
class="input tomselect w-full @error('gol_mas_sekitar') border-danger bg-danger-light @enderror"
|
||||||
name="gol_mas_sekitar">
|
name="gol_mas_sekitar">
|
||||||
<option value="">Select Golongan Hidup Sekitar</option>
|
<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 }}"
|
<option value="{{ $item->name }}"
|
||||||
{{ old('gol_mas_sekitar', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->gol_mas_sekitar : '') == $item->name ? 'selected' : '' }}>
|
{{ old('gol_mas_sekitar', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->gol_mas_sekitar : '') == $item->name ? 'selected' : '' }}>
|
||||||
{{ $item->name }}</option>
|
{{ $item->name }}</option>
|
||||||
@@ -291,8 +295,8 @@
|
|||||||
class="input tomselect w-full @error('tingkat_keramaian') border-danger bg-danger-light @enderror"
|
class="input tomselect w-full @error('tingkat_keramaian') border-danger bg-danger-light @enderror"
|
||||||
name="tingkat_keramaian">
|
name="tingkat_keramaian">
|
||||||
<option value="">Select Tingkat Keramaian</option>
|
<option value="">Select Tingkat Keramaian</option>
|
||||||
@if (isset($konturTanah))
|
@if (isset($tingkatKeramaian))
|
||||||
@foreach ($konturTanah as $item)
|
@foreach ($tingkatKeramaian as $item)
|
||||||
<option value="{{ $item->name }}"
|
<option value="{{ $item->name }}"
|
||||||
{{ old('tingkat_keramaian', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->tingkat_keramaian : '') == $item->name ? 'selected' : '' }}>
|
{{ old('tingkat_keramaian', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->tingkat_keramaian : '') == $item->name ? 'selected' : '' }}>
|
||||||
{{ $item->name }}</option>
|
{{ $item->name }}</option>
|
||||||
@@ -448,7 +452,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
<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>
|
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-5">
|
<div class="grid gap-5">
|
||||||
@@ -544,9 +548,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="container mx-auto ">
|
<div class="">
|
||||||
<!-- Header -->
|
<!-- 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>
|
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -656,9 +660,41 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</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="gistaru" 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="bumi" type="button" class="btn btn-light"
|
||||||
|
onclick="openModal('bumi')">
|
||||||
|
<i class="ki-outline ki-abstract-33"></i> Bumi
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Peta Section -->
|
<!-- Peta Section -->
|
||||||
|
|
||||||
<div class="mt-2" style="margin-top: 20px">
|
<div class="mt-2" style="margin-top: 20px">
|
||||||
<input type="hidden" name="lat" id="lat"
|
<input type="hidden" name="lat" id="lat"
|
||||||
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
|
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
|
||||||
@@ -717,8 +753,74 @@
|
|||||||
</div>
|
</div>
|
||||||
</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" 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
|
@endsection
|
||||||
@push('scripts')
|
@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 modalGistaru = document.getElementById('gistaru');
|
||||||
|
const modalBumi = document.getElementById('bumi');
|
||||||
|
|
||||||
|
if (type === 'bumi') {
|
||||||
|
modalBumi.setAttribute('data-modal-toggle', '#modal');
|
||||||
|
}else if (type === 'gistaru') {
|
||||||
|
modalGistaru.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>
|
<script>
|
||||||
// Fungsi untuk mengambil lokasi pengguna
|
// Fungsi untuk mengambil lokasi pengguna
|
||||||
function getUserLocation() {
|
function getUserLocation() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
<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>
|
<h1 class="text-md font-medium text-gray-900">Analisa Tanah</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-5">
|
<div class="grid gap-5">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@extends('layouts.main')
|
@extends('layouts.main')
|
||||||
|
|
||||||
{{-- @section('breadcrumbs')
|
@section('breadcrumbs')
|
||||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||||
@endsection --}}
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
<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')
|
@error('code')
|
||||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -51,6 +51,41 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="flex justify-end">
|
||||||
<button type="submit" class="btn btn-primary">
|
<button type="submit" class="btn btn-primary">
|
||||||
Save
|
Save
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@extends('layouts.main')
|
@extends('layouts.main')
|
||||||
|
|
||||||
{{-- @section('breadcrumbs')
|
@section('breadcrumbs')
|
||||||
{{ Breadcrumbs::render('surveyor.bentuk-tanah') }}
|
{{ Breadcrumbs::render('basicdata.' . $header[1]) }}
|
||||||
@endsection --}}
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
@if (request()->has('form') && request('form') !== 'data-pembanding')
|
@if (request()->has('form') && request('form') !== 'data-pembanding')
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<form action="{{ route('surveyor.submitSurveyor', $surveyor) }}" method="POST">
|
<form action="{{ route('surveyor.submitSurveyor', $surveyor ) }}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
<button type="submit" class="btn btn-primary " {{ $buttonDisable ? 'disabled' : '' }}>
|
<button type="submit" class="btn btn-primary " {{ $buttonDisable ? 'disabled' : '' }}>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
@push('styles')
|
@push('styles')
|
||||||
<style>
|
<style>
|
||||||
.modal {
|
.modal {
|
||||||
|
|
||||||
width: 50%;
|
width: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -201,10 +202,10 @@
|
|||||||
},
|
},
|
||||||
tanggal_permohonan: {
|
tanggal_permohonan: {
|
||||||
title: 'Tanggal Assigned',
|
title: 'Tanggal Assigned',
|
||||||
render: (item, data) => {
|
// render: (item, data) => {
|
||||||
const createdAt = convertDate(data.penilaian.created_at);
|
// const createdAt = convertDate(data.penilaian.created_at);
|
||||||
return createdAt;
|
// return createdAt;
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
|
|
||||||
user_id: {
|
user_id: {
|
||||||
@@ -249,10 +250,10 @@
|
|||||||
dataTable.search(searchValue, true);
|
dataTable.search(searchValue, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
statusFilter.addEventListener('change', function() {
|
// statusFilter.addEventListener('change', function() {
|
||||||
const selectedStatus = this.value;
|
// const selectedStatus = this.value;
|
||||||
dataTable.search(selectedStatus);
|
// dataTable.search(selectedStatus);
|
||||||
});
|
// });
|
||||||
|
|
||||||
function convertDate(date) {
|
function convertDate(date) {
|
||||||
const createdAt = new Date(date);
|
const createdAt = new Date(date);
|
||||||
|
|||||||
585
resources/views/surveyor/js/camera-editor.blade.php
Normal file
585
resources/views/surveyor/js/camera-editor.blade.php
Normal file
@@ -0,0 +1,585 @@
|
|||||||
|
@push('scripts')
|
||||||
|
<script>
|
||||||
|
class UniversalCameraEditor {
|
||||||
|
constructor() {
|
||||||
|
// Initialize elements
|
||||||
|
this.video = document.getElementById('video');
|
||||||
|
this.canvas = document.getElementById('canvas');
|
||||||
|
this.drawingCanvas = document.getElementById('drawingCanvas');
|
||||||
|
this.ctx = this.drawingCanvas.getContext('2d');
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
this.startButton = document.getElementById('startButton');
|
||||||
|
this.takePhotoButton = document.getElementById('takePhotoButton');
|
||||||
|
this.switchButton = document.getElementById('switchButton');
|
||||||
|
this.backButton = document.getElementById('backButton');
|
||||||
|
this.saveButton = document.getElementById('saveButton');
|
||||||
|
this.undoButton = document.getElementById('undoButton');
|
||||||
|
this.resetButton = document.getElementById('resetButton');
|
||||||
|
|
||||||
|
// Drawing controls
|
||||||
|
this.colorPicker = document.getElementById('colorPicker');
|
||||||
|
this.brushSize = document.getElementById('brushSize');
|
||||||
|
this.brushSizeValue = document.getElementById('brushSizeValue');
|
||||||
|
|
||||||
|
// Text modal elements
|
||||||
|
this.textModal = document.getElementById('textModal');
|
||||||
|
this.textInput = document.getElementById('textInput');
|
||||||
|
this.confirmTextBtn = document.getElementById('confirmTextBtn');
|
||||||
|
this.cancelTextBtn = document.getElementById('cancelTextBtn');
|
||||||
|
|
||||||
|
// Initialize state
|
||||||
|
this.stream = null;
|
||||||
|
this.currentFacingMode = 'environment';
|
||||||
|
this.isDrawing = false;
|
||||||
|
this.currentTool = 'brush';
|
||||||
|
this.drawingHistory = [];
|
||||||
|
this.historyIndex = -1;
|
||||||
|
|
||||||
|
// Drawing coordinates
|
||||||
|
this.startX = 0;
|
||||||
|
this.startY = 0;
|
||||||
|
this.lastX = 0;
|
||||||
|
this.lastY = 0;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
this.setupCanvas();
|
||||||
|
this.setupEventListeners();
|
||||||
|
this.setupDrawingContext();
|
||||||
|
|
||||||
|
|
||||||
|
// Add text overlay container
|
||||||
|
this.textOverlay = document.getElementById('textOverlay');
|
||||||
|
this.activeTextElement = null;
|
||||||
|
this.isDraggingText = false;
|
||||||
|
this.textOffset = {
|
||||||
|
x: 0,
|
||||||
|
y: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Current input field reference
|
||||||
|
this.currentInputField = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setupCanvas() {
|
||||||
|
// Set initial canvas size
|
||||||
|
this.canvas.width = 1280;
|
||||||
|
this.canvas.height = 960;
|
||||||
|
this.drawingCanvas.width = 1280;
|
||||||
|
this.drawingCanvas.height = 960;
|
||||||
|
}
|
||||||
|
|
||||||
|
setupDrawingContext() {
|
||||||
|
this.ctx.strokeStyle = this.colorPicker.value;
|
||||||
|
this.ctx.lineWidth = this.brushSize.value;
|
||||||
|
this.ctx.lineCap = 'round';
|
||||||
|
this.ctx.lineJoin = 'round';
|
||||||
|
}
|
||||||
|
|
||||||
|
async startCamera() {
|
||||||
|
try {
|
||||||
|
if (this.stream) {
|
||||||
|
this.stream.getTracks().forEach(track => track.stop());
|
||||||
|
}
|
||||||
|
|
||||||
|
const constraints = {
|
||||||
|
video: {
|
||||||
|
facingMode: this.currentFacingMode,
|
||||||
|
width: {
|
||||||
|
ideal: 1280
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
ideal: 960
|
||||||
|
}
|
||||||
|
},
|
||||||
|
audio: false
|
||||||
|
};
|
||||||
|
|
||||||
|
this.stream = await navigator.mediaDevices.getUserMedia(constraints);
|
||||||
|
this.video.srcObject = this.stream;
|
||||||
|
|
||||||
|
// Enable buttons after camera starts
|
||||||
|
this.takePhotoButton.disabled = false;
|
||||||
|
this.switchButton.disabled = false;
|
||||||
|
|
||||||
|
// Show video, hide canvas
|
||||||
|
this.video.style.display = 'block';
|
||||||
|
this.canvas.style.display = 'none';
|
||||||
|
this.drawingCanvas.style.display = 'none';
|
||||||
|
|
||||||
|
// Hide editor controls
|
||||||
|
document.getElementById('editorControls').classList.add('hidden');
|
||||||
|
document.getElementById('cameraControls').classList.remove('hidden');
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error accessing camera:', error);
|
||||||
|
alert('Error accessing camera. Please make sure you have granted camera permissions.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
takePhoto() {
|
||||||
|
// Draw video frame to canvas
|
||||||
|
const context = this.canvas.getContext('2d');
|
||||||
|
context.drawImage(this.video, 0, 0, this.canvas.width, this.canvas.height);
|
||||||
|
|
||||||
|
// Hide video, show canvases
|
||||||
|
this.video.style.display = 'none';
|
||||||
|
this.canvas.style.display = 'block';
|
||||||
|
this.drawingCanvas.style.display = 'block';
|
||||||
|
|
||||||
|
// Show editor controls, hide camera controls
|
||||||
|
document.getElementById('editorControls').classList.remove('hidden');
|
||||||
|
document.getElementById('cameraControls').classList.add('hidden');
|
||||||
|
|
||||||
|
// Clear drawing history
|
||||||
|
this.drawingHistory = [];
|
||||||
|
this.historyIndex = -1;
|
||||||
|
this.saveDrawingState();
|
||||||
|
}
|
||||||
|
|
||||||
|
switchCamera() {
|
||||||
|
this.currentFacingMode = this.currentFacingMode === 'environment' ? 'user' : 'environment';
|
||||||
|
this.startCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
resetToCamera() {
|
||||||
|
// Clear canvases
|
||||||
|
const context = this.canvas.getContext('2d');
|
||||||
|
context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
|
||||||
|
// Reset history
|
||||||
|
this.drawingHistory = [];
|
||||||
|
this.historyIndex = -1;
|
||||||
|
|
||||||
|
// Restart camera
|
||||||
|
this.startCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
saveDrawingState() {
|
||||||
|
// Trim history if we're not at the end
|
||||||
|
if (this.historyIndex < this.drawingHistory.length - 1) {
|
||||||
|
this.drawingHistory = this.drawingHistory.slice(0, this.historyIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save current state
|
||||||
|
this.drawingHistory.push(this.drawingCanvas.toDataURL());
|
||||||
|
this.historyIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
undo() {
|
||||||
|
if (this.historyIndex > 0) {
|
||||||
|
this.historyIndex--;
|
||||||
|
this.redrawHistory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
resetDrawing() {
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
this.saveDrawingState();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement all event listeners from previous code here
|
||||||
|
setupEventListeners() {
|
||||||
|
// Camera controls
|
||||||
|
this.startButton.onclick = () => this.startCamera();
|
||||||
|
this.takePhotoButton.onclick = () => this.takePhoto();
|
||||||
|
this.switchButton.onclick = () => this.switchCamera();
|
||||||
|
this.backButton.onclick = () => this.resetToCamera();
|
||||||
|
|
||||||
|
// Drawing controls
|
||||||
|
this.setupDrawingEvents();
|
||||||
|
this.setupToolButtons();
|
||||||
|
|
||||||
|
// Settings changes
|
||||||
|
this.colorPicker.oninput = (e) => this.ctx.strokeStyle = e.target.value;
|
||||||
|
this.brushSize.oninput = (e) => {
|
||||||
|
this.ctx.lineWidth = e.target.value;
|
||||||
|
this.brushSizeValue.textContent = `${e.target.value}px`;
|
||||||
|
};
|
||||||
|
|
||||||
|
// History controls
|
||||||
|
this.undoButton.onclick = () => this.undo();
|
||||||
|
this.resetButton.onclick = () => this.resetDrawing();
|
||||||
|
|
||||||
|
// Save functionality
|
||||||
|
this.saveButton.onclick = () => this.saveAndUpload();
|
||||||
|
|
||||||
|
|
||||||
|
// Text tool modal controls
|
||||||
|
this.confirmTextBtn.onclick = () => {
|
||||||
|
const text = this.textInput.value.trim();
|
||||||
|
if (text) {
|
||||||
|
this.addDraggableText(text);
|
||||||
|
this.textInput.value = '';
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
setupToolButtons() {
|
||||||
|
const toolButtons = document.querySelectorAll('.tool-btn');
|
||||||
|
toolButtons.forEach(button => {
|
||||||
|
button.onclick = () => {
|
||||||
|
toolButtons.forEach(btn => btn.classList.remove('active'));
|
||||||
|
button.classList.add('active');
|
||||||
|
this.currentTool = button.dataset.tool;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement drawing events from previous code here
|
||||||
|
setupDrawingEvents() {
|
||||||
|
// Mouse events
|
||||||
|
this.drawingCanvas.addEventListener('mousedown', (e) => this.startDrawing(e));
|
||||||
|
this.drawingCanvas.addEventListener('mousemove', (e) => this.draw(e));
|
||||||
|
this.drawingCanvas.addEventListener('mouseup', () => this.stopDrawing());
|
||||||
|
this.drawingCanvas.addEventListener('mouseout', () => this.stopDrawing());
|
||||||
|
|
||||||
|
// Touch events
|
||||||
|
this.drawingCanvas.addEventListener('touchstart', (e) => {
|
||||||
|
if (this.shouldPreventDefault(e)) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
const touch = e.touches[0];
|
||||||
|
const mouseEvent = new MouseEvent('mousedown', {
|
||||||
|
clientX: touch.clientX,
|
||||||
|
clientY: touch.clientY
|
||||||
|
});
|
||||||
|
this.startDrawing(mouseEvent);
|
||||||
|
}, {
|
||||||
|
passive: false
|
||||||
|
});
|
||||||
|
|
||||||
|
this.drawingCanvas.addEventListener('touchmove', (e) => {
|
||||||
|
if (this.shouldPreventDefault(e)) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
const touch = e.touches[0];
|
||||||
|
const mouseEvent = new MouseEvent('mousemove', {
|
||||||
|
clientX: touch.clientX,
|
||||||
|
clientY: touch.clientY
|
||||||
|
});
|
||||||
|
this.draw(mouseEvent);
|
||||||
|
}, {
|
||||||
|
passive: false
|
||||||
|
});
|
||||||
|
|
||||||
|
this.drawingCanvas.addEventListener('touchend', () => {
|
||||||
|
this.stopDrawing();
|
||||||
|
}, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement drawing methods from previous code here
|
||||||
|
startDrawing(e) {
|
||||||
|
this.isDrawing = true;
|
||||||
|
const rect = this.drawingCanvas.getBoundingClientRect();
|
||||||
|
const scaleX = this.drawingCanvas.width / rect.width;
|
||||||
|
const scaleY = this.drawingCanvas.height / rect.height;
|
||||||
|
|
||||||
|
this.startX = (e.clientX - rect.left) * scaleX;
|
||||||
|
this.startY = (e.clientY - rect.top) * scaleY;
|
||||||
|
this.lastX = this.startX;
|
||||||
|
this.lastY = this.startY;
|
||||||
|
|
||||||
|
if (this.currentTool === 'brush') {
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.moveTo(this.startX, this.startY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addDraggableText(text) {
|
||||||
|
const textElement = document.createElement('div');
|
||||||
|
textElement.className = 'draggable-text';
|
||||||
|
textElement.style.cssText = `
|
||||||
|
position: absolute;
|
||||||
|
cursor: move;
|
||||||
|
user-select: none;
|
||||||
|
color: ${this.colorPicker.value};
|
||||||
|
font-size: ${this.brushSize.value * 2}px;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Create text span
|
||||||
|
const textSpan = document.createElement('span');
|
||||||
|
textSpan.textContent = text;
|
||||||
|
textElement.appendChild(textSpan);
|
||||||
|
|
||||||
|
// Create delete button
|
||||||
|
const deleteBtn = document.createElement('button');
|
||||||
|
deleteBtn.innerHTML = '×';
|
||||||
|
deleteBtn.style.cssText = `
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: #ff4444;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
line-height: 1;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
`;
|
||||||
|
textElement.appendChild(deleteBtn);
|
||||||
|
|
||||||
|
// Show/hide delete button on hover
|
||||||
|
textElement.addEventListener('mouseenter', () => {
|
||||||
|
deleteBtn.style.opacity = '1';
|
||||||
|
});
|
||||||
|
textElement.addEventListener('mouseleave', () => {
|
||||||
|
deleteBtn.style.opacity = '0';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Delete functionality
|
||||||
|
deleteBtn.addEventListener('click', (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
textElement.remove();
|
||||||
|
this.saveDrawingState();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Center the text initially
|
||||||
|
textElement.style.left = '50%';
|
||||||
|
textElement.style.top = '50%';
|
||||||
|
textElement.style.transform = 'translate(-50%, -50%)';
|
||||||
|
|
||||||
|
// Add drag functionality
|
||||||
|
this.setupDraggableText(textElement);
|
||||||
|
|
||||||
|
this.textOverlay.appendChild(textElement);
|
||||||
|
this.saveDrawingState();
|
||||||
|
}
|
||||||
|
|
||||||
|
setupDraggableText(element) {
|
||||||
|
let isDragging = false;
|
||||||
|
let currentX;
|
||||||
|
let currentY;
|
||||||
|
let initialX;
|
||||||
|
let initialY;
|
||||||
|
let xOffset = 0;
|
||||||
|
let yOffset = 0;
|
||||||
|
|
||||||
|
const dragStart = (e) => {
|
||||||
|
if (this.currentTool === 'text') {
|
||||||
|
const event = e.type === 'mousedown' ? e : e.touches[0];
|
||||||
|
initialX = event.clientX - xOffset;
|
||||||
|
initialY = event.clientY - yOffset;
|
||||||
|
|
||||||
|
if (e.target === element || e.target.parentNode === element) {
|
||||||
|
isDragging = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const drag = (e) => {
|
||||||
|
if (isDragging) {
|
||||||
|
e.preventDefault();
|
||||||
|
const event = e.type === 'mousemove' ? e : e.touches[0];
|
||||||
|
|
||||||
|
currentX = event.clientX - initialX;
|
||||||
|
currentY = event.clientY - initialY;
|
||||||
|
|
||||||
|
xOffset = currentX;
|
||||||
|
yOffset = currentY;
|
||||||
|
|
||||||
|
setTranslate(currentX, currentY, element);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const dragEnd = () => {
|
||||||
|
if (isDragging) {
|
||||||
|
isDragging = false;
|
||||||
|
this.saveDrawingState();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const setTranslate = (xPos, yPos, el) => {
|
||||||
|
el.style.transform = `translate(${xPos}px, ${yPos}px)`;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mouse events
|
||||||
|
element.addEventListener('mousedown', dragStart);
|
||||||
|
document.addEventListener('mousemove', drag);
|
||||||
|
document.addEventListener('mouseup', dragEnd);
|
||||||
|
|
||||||
|
// Touch events
|
||||||
|
element.addEventListener('touchstart', dragStart);
|
||||||
|
document.addEventListener('touchmove', drag);
|
||||||
|
document.addEventListener('touchend', dragEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add this CSS to your stylesheet
|
||||||
|
|
||||||
|
|
||||||
|
draw(e) {
|
||||||
|
if (!this.isDrawing) return;
|
||||||
|
|
||||||
|
const rect = this.drawingCanvas.getBoundingClientRect();
|
||||||
|
const scaleX = this.drawingCanvas.width / rect.width;
|
||||||
|
const scaleY = this.drawingCanvas.height / rect.height;
|
||||||
|
const x = (e.clientX - rect.left) * scaleX;
|
||||||
|
const y = (e.clientY - rect.top) * scaleY;
|
||||||
|
|
||||||
|
switch (this.currentTool) {
|
||||||
|
case 'arrow':
|
||||||
|
// Restore the previous state before drawing new arrow
|
||||||
|
if (this.historyIndex >= 0) {
|
||||||
|
this.redrawHistory();
|
||||||
|
} else {
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
}
|
||||||
|
this.drawArrow(this.startX, this.startY, x, y);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'brush':
|
||||||
|
this.ctx.lineTo(x, y);
|
||||||
|
this.ctx.stroke();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'rectangle':
|
||||||
|
// Restore the previous state before drawing new rectangle
|
||||||
|
if (this.historyIndex >= 0) {
|
||||||
|
this.redrawHistory();
|
||||||
|
} else {
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
}
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.strokeRect(this.startX, this.startY, x - this.startX, y - this.startY);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'circle':
|
||||||
|
// Restore the previous state before drawing new circle
|
||||||
|
if (this.historyIndex >= 0) {
|
||||||
|
this.redrawHistory();
|
||||||
|
} else {
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
}
|
||||||
|
const radius = Math.sqrt(Math.pow(x - this.startX, 2) + Math.pow(y - this.startY, 2));
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.arc(this.startX, this.startY, radius, 0, Math.PI * 2);
|
||||||
|
this.ctx.stroke();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastX = x;
|
||||||
|
this.lastY = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
drawArrow(fromX, fromY, toX, toY) {
|
||||||
|
const headLength = 20;
|
||||||
|
const headAngle = Math.PI / 6;
|
||||||
|
|
||||||
|
// Calculate angle
|
||||||
|
const angle = Math.atan2(toY - fromY, toX - fromX);
|
||||||
|
|
||||||
|
// Draw main line
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.moveTo(fromX, fromY);
|
||||||
|
this.ctx.lineTo(toX, toY);
|
||||||
|
this.ctx.stroke();
|
||||||
|
|
||||||
|
// Draw arrowhead
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.moveTo(toX, toY);
|
||||||
|
this.ctx.lineTo(
|
||||||
|
toX - headLength * Math.cos(angle - headAngle),
|
||||||
|
toY - headLength * Math.sin(angle - headAngle)
|
||||||
|
);
|
||||||
|
this.ctx.moveTo(toX, toY);
|
||||||
|
this.ctx.lineTo(
|
||||||
|
toX - headLength * Math.cos(angle + headAngle),
|
||||||
|
toY - headLength * Math.sin(angle + headAngle)
|
||||||
|
);
|
||||||
|
this.ctx.stroke();
|
||||||
|
}
|
||||||
|
|
||||||
|
startDrawing(e) {
|
||||||
|
this.isDrawing = true;
|
||||||
|
const rect = this.drawingCanvas.getBoundingClientRect();
|
||||||
|
const scaleX = this.drawingCanvas.width / rect.width;
|
||||||
|
const scaleY = this.drawingCanvas.height / rect.height;
|
||||||
|
|
||||||
|
this.startX = (e.clientX - rect.left) * scaleX;
|
||||||
|
this.startY = (e.clientY - rect.top) * scaleY;
|
||||||
|
this.lastX = this.startX;
|
||||||
|
this.lastY = this.startY;
|
||||||
|
|
||||||
|
if (this.currentTool === 'brush') {
|
||||||
|
this.ctx.beginPath();
|
||||||
|
this.ctx.moveTo(this.startX, this.startY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stopDrawing() {
|
||||||
|
if (this.isDrawing) {
|
||||||
|
this.isDrawing = false;
|
||||||
|
if (this.currentTool === 'brush') {
|
||||||
|
this.ctx.closePath();
|
||||||
|
}
|
||||||
|
this.saveDrawingState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
redrawHistory() {
|
||||||
|
if (this.historyIndex >= 0 && this.drawingHistory[this.historyIndex]) {
|
||||||
|
const img = new Image();
|
||||||
|
img.src = this.drawingHistory[this.historyIndex];
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
this.ctx.drawImage(img, 0, 0);
|
||||||
|
} else {
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closeEditor() {
|
||||||
|
if (this.stream) {
|
||||||
|
this.stream.getTracks().forEach(track => track.stop());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear canvases and text overlay
|
||||||
|
this.ctx.clearRect(0, 0, this.drawingCanvas.width, this.drawingCanvas.height);
|
||||||
|
const mainCtx = this.canvas.getContext('2d');
|
||||||
|
mainCtx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||||
|
this.textOverlay.innerHTML = '';
|
||||||
|
|
||||||
|
// Reset state
|
||||||
|
this.drawingHistory = [];
|
||||||
|
this.historyIndex = -1;
|
||||||
|
this.currentInputField = null;
|
||||||
|
|
||||||
|
// Close modals
|
||||||
|
this.cameraModal.hide();
|
||||||
|
this.textInputModal.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override this method in your implementation
|
||||||
|
saveAndUpload() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
closeCamera() {
|
||||||
|
// Stop the video stream
|
||||||
|
if (this.stream) {
|
||||||
|
this.stream.getTracks().forEach(track => track.stop());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide video and canvas elements
|
||||||
|
this.video.style.display = 'none';
|
||||||
|
this.canvas.style.display = 'none';
|
||||||
|
this.drawingCanvas.style.display = 'none';
|
||||||
|
|
||||||
|
|
||||||
|
// Reset any additional state if needed
|
||||||
|
this.stream = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</option>
|
</option>
|
||||||
@else
|
@else
|
||||||
|
|
||||||
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
||||||
|
|
||||||
@foreach ($users->roles as $role)
|
@foreach ($users->roles as $role)
|
||||||
|
|||||||
@@ -527,6 +527,79 @@ Breadcrumbs::for('otorisator.pelaporan.index', function (BreadcrumbTrail $trail)
|
|||||||
$trail->push('Otorisator', route('otorisator.pelaporan.index'));
|
$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',
|
||||||
|
'pembatalan' => 'Pembatalan',
|
||||||
|
'sla' => 'SLA',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($otorisatorSurveyor as $route => $title) {
|
||||||
|
Breadcrumbs::for("otorisator.{$route}", function (BreadcrumbTrail $trail) use ($route, $title) {
|
||||||
|
|
||||||
|
$trail->push($title, route("otorisator.{$route}.index"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Breadcrumbs::for('laporan', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('laporan', function (BreadcrumbTrail $trail) {
|
||||||
$trail->push('Laporan', route('laporan.sederhana.index'));
|
$trail->push('Laporan', route('laporan.sederhana.index'));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -286,9 +286,15 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
'jenis-bangunan' => 'Jenis Bangunan',
|
'jenis-bangunan' => 'Jenis Bangunan',
|
||||||
'kondisi-bangunan' => 'Kondisi Bangunan',
|
'kondisi-bangunan' => 'Kondisi Bangunan',
|
||||||
'sifat-bangunan' => 'Sifat Bangunan',
|
'sifat-bangunan' => 'Sifat Bangunan',
|
||||||
// 'spek-bangunan' => 'Speksifikasi Bangunan',
|
'spek-bangunan' => 'Speksifikasi Bangunan',
|
||||||
// 'spek-kategori-bagunan' => 'Speksifikasi Kategori Bangunan',
|
'spek-kategori-bangunan' => 'Speksifikasi Kategori Bangunan',
|
||||||
'sarana-pelengkap' => 'Sarana Pelengkap',
|
'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) {
|
foreach ($headers as $type => $header) {
|
||||||
|
|||||||
Reference in New Issue
Block a user