Merge pull request 'penambahan basic data surveyor' (#22) from feature/senior-officer into staging
Reviewed-on: #22
This commit is contained in:
@@ -8,7 +8,21 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Branch;
|
||||
use Modules\Lpj\Models\Surveyor;
|
||||
use Modules\Lpj\Models\BentukTanah;
|
||||
use Modules\Lpj\Models\KonturTanah;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Lpj\Models\PosisiKavling;
|
||||
use Modules\Lpj\Models\KondisiFisikTanah;
|
||||
use Modules\Lpj\Models\KetinggianTanah;
|
||||
use Modules\Lpj\Models\SifatBangunan;
|
||||
use Modules\Lpj\Models\JenisBangunan;
|
||||
use Modules\Lpj\Models\KondisiBangunan;
|
||||
use Modules\Lpj\Models\SpekBangunan;
|
||||
use Modules\Lpj\Models\SpekKategoritBangunan;
|
||||
use Modules\Lpj\Models\SaranaPelengkap;
|
||||
use Modules\Lpj\Models\ArahMataAngin;
|
||||
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||
|
||||
class SurveyorController extends Controller
|
||||
{
|
||||
@@ -21,21 +35,7 @@ class SurveyorController extends Controller
|
||||
return view('lpj::surveyor.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
@@ -51,16 +51,46 @@ class SurveyorController extends Controller
|
||||
'debiture.village',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'penilaian'
|
||||
'penilaian',
|
||||
'documents',
|
||||
],
|
||||
)->findOrFail($id);
|
||||
|
||||
$surveyor = $id;
|
||||
$branches = Branch::all();
|
||||
$provinces = Province::all();
|
||||
$bentukTanah = BentukTanah::all();
|
||||
$konturTanah = KonturTanah::all();
|
||||
$posisiKavling = PosisiKavling::all();
|
||||
$ketinggianTanah = KetinggianTanah::all();
|
||||
$kondisiFisikTanah = KondisiFisikTanah::all();
|
||||
$jenisBangunan = JenisBangunan::all();
|
||||
$kondisiBangunan = KondisiBangunan::all();
|
||||
$sifatBangunan = SifatBangunan::all();
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
$spekBangunan = SpekBangunan::all();
|
||||
$saranaPelengkap = SaranaPelengkap::all();
|
||||
$arahMataAngin = ArahMataAngin::all();
|
||||
|
||||
|
||||
return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces'));
|
||||
return view('lpj::surveyor.detail', compact(
|
||||
'permohonan',
|
||||
'surveyor',
|
||||
'branches',
|
||||
'provinces',
|
||||
'bentukTanah',
|
||||
'konturTanah',
|
||||
'posisiKavling',
|
||||
'kondisiFisikTanah',
|
||||
'ketinggianTanah',
|
||||
'kondisiBangunan',
|
||||
'jenisBangunan',
|
||||
'sifatBangunan',
|
||||
'spekKategoriBagunan',
|
||||
'spekBangunan',
|
||||
'saranaPelengkap',
|
||||
'arahMataAngin',
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,7 +268,273 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function data(Request $request)
|
||||
{
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
|
||||
return view('lpj::surveyor.data.index', compact('header'));
|
||||
}
|
||||
|
||||
|
||||
public function createData($type)
|
||||
{
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
return view('lpj::surveyor.data.form', compact('header'));
|
||||
}
|
||||
|
||||
|
||||
public function storeData(SurveyorRequest $request, $type)
|
||||
{
|
||||
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
return redirect()
|
||||
->route('basicdata.'. $type .'.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
$data = $request->all();
|
||||
$data['status'] = true;
|
||||
$modelClass::create($data);
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.' . $type .'.index')
|
||||
->with('success', 'created successfully');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editData($type, $id)
|
||||
{
|
||||
$dataMap = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah', BentukTanah::class],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah', KonturTanah::class],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling', PosisiKavling::class],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah', KetinggianTanah::class],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah', KondisiFisikTanah::class],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan', JenisBangunan::class],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan', KondisiBangunan::class],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan', SifatBangunan::class],
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class],
|
||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::class],
|
||||
];
|
||||
|
||||
|
||||
if (!array_key_exists($type, $dataMap)) {
|
||||
return redirect()->back()->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
[$headers, $routeName, $modelClass] = $dataMap[$type];
|
||||
|
||||
$header = $dataMap[$type] ?? '';
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
return view('lpj::surveyor.data.form', compact('header', 'model'));
|
||||
}
|
||||
|
||||
|
||||
public function updateData(SurveyorRequest $request, $type, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
|
||||
];
|
||||
|
||||
// Check if the provided type exists in the modelClasses
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
return redirect()
|
||||
->route('basicdata.' . $type . '.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
$modelClass = $modelClasses[$type];
|
||||
$model = $modelClass::findOrFail($id);
|
||||
$model->update($validate);
|
||||
|
||||
// Redirect back with a success message
|
||||
return redirect()
|
||||
->route('basicdata.' . $type . '.index')
|
||||
->with('success', 'Updated successfully');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function dataForDatatablesData(Request $request, $type)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_aset.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
|
||||
$models = [
|
||||
'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,
|
||||
// 'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||
// 'Spek Bangunan' => SpekBangunan::class,
|
||||
'Sarana Pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
|
||||
|
||||
if (array_key_exists($type, $models)) {
|
||||
$query = $models[$type]::query();
|
||||
} else {
|
||||
throw new InvalidArgumentException("Invalid type: $type");
|
||||
}
|
||||
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('code', 'LIKE', "%$search%");
|
||||
$q->orWhere('name', 'LIKE', "%$search%");
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = 0 + 1;
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function destroy($id, $type)
|
||||
{
|
||||
try {
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
$model->delete();
|
||||
return response()->json(['success' => true, 'message' => 'deleted successfully']);
|
||||
} catch (ModelNotFoundException $e) {
|
||||
return response()->json(['success' => false, 'message' => 'not found.'], 404);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['success' => false, 'message' => 'Failed to delete.'], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
64
app/Http/Requests/SurveyorRequest.php
Normal file
64
app/Http/Requests/SurveyorRequest.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SurveyorRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules()
|
||||
: array
|
||||
{
|
||||
|
||||
$action = $this->input('action');
|
||||
|
||||
$uniqueTable = [
|
||||
'bentuk-tanah' => 'bentuk_tanah',
|
||||
'kontur-tanah' => 'kontur_tanah',
|
||||
'posisi-kavling' => 'posisi_kavling',
|
||||
'ketinggian-tanah' => 'ketinggian_tanah',
|
||||
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
|
||||
'kondisi-bangunan' => 'kondisi_bangunan',
|
||||
'sifat-bangunan' => 'sifat_bangunan',
|
||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||
'lalu_lintas_lokasi' => 'lalu_lintas_lokasi',
|
||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
||||
];
|
||||
|
||||
|
||||
|
||||
$rules = [
|
||||
'name' => 'required|max:255',
|
||||
|
||||
];
|
||||
|
||||
$id = $this->route('id');
|
||||
|
||||
if ($this->method() == 'PUT' || $this->method() == 'PATCH') {
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code,' . $id;
|
||||
} else {
|
||||
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize()
|
||||
: bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
24
app/Models/BentukTanah.php
Normal file
24
app/Models/BentukTanah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\BentukTanahFactory;
|
||||
|
||||
class BentukTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'bentuk_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
|
||||
protected static function newFactory(): BentukTanahFactory
|
||||
{
|
||||
//return BentukTanahFactory::new();
|
||||
}
|
||||
}
|
||||
22
app/Models/GolonganMasySekitar.php
Normal file
22
app/Models/GolonganMasySekitar.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\GolonganMasySekitarFactory;
|
||||
|
||||
class GolonganMasySekitar extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
protected static function newFactory(): GolonganMasySekitarFactory
|
||||
{
|
||||
//return GolonganMasySekitarFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/JenisBangunan.php
Normal file
23
app/Models/JenisBangunan.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\JenisBangunanFactory;
|
||||
|
||||
class JenisBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
protected static function newFactory(): JenisBangunanFactory
|
||||
{
|
||||
//return JenisBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/KetinggianTanah.php
Normal file
24
app/Models/KetinggianTanah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KetinggianTanahFactory;
|
||||
|
||||
class KetinggianTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ketinggian_tanah';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KetinggianTanahFactory
|
||||
{
|
||||
//return KetinggianTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KondisiBangunan.php
Normal file
23
app/Models/KondisiBangunan.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\KondisiBangunanFactory;
|
||||
|
||||
class KondisiBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kondisi_bangunan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
protected static function newFactory(): KondisiBangunanFactory
|
||||
{
|
||||
//return KondisiBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KondisiFisikTanah.php
Normal file
23
app/Models/KondisiFisikTanah.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\KondisiFisikTanahFactory;
|
||||
|
||||
class KondisiFisikTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kondisi_fisik_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KondisiFisikTanahFactory
|
||||
{
|
||||
//return KondisiFisikTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KonturTanah.php
Normal file
23
app/Models/KonturTanah.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\KonturTanahFactory;
|
||||
|
||||
class KonturTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kontur_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KonturTanahFactory
|
||||
{
|
||||
//return KonturTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/LaluLintasLokasi.php
Normal file
23
app/Models/LaluLintasLokasi.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\LaluLintasLokasiFactory;
|
||||
|
||||
class LaluLintasLokasi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'lalu_lintas_lokasi';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): LaluLintasLokasiFactory
|
||||
{
|
||||
//return LaluLintasLokasiFactory::new();
|
||||
}
|
||||
}
|
||||
22
app/Models/PerkerasanJalan.php
Normal file
22
app/Models/PerkerasanJalan.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PerkerasanJalanFactory;
|
||||
|
||||
class PerkerasanJalan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): PerkerasanJalanFactory
|
||||
{
|
||||
//return PerkerasanJalanFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/PosisiKavling.php
Normal file
24
app/Models/PosisiKavling.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PosisiKavlingFactory;
|
||||
|
||||
class PosisiKavling extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'posisi_kavling';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): PosisiKavlingFactory
|
||||
{
|
||||
//return PosisiKavlingFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SaranaPelengkap.php
Normal file
24
app/Models/SaranaPelengkap.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SaranaPelengkapFactory;
|
||||
|
||||
class SaranaPelengkap extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'sarana_pelengkap';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): SaranaPelengkapFactory
|
||||
{
|
||||
//return SaranaPelengkapFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SifatBangunan.php
Normal file
24
app/Models/SifatBangunan.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SifatBangunanFactory;
|
||||
|
||||
class SifatBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'sifat_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): SifatBangunanFactory
|
||||
{
|
||||
//return SifatBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
31
app/Models/SpekBangunan.php
Normal file
31
app/Models/SpekBangunan.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekBangunanFactory;
|
||||
|
||||
class SpekBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
|
||||
|
||||
public function bangunanKategori(){
|
||||
return $this->belongsTo(SpekKategoriBangunan::class, 'spek_kategori_bangunan_id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): SpekBangunanFactory
|
||||
{
|
||||
//return SpekBangunanFactory::new();
|
||||
}
|
||||
|
||||
}
|
||||
28
app/Models/SpekKategoritBangunan.php
Normal file
28
app/Models/SpekKategoritBangunan.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekKategoritBangunanFactory;
|
||||
|
||||
class SpekKategoritBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_kategori_bangunan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
|
||||
public function bangunan()
|
||||
{
|
||||
return $this->hasMany(SpekBangunan::class, 'spek_kategori_bangunan_id');
|
||||
}
|
||||
protected static function newFactory(): SpekKategoritBangunanFactory
|
||||
{
|
||||
//return SpekKategoritBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
22
app/Models/TingkatKeramaian.php
Normal file
22
app/Models/TingkatKeramaian.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\TingkatKeramaianFactory;
|
||||
|
||||
class TingkatKeramaian extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): TingkatKeramaianFactory
|
||||
{
|
||||
//return TingkatKeramaianFactory::new();
|
||||
}
|
||||
}
|
||||
@@ -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('bentuk_tanah', 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('bentuk_tanah');
|
||||
}
|
||||
};
|
||||
@@ -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('kontur_tanah', 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('kontur_tanah');
|
||||
}
|
||||
};
|
||||
@@ -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('ketinggian_tanah', 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('ketinggian_tanah');
|
||||
}
|
||||
};
|
||||
@@ -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('kontur_jalan', 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('kontur_jalan');
|
||||
}
|
||||
};
|
||||
@@ -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('posisi_kavling', 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('posisi_kavling');
|
||||
}
|
||||
};
|
||||
@@ -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('kondisi_fisik_tanah', 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('kondisi_fisik_tanah');
|
||||
}
|
||||
};
|
||||
@@ -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('jenis_bangunan', 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('jenis_bangunan');
|
||||
}
|
||||
};
|
||||
@@ -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('kondisi_bangunan', 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('kondisi_bangunan');
|
||||
}
|
||||
};
|
||||
@@ -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('sifat_bangunan', 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('sifat_bangunan');
|
||||
}
|
||||
};
|
||||
@@ -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('spek_kategori_bangunan', 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('spek_kategori_bangunan');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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('spek_bangunan', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->foreignId('spek_kategori_bangunan_id')->constrained('spek_kategori_bangunan')->onDelete('cascade');
|
||||
$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::table('spek_bangunan', function (Blueprint $table) {
|
||||
$table->dropForeign(['spek_kategori_bangunan_id']);
|
||||
});
|
||||
Schema::dropIfExists('spek_bangunan');
|
||||
|
||||
}
|
||||
};
|
||||
@@ -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('sarana_pelengkap', 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('sarana_pelengkap');
|
||||
}
|
||||
};
|
||||
@@ -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('perkerasan_jalan', 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('perkerasan_jalan');
|
||||
}
|
||||
};
|
||||
@@ -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('lalu_lintas_lokasi', 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('lalu_lintas_lokasi');
|
||||
}
|
||||
};
|
||||
@@ -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('gol_mas_sekitar', 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('gol_mas_sekitar');
|
||||
}
|
||||
};
|
||||
@@ -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('tingkat_keramaian', 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('tingkat_keramaian');
|
||||
}
|
||||
};
|
||||
78
module.json
78
module.json
@@ -189,7 +189,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin"],
|
||||
"roles": ["administrator", "pemohon-ao", "pemohon-eo", "admin", "surveyor"],
|
||||
"sub": [
|
||||
{
|
||||
"title": "Cabang",
|
||||
@@ -342,7 +342,81 @@
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator", "admin"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": "Bentuk Tanah",
|
||||
"path": "basicdata.bentuk-tanah",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kontur Tanah",
|
||||
"path": "basicdata.kontur-tanah",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Posisi Kavling",
|
||||
"path": "basicdata.posisi-kavling",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Ketinggian Tanah",
|
||||
"path": "basicdata.ketinggian-tanah",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kondisi Fisik Tanah",
|
||||
"path": "basicdata.kondisi-fisik-tanah",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Jenis Bangunan",
|
||||
"path": "basicdata.jenis-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kondisi Bangunan",
|
||||
"path": "basicdata.kondisi-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Sifat Bangunan",
|
||||
"path": "basicdata.sifat-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Sarana Pelengkap",
|
||||
"path": "basicdata.sarana-pelengkap",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -473,95 +473,6 @@
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
{{-- <script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let teamsSelect = document.getElementById('teams_id');
|
||||
let penilaiSelect = document.getElementById('penilaian_id');
|
||||
let surveyorSelect = document.getElementById('surveyor_id');
|
||||
let penilaiSurveyorSelect = document.getElementById('penilai_surveyor_id');
|
||||
|
||||
let selectedSurveyorId = @json($penilaian->surveyor_id ?? null);
|
||||
let selectedPenilaiId = @json($penilaian->penilaian_id ?? null);
|
||||
let selectedPenilaiSurveyorId = @json($penilaian->penilai_surveyor_id ?? null);
|
||||
|
||||
function fetchPenilai(teamId) {
|
||||
penilaiSelect.innerHTML = '<option value="">Pilih Penilai</option>';
|
||||
surveyorSelect.innerHTML = '<option value="">Pilih Surveyor</option>';
|
||||
penilaiSurveyorSelect.innerHTML = '<option value="">Pilih Penilai Surveyor</option>';
|
||||
|
||||
if (teamId) {
|
||||
fetch(`/penilaian/getUserTeams/${teamId}`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((user) => {
|
||||
let optionPenilai = document.createElement('option');
|
||||
let optionSurveyor = document.createElement('option');
|
||||
let optionPenilaiSurveyor = document.createElement('option');
|
||||
|
||||
optionPenilai.value = user.id;
|
||||
optionSurveyor.value = user.id;
|
||||
optionPenilaiSurveyor.value = user.id;
|
||||
|
||||
optionPenilai.text = user.name;
|
||||
optionSurveyor.text = user.name;
|
||||
optionPenilaiSurveyor.text = user.name;
|
||||
|
||||
// Tambahkan pengguna ke semua select
|
||||
penilaiSelect.appendChild(optionPenilai);
|
||||
surveyorSelect.appendChild(optionSurveyor);
|
||||
penilaiSurveyorSelect.appendChild(optionPenilaiSurveyor);
|
||||
|
||||
if (selectedPenilaiId && selectedPenilaiId == user.id) {
|
||||
optionPenilai.selected = true;
|
||||
}
|
||||
if (selectedSurveyorId && selectedSurveyorId == user.id) {
|
||||
optionSurveyor.selected = true;
|
||||
}
|
||||
if (selectedPenilaiSurveyorId && selectedPenilaiSurveyorId == user
|
||||
.id) {
|
||||
optionPenilaiSurveyor.selected = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let noUserOption = document.createElement('option');
|
||||
noUserOption.value = '';
|
||||
noUserOption.text = 'Tidak ada pengguna yang sesuai.';
|
||||
penilaiSelect.appendChild(noUserOption);
|
||||
surveyorSelect.appendChild(noUserOption.cloneNode(true));
|
||||
penilaiSurveyorSelect.appendChild(noUserOption.cloneNode(true));
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching team members:', error);
|
||||
let errorOption = document.createElement('option');
|
||||
errorOption.value = '';
|
||||
errorOption.text = 'Terjadi kesalahan.';
|
||||
penilaiSelect.appendChild(errorOption);
|
||||
surveyorSelect.appendChild(errorOption.cloneNode(true));
|
||||
penilaiSurveyorSelect.appendChild(errorOption.cloneNode(true));
|
||||
});
|
||||
} else {
|
||||
let defaultOption = document.createElement('option');
|
||||
defaultOption.value = '';
|
||||
defaultOption.text = 'Pilih tim terlebih dahulu.';
|
||||
penilaiSelect.appendChild(defaultOption);
|
||||
surveyorSelect.appendChild(defaultOption.cloneNode(true));
|
||||
penilaiSurveyorSelect.appendChild(defaultOption.cloneNode(true));
|
||||
}
|
||||
}
|
||||
|
||||
teamsSelect.addEventListener('change', function() {
|
||||
let teamId = this.value;
|
||||
fetchPenilai(teamId);
|
||||
});
|
||||
|
||||
let selectedTeamId = teamsSelect.value;
|
||||
if (selectedTeamId) {
|
||||
fetchPenilai(selectedTeamId);
|
||||
}
|
||||
});
|
||||
</script> --}}
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
156
resources/views/surveyor/components/apartemen-kantor.blade.php
Normal file
156
resources/views/surveyor/components/apartemen-kantor.blade.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<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">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Unit</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
|
||||
<!-- Luas tanah -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Luas Unit</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luasTanah" value="sesuai">
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luasTanah" value="tidakSesuai">
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Jenis Unit -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Unit</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
|
||||
name="bentuk_tanah">
|
||||
<option value="">Select Jenis Unit</option>
|
||||
@if (isset($bentukTanah))
|
||||
@foreach ($bentukTanah as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<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">Kondidi Unit</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('konturTanah') border-danger bg-danger-light @enderror"
|
||||
name="konturTanah">
|
||||
<option value="">Select Kondidi Unit</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('konturTanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Posisi Unit -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Posisi Unit</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('ketinggianTanah') border-danger bg-danger-light @enderror"
|
||||
name="ketinggianTanah">
|
||||
<option value="">Select Posisi Unit</option>
|
||||
@if (isset($ketinggianTanah))
|
||||
@foreach ($ketinggianTanah as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('ketinggianTanah')
|
||||
<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">Lantai</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('posisiKavling') border-danger bg-danger-light @enderror"
|
||||
name="posisiKavling">
|
||||
<option value="">Select Lantai</option>
|
||||
@if (isset($posisiKavling))
|
||||
@foreach ($posisiKavling as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('posisiKavling')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Kondisi Fisik Tanah -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">View</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
|
||||
name="kondisiFisikTanah">
|
||||
<option value="">Select View</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisiFisikTanah')
|
||||
<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">Bentuk Unit</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
|
||||
name="kondisiFisikTanah">
|
||||
<option value="">Select Bentuk Unit</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisiFisikTanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6,9 +6,20 @@
|
||||
@csrf
|
||||
|
||||
<div class="mt-2">
|
||||
<div class="bg-info border p-6 rounded-lg shadow-lg flex items-center justify-center" style="height: 300px">
|
||||
<iframe src="https://gistaru.atrbpn.go.id/rtronline/" frameborder="0" style="width: 100%; height: 100%;"></iframe>
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Upload Denah</span>
|
||||
</label>
|
||||
<input type="file" name="ruteMenujuLokasi" class="file-input file-input-bordered w-full ">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
384
resources/views/surveyor/components/tanah-bangunan.blade.php
Normal file
384
resources/views/surveyor/components/tanah-bangunan.blade.php
Normal file
@@ -0,0 +1,384 @@
|
||||
<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">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Tanah</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
|
||||
<!-- Luas tanah -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Luas Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luasTanah" value="sesuai">
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luasTanah" value="tidakSesuai">
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<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">Hadap Mata Angin</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
|
||||
name="bentuk_tanah">
|
||||
<option value="">Select Hadap Mata Angin</option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bentuk Tanah -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Bentuk Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
|
||||
name="bentuk_tanah">
|
||||
<option value="">Select Bentuk Tanah</option>
|
||||
@if (isset($bentukTanah))
|
||||
@foreach ($bentukTanah as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<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">Kontur Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('konturTanah') border-danger bg-danger-light @enderror"
|
||||
name="konturTanah">
|
||||
<option value="">Select Kontur Tanah</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('konturTanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Beda Ketinggian Dengan Jalan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Beda Ketinggian Dengan Jalan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('ketinggianTanah') border-danger bg-danger-light @enderror"
|
||||
name="ketinggianTanah">
|
||||
<option value="">Select Ketinggian Dengan Jalan</option>
|
||||
@if (isset($ketinggianTanah))
|
||||
@foreach ($ketinggianTanah as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('ketinggianTanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Kontur Jalan Depan Objek -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kontur Jalan Depan Objek</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="konturJalan" value="menurun">
|
||||
<span class="ml-2">Menurun</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="konturJalan" value="rata">
|
||||
<span class="ml-2">Rata</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<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">Posisi Kavling</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('posisiKavling') border-danger bg-danger-light @enderror"
|
||||
name="posisiKavling">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($posisiKavling))
|
||||
@foreach ($posisiKavling as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('posisiKavling')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Tusuk Sate -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tusuk Sate</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="tusukSate" value="ya">
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="tusukSate" value="tidak">
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Lockland -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Locklande</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="lockland" value="ya">
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="lockland" value="tidak">
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Kondisi Fisik Tanah -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kondisi Fisik Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
|
||||
name="kondisiFisikTanah">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisiFisikTanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Bangunan</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">Luas Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luasTanah" value="sesuai">
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luasTanah" value="tidakSesuai">
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Jenis Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('jenisBangunan') border-danger bg-danger-light @enderror"
|
||||
name="jenisBangunan">
|
||||
<option value="">Select Jenis Bangunan</option>
|
||||
@if (isset($jenisBangunan))
|
||||
@foreach ($jenisBangunan as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('jenisBangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Kondisi Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kondisi Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisiBangunan') border-danger bg-danger-light @enderror"
|
||||
name="kondisiBangunan">
|
||||
<option value="">Select Kondisi Bangunan</option>
|
||||
@if (isset($kondisiBangunan))
|
||||
@foreach ($kondisiBangunan as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisiBangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sifat Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56"> Sifat Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('sifatBangunan') border-danger bg-danger-light @enderror"
|
||||
name="sifatBangunan">
|
||||
<option value="">Select Sifat Bangunan</option>
|
||||
@if (isset($sifatBangunan))
|
||||
@foreach ($sifatBangunan as $item)
|
||||
<option value="{{ $item->name }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sifatBangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Spek Bangunan -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Spek Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
|
||||
@if (@isset($spekKategoriBagunan))
|
||||
@foreach ($spekKategoriBagunan as $item)
|
||||
<div>
|
||||
<label
|
||||
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
|
||||
name="kondisiFisikTanah">
|
||||
<option value="">Select {{ $item->name }}</option>
|
||||
@if (isset($spekBangunan))
|
||||
@foreach ($spekBangunan as $spek)
|
||||
@if ($spek->spek_kategori_bagunan_id == $item->id)
|
||||
<option value="{{ $spek->name }}">{{ $spek->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisiFisikTanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Sarana pelengkap -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Sarana pelengkap</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('saranaPelengkap') border-danger bg-danger-light @enderror"
|
||||
name="saranaPelengkap">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($saranaPelengkap))
|
||||
@foreach ($saranaPelengkap as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('saranaPelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
63
resources/views/surveyor/data/form.blade.php
Normal file
63
resources/views/surveyor/data/form.blade.php
Normal file
@@ -0,0 +1,63 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if (isset($model->id))
|
||||
<form action="{{ route('basicdata.updateData', ['type' => $header[1], 'id' => $model->id]) }}" method="POST">
|
||||
<input type="hidden" name="id" value="{{ $model->id ?? '' }}">
|
||||
@method('PUT')
|
||||
@else
|
||||
<form method="POST" action="{{ route('basicdata.storeData', ['type' => $header[1]]) }}">
|
||||
@endif
|
||||
@csrf
|
||||
<div class="card pb-2.5">
|
||||
<input type="hidden" name="action" value="{{ $header[1] }}">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} {{ $header[0] }}
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('basicdata.' . $header[1] . '.index') }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Code
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $model->code ?? '' }}" >
|
||||
@error('code')
|
||||
<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">
|
||||
Name
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
||||
name="name" value="{{ $model->name ?? '' }}">
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
153
resources/views/surveyor/data/index.blade.php
Normal file
153
resources/views/surveyor/data/index.blade.php
Normal file
@@ -0,0 +1,153 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('surveyor.bentuk-tanah') }}
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="data-table" data-api-url="{{ route('basicdata.datatablesSurveyory', ['type' => $header[0] ]) }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar {{$header[0]}}
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search {{$header[0]}}" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href=""> Export to Excel </a>
|
||||
|
||||
@php
|
||||
$href = route('basicdata.createData', ['type' => $header[1]]);
|
||||
@endphp
|
||||
|
||||
<a class="btn btn-sm btn-primary" href="{{$href}}"> Tambah {{$header[0]}} </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Code </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Aset </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
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, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`basic-data/deleteData/${data}/{{$header[1]}}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#data-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const header = '{{$header[1]}}';
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Code',
|
||||
},
|
||||
name: {
|
||||
title: 'Jenis Aset',
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="basic-data/${header}/${data.id}">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -176,14 +176,7 @@
|
||||
@include('lpj::surveyor.components.data-pembanding')
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="submit" class="btn btn-success">
|
||||
Save
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -357,6 +357,35 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::resource('jenis_laporan', JenisLaporanController::class);
|
||||
// End Activity Jenis Laporan route
|
||||
|
||||
// basic data surveyor
|
||||
Route::get('datatablesSurveyory/{type}', [SurveyorController::class, 'dataForDatatablesData'])->name('datatablesSurveyory');
|
||||
Route::get('createData/{type}', [SurveyorController::class, 'createData'])->name('createData');
|
||||
Route::get('/{type}/{id}', [SurveyorController::class, 'editData'])->name('editData');
|
||||
Route::post('storeData/{type}', [SurveyorController::class, 'storeData'])->name('storeData');
|
||||
Route::put('updateData/{type}/{id}', [SurveyorController::class, 'updateData'])->name('updateData');
|
||||
Route::delete('deleteData/{id}/{type}', [SurveyorController::class, 'destroy'])->name('deleteData');
|
||||
|
||||
$headers = [
|
||||
'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-bagunan' => 'Speksifikasi Kategori Bangunan',
|
||||
'sarana-pelengkap' => 'Sarana Pelengkap',
|
||||
];
|
||||
|
||||
foreach ($headers as $type => $header) {
|
||||
Route::get($type, [SurveyorController::class, 'data'])
|
||||
->name($type . '.index')
|
||||
->defaults('type', $type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -506,6 +535,8 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('denah/{id}', [SurveyorController::class, 'denah'])->name('denah');
|
||||
Route::get('foto/{id}', [SurveyorController::class, 'foto'])->name('foto');
|
||||
Route::get('data-pembanding/{id}', [SurveyorController::class, 'dataPembanding'])->name('data-pembanding');
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user