Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -35,28 +35,41 @@ class ActivityController extends Controller
|
||||
// Ambil user yang sedang login
|
||||
$user = auth()->user();
|
||||
$roles = $user->load('roles');
|
||||
$regionId = null;
|
||||
|
||||
// Cek apakah user memiliki role 'senior officer'
|
||||
if ($roles->roles->pluck('name')->contains('senior officer')) {
|
||||
$regionId = TeamsUsers::with('team.regions')
|
||||
// Inisialisasi regionId dan teamId sebagai null agar bisa dinamis
|
||||
$regionId = null;
|
||||
$teamId = null;
|
||||
|
||||
if ($roles->roles->pluck('name')->contains('senior-officer')) {
|
||||
$userTeam = TeamsUsers::with('team')
|
||||
->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'])
|
||||
->whereHas('team', function ($q) use ($regionId) {
|
||||
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles'])
|
||||
->whereHas('team', function ($q) use ($regionId, $teamId) {
|
||||
if ($regionId) {
|
||||
$q->where('regions_id', $regionId);
|
||||
}
|
||||
if ($teamId) {
|
||||
$q->where('id', $teamId); // Hanya tim yang sama
|
||||
}
|
||||
})
|
||||
->where('user_id', '!=', $user->id)
|
||||
->whereHas('user.roles', function ($query) {
|
||||
// Filter hanya peran 'surveyor' atau 'surveyor-penilai'
|
||||
$query->whereIn('name', ['surveyor', 'surveyor-penilai']);
|
||||
})
|
||||
->get();
|
||||
|
||||
return view('lpj::activity.progres_activity.index', compact('teamsActivity'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function senior()
|
||||
{
|
||||
return view('lpj::activity.senior_officer.index');
|
||||
@@ -106,6 +119,10 @@ class ActivityController extends Controller
|
||||
* Update the specified resource in storage.
|
||||
*/public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
$user = auth()->user();
|
||||
|
||||
|
||||
// Check permissions
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
@@ -157,7 +174,23 @@ class ActivityController extends Controller
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get data
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
$data = null;
|
||||
$userRole = $user->roles[0]->name ?? null;
|
||||
|
||||
if (in_array($userRole, ['surveyor', 'surveyor-penilai'])) {
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian',])
|
||||
->whereHas('penilaian.userPenilai', function ($q) use ($user) {
|
||||
$q->where('user_id', $user->id);
|
||||
})
|
||||
->get();
|
||||
} else {
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])
|
||||
->get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Calculate total pages
|
||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
||||
@@ -194,13 +227,23 @@ class ActivityController extends Controller
|
||||
|
||||
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::with(['permohonan', 'permohonan.debiture', 'permohonan.tujuanPenilaian'])
|
||||
->where(function($q) use ($id) {
|
||||
$q->where('surveyor_id', $id)
|
||||
->orWhere('penilaian_id', $id)
|
||||
->orWhere('penilai_surveyor_id', $id);
|
||||
});
|
||||
$query = Penilaian::with([
|
||||
'permohonan',
|
||||
'permohonan.debiture',
|
||||
'permohonan.tujuanPenilaian',
|
||||
'permohonan.debiture.documents.jenisJaminan',
|
||||
'userPenilai'
|
||||
])
|
||||
->whereHas('userPenilai', function ($q) use ($id) {
|
||||
$q->where('user_id', $id);
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Filter pencarian
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
use Modules\Lpj\Models\JenisJaminan;
|
||||
use Modules\Lpj\Models\JenisLegalitasJaminan;
|
||||
use Modules\Lpj\Models\PemilikJaminan;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
use ZipArchive;
|
||||
|
||||
class DokumenJaminanController extends Controller
|
||||
@@ -223,55 +225,64 @@
|
||||
$document = DokumenJaminan::find($jaminan);
|
||||
$document->update($validate);
|
||||
|
||||
// Get existing detail documents
|
||||
$existingDetails = DetailDokumenJaminan::where('dokumen_jaminan_id', $document->id)->get()->keyBy('id');
|
||||
|
||||
if ($request->detail_dokumen_jaminan_id) {
|
||||
foreach ($request->detail_dokumen_jaminan_id as $key => $value) {
|
||||
if (isset($request->dokumen_jaminan[$key])) {
|
||||
$file = $request->dokumen_jaminan[$key];
|
||||
if ($file) {
|
||||
$file_name = $file->getClientOriginalName();
|
||||
}
|
||||
if($request->jenis_legalitas_jaminan_id){
|
||||
foreach($request->jenis_legalitas_jaminan_id as $key => $value){
|
||||
$detailData = [
|
||||
'dokumen_jaminan_id' => $document->id,
|
||||
'jenis_legalitas_jaminan_id' => $value,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
];
|
||||
|
||||
if (isset($file_name)) {
|
||||
$file->storeAs(
|
||||
'public/jaminan/' . $debitur->id . '/' . $document->id . '/',
|
||||
$file_name,
|
||||
);
|
||||
|
||||
$detail = [
|
||||
'dokumen_jaminan_id' => $document->id,
|
||||
'jenis_legalitas_jaminan_id' => $request->jenis_legalitas_jaminan_id[$key],
|
||||
'dokumen_jaminan' => 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name,
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
];
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailDocument = DetailDokumenJaminan::find(
|
||||
$request->detail_dokumen_jaminan_id[$key],
|
||||
$dokumenJaminan = [];
|
||||
if (isset($request->dokumen_jaminan[$key]) && is_array($request->dokumen_jaminan[$key])) {
|
||||
foreach($request->dokumen_jaminan[$key] as $file) {
|
||||
if ($file) {
|
||||
$file_name = $file->getClientOriginalName();
|
||||
$file->storeAs(
|
||||
'public/jaminan/' . $debitur->id . '/' . $document->id . '/',
|
||||
$file_name
|
||||
);
|
||||
|
||||
$detailDocument->update($detail);
|
||||
$detailDocument->save();
|
||||
$dokumenJaminan[] = 'jaminan/' . $debitur->id . '/' . $document->id . '/' . $file_name;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$detail = [
|
||||
'dokumen_jaminan_id' => $document->id,
|
||||
'jenis_legalitas_jaminan_id' => $request->jenis_legalitas_jaminan_id[$key],
|
||||
'name' => $request->name[$key],
|
||||
'keterangan' => $request->keterangan[$key],
|
||||
];
|
||||
}
|
||||
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailDocument = DetailDokumenJaminan::find(
|
||||
$request->detail_dokumen_jaminan_id[$key],
|
||||
);
|
||||
$detailDocument->update($detail);
|
||||
if (!empty($dokumenJaminan)) {
|
||||
$detailData['dokumen_jaminan'] = json_encode($dokumenJaminan);
|
||||
}
|
||||
|
||||
if (isset($request->detail_dokumen_jaminan_id[$key])) {
|
||||
$detailId = $request->detail_dokumen_jaminan_id[$key];
|
||||
$detailDocument = $existingDetails->get($detailId);
|
||||
if ($detailDocument) {
|
||||
// Merge new files with existing ones
|
||||
if (!empty($dokumenJaminan)) {
|
||||
$existingFiles = json_decode($detailDocument->dokumen_jaminan, true) ?: [];
|
||||
$mergedFiles = array_merge($existingFiles, $dokumenJaminan);
|
||||
$detailData['dokumen_jaminan'] = json_encode($mergedFiles);
|
||||
}
|
||||
$detailDocument->update($detailData);
|
||||
$existingDetails->forget($detailId);
|
||||
}
|
||||
} else {
|
||||
DetailDokumenJaminan::create($detailData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete any remaining existing details that weren't updated
|
||||
foreach ($existingDetails as $detail) {
|
||||
$files = json_decode($detail->dokumen_jaminan, true) ?: [];
|
||||
foreach ($files as $file) {
|
||||
Storage::delete('public/' . $file);
|
||||
}
|
||||
$detail->delete();
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
return redirect()->route('debitur.jaminan.index', $id)->with(
|
||||
'success',
|
||||
@@ -290,13 +301,29 @@
|
||||
) {
|
||||
$document = DokumenJaminan::find($jaminan);
|
||||
$details = DetailDokumenJaminan::where('dokumen_jaminan_id', $document->id)->get();
|
||||
|
||||
$debitur = Debiture::find($document->debiture_id);
|
||||
$provinces = Province::all();
|
||||
$cities = City::where('province_code', $document->province_code)->get();
|
||||
$districts = District::where('city_code', $document->city_code)->get();
|
||||
$villages = Village::where('district_code', $document->district_code)->get();
|
||||
|
||||
|
||||
$jenisJaminan = JenisJaminan::all();
|
||||
$jenisLegalitasJaminan = JenisLegalitasJaminan::all();
|
||||
|
||||
$_jenisJaminan = JenisJaminan::find($document->jenis_jaminan_id);
|
||||
$legalitasJaminan = json_decode($_jenisJaminan->jenis_legalitas_jaminan_id, true);
|
||||
|
||||
$currentLegalitasJaminan = JenisLegalitasJaminan::whereIn('id',$document->detail->pluck('jenis_legalitas_jaminan_id')->toArray())->get();
|
||||
|
||||
|
||||
|
||||
// Remove values from $legalitasJaminan that are in $currentLegalitasJaminan
|
||||
$legalitasJaminan = array_diff($legalitasJaminan, $currentLegalitasJaminan->pluck('code')->toArray());
|
||||
|
||||
$legalitas = JenisLegalitasJaminan::whereIn('code', $legalitasJaminan)->get();
|
||||
|
||||
$pemilikJaminan = PemilikJaminan::where('debiture_id', $document->debiture_id)->get();
|
||||
$hubunganPemilik = HubunganPemilikJaminan::all();
|
||||
|
||||
@@ -314,6 +341,7 @@
|
||||
'villages',
|
||||
'pemilikJaminan',
|
||||
'hubunganPemilik',
|
||||
'legalitas'
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -350,12 +378,16 @@
|
||||
|
||||
if ($zip->open($zipFilePath, ZipArchive::CREATE) === true) {
|
||||
foreach ($documents as $document) {
|
||||
$filePath = storage_path('app/public/' . $document->dokumen_jaminan);
|
||||
if (file_exists($filePath)) {
|
||||
$zip->addFile($filePath, basename($filePath));
|
||||
} else {
|
||||
// Log or display an error message for missing files
|
||||
return redirect()->back()->with('error', 'File not found: ' . $filePath);
|
||||
$files = is_array(json_decode($document->dokumen_jaminan)) ? json_decode($document->dokumen_jaminan) : [$document->dokumen_jaminan];
|
||||
|
||||
foreach ($files as $file) {
|
||||
$filePath = storage_path('app/public/' . $file);
|
||||
if (file_exists($filePath)) {
|
||||
$zip->addFile($filePath, basename($filePath));
|
||||
} else {
|
||||
// Log or display an error message for missing files
|
||||
return redirect()->back()->with('error', 'File not found: ' . $filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
@@ -379,10 +411,11 @@
|
||||
{
|
||||
$dokumen = request()->get('dokumen');
|
||||
$document = DetailDokumenJaminan::find($dokumen);
|
||||
return response()->download(storage_path('app/public/' . $document->dokumen_jaminan));
|
||||
$file = is_array(json_decode($document->dokumen_jaminan)) ? json_decode($document->dokumen_jaminan) : [$document->dokumen_jaminan];
|
||||
return response()->download(storage_path('app/public/' . $file[request()->get('index')]));
|
||||
}
|
||||
|
||||
public function legalitasJaminan($id, $jaminan)
|
||||
public function legalitasJaminan($id)
|
||||
{
|
||||
$jenisJaminan = JenisJaminan::find($id);
|
||||
$legalitasJaminan = $jenisJaminan->jenis_legalitas_jaminan_id;
|
||||
@@ -390,4 +423,60 @@
|
||||
$legalitas = JenisLegalitasJaminan::whereIn('code', json_decode($legalitasJaminan, true))->get();
|
||||
echo json_encode($legalitas);
|
||||
}
|
||||
|
||||
|
||||
public function getLegalitasJaminan($id = 10, $jenisJaminanId = 1) : JsonResponse
|
||||
{
|
||||
|
||||
$jenisJaminan = JenisJaminan::findOrFail($jenisJaminanId);
|
||||
$legalitasJaminan = $jenisJaminan->jenis_legalitas_jaminan_id;
|
||||
$newLegalitasJaminan = JenisLegalitasJaminan::whereIn('code', json_decode($legalitasJaminan, true))->get();
|
||||
|
||||
$existingLegalitas = [];
|
||||
$newLegalitas = [];
|
||||
|
||||
// Create a set of new jenis_legalitas_jaminan_ids for quick lookup
|
||||
$newLegalitasIds = $newLegalitasJaminan->pluck('id')->toArray();
|
||||
|
||||
if($id>0) {
|
||||
$document = DokumenJaminan::findOrFail($id);
|
||||
if ($document && $document->detail) {
|
||||
foreach ($document->detail as $detail) {
|
||||
// Only include existing legalitas if its id is in the new set
|
||||
if (in_array($detail->jenis_legalitas_jaminan_id, $newLegalitasIds)) {
|
||||
$existingLegalitas[] = [
|
||||
'id' => $detail->id,
|
||||
'jenis_legalitas_jaminan_id' => $detail->jenis_legalitas_jaminan_id,
|
||||
'name' => $detail->jenisLegalitasJaminan->name,
|
||||
'dokumen_jaminan' => json_decode($detail->dokumen_jaminan) ?? $detail->dokumen_jaminan,
|
||||
'custom_field' => $detail->jenisLegalitasJaminan->custom_field,
|
||||
'custom_field_type' => $detail->jenisLegalitasJaminan->custom_field_type,
|
||||
'details' => $detail->details,
|
||||
'keterangan' => $detail->keterangan,
|
||||
'is_existing' => true
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($newLegalitasJaminan as $legalitas) {
|
||||
if (!Collection::make($existingLegalitas)->contains('jenis_legalitas_jaminan_id', $legalitas->id)) {
|
||||
$newLegalitas[] = [
|
||||
'id' => null,
|
||||
'jenis_legalitas_jaminan_id' => $legalitas->id,
|
||||
'name' => $legalitas->name,
|
||||
'dokumen_jaminan' => null,
|
||||
'custom_field' => $legalitas->custom_field,
|
||||
'custom_field_type' => $legalitas->custom_field_type,
|
||||
'details' => null,
|
||||
'keterangan' => null,
|
||||
'is_existing' => false
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$combinedLegalitas = array_merge($existingLegalitas, $newLegalitas);
|
||||
return response()->json($combinedLegalitas);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,16 +42,16 @@ class OtorisasiPenawaranController extends Controller
|
||||
$query =PenawaranTender::query()
|
||||
->select('penawaran.*',DB::raw("CONCAT(DATE_FORMAT(penawaran.start_date, '%d %M %Y'), ' - ', DATE_FORMAT(penawaran.end_date, '%d %M %Y')) AS date_range"), 'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->where('penawaran.status','=','persetujuan-penawaran')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
->where('penawaran.status','=','proposal-tender')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
// 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('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
@@ -114,19 +114,19 @@ class OtorisasiPenawaranController extends Controller
|
||||
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$penawaran = PenawaranTender::where('status','=','persetujuan-penawaran')->find($id);
|
||||
|
||||
$penawaran = PenawaranTender::where('status','=','proposal-tender')->find($id);
|
||||
|
||||
if ($penawaran) {
|
||||
$penawarandetailLogs = PenawaranDetailTenderLog::where('penawaran_id',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran_logs.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran_logs.kjpp_rekanan_id')
|
||||
->select('detail_penawaran_logs.*', DB::raw("DATE_FORMAT(detail_penawaran_logs.created_at, '%d-%m-%Y %H:%i') AS created_at2"),'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->get();
|
||||
$penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->get();
|
||||
|
||||
|
||||
if(sizeof($penawarandetailLogs)>0)
|
||||
{
|
||||
$h=0;
|
||||
@@ -139,8 +139,8 @@ class OtorisasiPenawaranController extends Controller
|
||||
}
|
||||
$h++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$i=0;
|
||||
foreach($penawrandetails as $obj)
|
||||
@@ -149,17 +149,17 @@ class OtorisasiPenawaranController extends Controller
|
||||
{
|
||||
$penawrandetails_path = Storage::url($obj->dokumen_persetujuan);
|
||||
$penawrandetails[$i]->dokumen_persetujuan = $penawrandetails_path;
|
||||
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$penawaranString = "";
|
||||
if($penawaran->status)
|
||||
{
|
||||
$penawaranString = convertSlug($penawaran->status);
|
||||
$penawaran->status = $penawaranString;
|
||||
}
|
||||
}
|
||||
|
||||
$kjpp=null;
|
||||
$kjpp = KJPP::pluck('name', 'id');
|
||||
@@ -202,11 +202,11 @@ class OtorisasiPenawaranController extends Controller
|
||||
// update status Penawaran menjadi SPK
|
||||
// update status Permohonan menjadi SPK
|
||||
// insert detail_permohonan_log
|
||||
|
||||
|
||||
PenawaranDetailTender::where('status', 1)
|
||||
->where('penawaran_id', $request->penawaran_id)
|
||||
->whereNotIn('id', [$id])
|
||||
->update(['status' => 2,
|
||||
->update(['status' => 2,
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
]);
|
||||
@@ -228,12 +228,12 @@ class OtorisasiPenawaranController extends Controller
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
]);
|
||||
|
||||
|
||||
// log
|
||||
$detailPenawaran = PenawaranDetailTender::where('penawaran_id', $request->penawaran_id)->get();
|
||||
if(sizeof($detailPenawaran)>0)
|
||||
{
|
||||
|
||||
|
||||
foreach ($detailPenawaran as $model) {
|
||||
array_push($dataDetailPenawaranLog, [
|
||||
'detail_penawaran_id' =>$model->id,
|
||||
@@ -248,12 +248,12 @@ class OtorisasiPenawaranController extends Controller
|
||||
'authorized_at' =>$model->authorized_at,
|
||||
'created_at' =>$model->created_at,
|
||||
'updated_at' =>$model->updated_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'created_by' =>$model->created_by,
|
||||
'updated_by' =>$model->updated_by,
|
||||
'deleted_by' =>$model->deleted_by
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
PenawaranDetailTenderLog::insert($dataDetailPenawaranLog);
|
||||
|
||||
@@ -5,14 +5,18 @@ namespace Modules\Lpj\Http\Controllers;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Http\Requests\PenilaianRequest;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
use Modules\Lpj\Models\PenilaianTeam;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Lpj\Models\TeamsUsers;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class PenilaianController extends Controller
|
||||
{
|
||||
@@ -37,16 +41,95 @@ class PenilaianController extends Controller
|
||||
|
||||
if ($validatedData) {
|
||||
try {
|
||||
$penilaian = Penilaian::create($validatedData);
|
||||
DB::beginTransaction();
|
||||
|
||||
$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([
|
||||
'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'];
|
||||
|
||||
if (isset($validatedData['penilai_surveyor_id'])) {
|
||||
$user_ids[] = $validatedData['penilai_surveyor_id'];
|
||||
} else {
|
||||
$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'];
|
||||
|
||||
if (isset($validatedData['penilai_surveyor_id'])) {
|
||||
$user_ids[] = $validatedData['penilai_surveyor_id'];
|
||||
}else {
|
||||
$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 = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||
$permohonan->update([
|
||||
'status' => 'assign',
|
||||
'status' => $status,
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
} catch (Exception $e) {
|
||||
|
||||
DB::rollBack();
|
||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -63,22 +146,43 @@ class PenilaianController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(PenilaianRequest $request, $id)
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
try {
|
||||
$penilaian = Penilaian::where('nomor_registrasi', $request->nomor_registrasi)->firstOrFail();
|
||||
$penilaian->update($validate);
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||
$permohonan->update([
|
||||
'status' => 'assign',
|
||||
]);
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
$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',
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('penilaian.index', $id)->with('success', 'Penilaian berhasil diubah');
|
||||
} catch (Exception $e) {
|
||||
return redirect()->route('penilaian.index', $id)->with('error', $e->getMessage());
|
||||
}
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||
$permohonan->update([
|
||||
'status' => 'assign',
|
||||
]);
|
||||
DB::commit();
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,42 +191,66 @@ class PenilaianController extends Controller
|
||||
*/
|
||||
public function assignment($id)
|
||||
{
|
||||
$permohonan = Permohonan::with(
|
||||
[
|
||||
'user',
|
||||
'debiture.province',
|
||||
'debiture.city',
|
||||
'debiture.district',
|
||||
'debiture.village',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
],
|
||||
)->findOrFail($id);
|
||||
$permohonan = Permohonan::with([
|
||||
'user',
|
||||
'debiture.province',
|
||||
'debiture.city',
|
||||
'debiture.district',
|
||||
'debiture.village',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
])->findOrFail($id);
|
||||
|
||||
$idPenilaian = $permohonan->jenis_penilaian_id;
|
||||
$idPenilaian = $permohonan->jenis_penilaian_id;
|
||||
$idRegion = $permohonan->region_id;
|
||||
|
||||
$jenisPenilaian = JenisPenilaian::find($idPenilaian);
|
||||
|
||||
$userTeam = Teams::with(['regions', 'teamsUsers.user'])
|
||||
->whereHas('regions', function ($q) use ($idRegion) {
|
||||
$q->where('id', $idRegion);
|
||||
})
|
||||
->get();
|
||||
|
||||
$teamPenilai = Teams::with(['regions', 'teamsUsers', 'teamsUsers.user', ])
|
||||
->whereHas('regions', function ($q) use ($idRegion) {
|
||||
$q->where('id', $idRegion);
|
||||
})->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;
|
||||
foreach ($teamPenilai as $item) {
|
||||
foreach ($userTeam as $item) {
|
||||
$regionName = $item->regions;
|
||||
}
|
||||
// $regionName = $userTeam->first()?->regions->name;
|
||||
|
||||
|
||||
// dd($teamPenilai);
|
||||
|
||||
$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.
|
||||
*/
|
||||
@@ -160,8 +288,9 @@ class PenilaianController extends Controller
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
|
||||
}
|
||||
|
||||
$query = Permohonan::query();
|
||||
@@ -180,6 +309,9 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
$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'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
@@ -202,7 +334,7 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
@@ -222,7 +354,8 @@ class PenilaianController extends Controller
|
||||
|
||||
|
||||
|
||||
public function otorisator(Request $request){
|
||||
public function otorisator(Request $request)
|
||||
{
|
||||
|
||||
$type = $request->route('type');
|
||||
$header = '';
|
||||
@@ -248,7 +381,8 @@ class PenilaianController extends Controller
|
||||
return view('lpj::penilaian.otorisator.index', compact('header'));
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
public function show($id)
|
||||
{
|
||||
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
@@ -272,7 +406,10 @@ class PenilaianController extends Controller
|
||||
$status = 'proses paparan';
|
||||
break;
|
||||
case 'Pembayaran':
|
||||
$status = 'proses pembayaran';
|
||||
$status = 'proses';
|
||||
break;
|
||||
case 'Pembatalan':
|
||||
$status = 'order';
|
||||
break;
|
||||
default:
|
||||
$status = '';
|
||||
@@ -298,7 +435,11 @@ class PenilaianController extends Controller
|
||||
|
||||
|
||||
if (!empty($otorisator)) {
|
||||
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
||||
if ($status == 'proses') {
|
||||
$query->whereIn('status_bayar', ['sudah_bayar', 'belum_bayar']);
|
||||
} else {
|
||||
$query->whereRaw('LOWER(status) = ?', [strtolower($status)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
|
||||
@@ -33,25 +33,20 @@
|
||||
|
||||
public function store(PermohonanRequest $request)
|
||||
{
|
||||
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
try {
|
||||
// Save to database
|
||||
Permohonan::create($validate);
|
||||
return redirect()
|
||||
->route('permohonan.index')
|
||||
->with('success', 'Permohonan created successfully');
|
||||
->route('permohonan.index')->with('success', 'Permohonan created successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('permohonan.create')
|
||||
->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||
->route('permohonan.create')->with('error', 'Failed to create permohonan' . $e->getMessage());
|
||||
}
|
||||
} else {
|
||||
return redirect()
|
||||
->route('permohonan.create')
|
||||
->with('success', 'error naon iye')
|
||||
->withInput();
|
||||
->route('permohonan.create')->with('success', 'error naon iye')->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,19 +108,20 @@
|
||||
public function update(PermohonanRequest $request, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
|
||||
if ($validate) {
|
||||
try {
|
||||
// Update in database
|
||||
$permohonan = Permohonan::find($id);
|
||||
if ($permohonan->status == 'revisi') {
|
||||
$validate['status'] = 'order';
|
||||
}
|
||||
|
||||
$permohonan->update($validate);
|
||||
return redirect()
|
||||
->route('permohonan.index')
|
||||
->with('success', 'Permohonan updated successfully');
|
||||
->route('permohonan.index')->with('success', 'Permohonan updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('permohonan.edit', $id)
|
||||
->with('error', 'Failed to update permohonan');
|
||||
->route('permohonan.edit', $id)->with('error', 'Failed to update permohonan');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,11 +309,12 @@
|
||||
return view('lpj::permohonan.show', compact('permohonan'));
|
||||
}
|
||||
|
||||
public function print($id){
|
||||
public function print($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
return view('lpj::permohonan.print', compact('permohonan'));
|
||||
|
||||
// $pdf = Pdf::loadView('lpj::permohonan.print', compact('permohonan'));
|
||||
// return $pdf->stream();
|
||||
// $pdf = Pdf::loadView('lpj::permohonan.print', compact('permohonan'));
|
||||
// return $pdf->stream();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class ProsesPenawaranController extends Controller
|
||||
|
||||
// Get the data for the current page
|
||||
//$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
$data = $query->with(['tujuanPenilaianKJPP'])->get();
|
||||
$data = $query->with(['tujuanPenilaianKJPP','permohonan','permohonan.debiture'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
@@ -110,13 +110,13 @@ class ProsesPenawaranController extends Controller
|
||||
$id = $request->id;
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
$penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->get();
|
||||
|
||||
|
||||
if ($penawaran) {
|
||||
|
||||
|
||||
$i=0;
|
||||
foreach($penawrandetails as $obj)
|
||||
{
|
||||
@@ -156,11 +156,11 @@ class ProsesPenawaranController extends Controller
|
||||
$dataPenawaranDetail = array();
|
||||
if (request()->ajax()) {
|
||||
$validator = ProsesPenawaranController::rulesEditnya($request, $id);
|
||||
|
||||
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
@@ -174,9 +174,9 @@ class ProsesPenawaranController extends Controller
|
||||
{
|
||||
$file_tmp = $request->file('dokumen_persetujuan');
|
||||
$folderPath = 'uploads/penawaran/';
|
||||
if ($file_tmp->isValid())
|
||||
if ($file_tmp->isValid())
|
||||
{
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$file_name = pathinfo($myFile, PATHINFO_FILENAME); // nama file without extension
|
||||
|
||||
$extension = $file_tmp->getClientOriginalExtension();
|
||||
@@ -205,16 +205,16 @@ class ProsesPenawaranController extends Controller
|
||||
{
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['check_file'] = array("Silahkan upload file");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_error_try_catch'] = array('Proses Penawarn KJPP failed.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_ajax'] = array("no ajax request");
|
||||
@@ -257,57 +257,52 @@ class ProsesPenawaranController extends Controller
|
||||
$dataPenawaran = array();
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
$checkActiveDateRange = checkActiveDateRangePenawaran($id);
|
||||
|
||||
|
||||
// cek masa aktif penawaran
|
||||
if($checkActiveDateRange)
|
||||
{
|
||||
|
||||
$checkKelengkapanDetailKJPP = checkKelengkapanDetailKJPP($id);
|
||||
|
||||
$checkKelengkapanDetailKJPP = checkKelengkapanDetailKJPP($id);
|
||||
if($checkKelengkapanDetailKJPP)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$dataPenawaran = ['status' => 'persetujuan-penawaran',
|
||||
$_updatestatus = ['status' => 'proposal-tender',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
$dataPermohonan = ['status' => 'persetujuan-penawaran',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=', $penawaran->nomor_registrasi)->first();
|
||||
|
||||
$penawaran->update($dataPenawaran);
|
||||
$permohonan->update($dataPermohonan);
|
||||
|
||||
|
||||
$penawaran->update($_updatestatus);
|
||||
$permohonan->update($_updatestatus);
|
||||
|
||||
DB::commit();
|
||||
|
||||
|
||||
$data['message'] ['message_success'] = array('Sukses melakukan Proses Penawaran');
|
||||
$data['status'] = 'success';
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
// dd($e);
|
||||
$data['message'] ['message_error_try_catch'] = array("Gagal melakukan Proses Penawaran");
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['message'] ['cek_kelengkapan_data'] = array("Silahkan lengkapi data KJPP");
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['message'] ['active_date_range'] = array("Penawaran sudah di tutup");
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
@@ -326,12 +321,12 @@ class ProsesPenawaranController extends Controller
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
$detailpenawaran->update($dataDetailPenawaran);
|
||||
$detailpenawaran->update($dataDetailPenawaran);
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['message'] ['message_success'] = array('Sukses delete Penawaran KJPP '.$request->kjppName);
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
$data['status'] = 'error';
|
||||
$data['message'] ['message_error_try_catch'] = array("Gagal delete Penawaran KJPP ".$request->kjppName);
|
||||
}
|
||||
|
||||
@@ -41,16 +41,16 @@ class ProsesPenawaranUlangController extends Controller
|
||||
$query =PenawaranTender::query()
|
||||
->select('penawaran.*',DB::raw("CONCAT(DATE_FORMAT(penawaran.start_date, '%d %M %Y'), ' - ', DATE_FORMAT(penawaran.end_date, '%d %M %Y')) AS date_range"), 'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->where('penawaran.status','=','persetujuan-penawaran')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
->where('penawaran.status','=','proposal-tender')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
// 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('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
@@ -118,11 +118,11 @@ class ProsesPenawaranUlangController extends Controller
|
||||
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$penawaran = PenawaranTender::where('status','=','persetujuan-penawaran')->find($id);
|
||||
|
||||
$penawaran = PenawaranTender::where('status','=','proposal-tender')->find($id);
|
||||
|
||||
if ($penawaran) {
|
||||
$penawrandetails = PenawaranDetailTender::where('penawaran_id','=',$id)
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id', '=', 'detail_penawaran.kjpp_rekanan_id')
|
||||
->select('detail_penawaran.*', 'kjpp.code AS kjpp_code', 'kjpp.name AS kjpp_name')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->get();
|
||||
@@ -143,7 +143,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
$penawaranString = convertSlug($penawaran->status);
|
||||
$penawaran->status = $penawaranString;
|
||||
}
|
||||
}
|
||||
|
||||
$data['penawaran'] = $penawaran;
|
||||
$data['penawrandetails'] = $penawrandetails;
|
||||
@@ -176,7 +176,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// cek masa aktif penawaran
|
||||
@@ -187,7 +187,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
|
||||
|
||||
$dataDetailPenawaranLog = [
|
||||
'detail_penawaran_id' =>$detailpenawaran->id,
|
||||
'kjpp_rekanan_id' =>$detailpenawaran->kjpp_rekanan_id,
|
||||
@@ -201,15 +201,15 @@ class ProsesPenawaranUlangController extends Controller
|
||||
'authorized_at' =>$detailpenawaran->authorized_at,
|
||||
'created_at' =>$detailpenawaran->created_at,
|
||||
'updated_at' =>$detailpenawaran->updated_at,
|
||||
'deleted_at' =>$detailpenawaran->deleted_at,
|
||||
'deleted_at' =>$detailpenawaran->deleted_at,
|
||||
'created_by' =>$detailpenawaran->created_by,
|
||||
'updated_by' =>$detailpenawaran->updated_by,
|
||||
'deleted_by' =>$detailpenawaran->deleted_by
|
||||
|
||||
];
|
||||
|
||||
|
||||
PenawaranDetailTenderLog::create($dataDetailPenawaranLog);
|
||||
|
||||
|
||||
$biaya_penawaran="";
|
||||
if($request->biaya_penawaran)
|
||||
$biaya_penawaran= str_replace(".","",$request->biaya_penawaran);
|
||||
@@ -222,9 +222,9 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
$file_tmp = $request->file('dokumen_persetujuan');
|
||||
$folderPath = 'uploads/penawaran/';
|
||||
if ($file_tmp->isValid())
|
||||
if ($file_tmp->isValid())
|
||||
{
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$myFile=$file_tmp->getClientOriginalName(); // nama file with extension
|
||||
$file_name = pathinfo($myFile, PATHINFO_FILENAME); // nama file without extension
|
||||
|
||||
$extension = $file_tmp->getClientOriginalExtension();
|
||||
@@ -247,9 +247,9 @@ class ProsesPenawaranUlangController extends Controller
|
||||
{
|
||||
$data['status'] = 'error';
|
||||
$data['message']['check_file'] = array("Silahkan upload file");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$detailpenawaran->update($dataDetailPenawaran);
|
||||
|
||||
if($pleaseCommit)
|
||||
@@ -279,7 +279,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
$data['status'] = 'error';
|
||||
$data['message']['active_date_range'] = array("Penawaran sudah di tutup");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -288,7 +288,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
}
|
||||
|
||||
// delete KJPP di detail_penawaran (status di buat 0)
|
||||
public function updateKJPPStatus(Request $request, $id): JsonResponse
|
||||
@@ -316,16 +316,16 @@ class ProsesPenawaranUlangController extends Controller
|
||||
'authorized_at' =>$model->authorized_at,
|
||||
'created_at' =>$model->created_at,
|
||||
'updated_at' =>$model->updated_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'deleted_at' =>$model->deleted_at,
|
||||
'created_by' =>$model->created_by,
|
||||
'updated_by' =>$model->updated_by,
|
||||
'deleted_by' =>$model->deleted_by
|
||||
|
||||
];
|
||||
|
||||
|
||||
PenawaranDetailTenderLog::create($dataDetailPenawaranLog);
|
||||
// log
|
||||
|
||||
|
||||
$data['id']=$id;
|
||||
|
||||
$dataku = ['status' => '0',
|
||||
@@ -333,7 +333,7 @@ class ProsesPenawaranUlangController extends Controller
|
||||
'updated_at' => now()
|
||||
];
|
||||
|
||||
$model->update($dataku);
|
||||
$model->update($dataku);
|
||||
|
||||
DB::commit();
|
||||
$data['status'] = 'success';
|
||||
|
||||
@@ -167,6 +167,8 @@
|
||||
$dataku['jenis_penilaian_id'] =$request->jenis_penilaian;
|
||||
$dataku['region_id'] =$request->region;
|
||||
$dataku['status'] = 'registered';
|
||||
if($request->catatan2)
|
||||
$dataku['registrasi_catatan'] =$request->catatan2;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -27,7 +27,8 @@ use Exception;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
|
||||
class RegistrasiFinalController extends Controller
|
||||
@@ -50,15 +51,15 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
->select('penawaran.*', 'tujuan_penilaian_kjpp.name as tujuan_penilaian_kjpp_name')
|
||||
->leftJoin('tujuan_penilaian_kjpp', 'tujuan_penilaian_kjpp.id','=','penawaran.tujuan_penilaian_kjpp_id')
|
||||
->where('penawaran.status','=','spk')
|
||||
->withCount('penawarandetails');
|
||||
|
||||
->withCount('penawarandetails');
|
||||
|
||||
// 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('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
@@ -84,10 +85,10 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
|
||||
// Get the data for the current page
|
||||
//$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
$data = $query->get();
|
||||
$data = $query->with(['permohonan'])->get();
|
||||
// dd($data);
|
||||
$i=0;
|
||||
foreach($data as $obj)
|
||||
@@ -96,18 +97,18 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
{
|
||||
$data[$i]->tanggal_penilaian_sebelumnya = Carbon::parse($obj->tanggal_penilaian_sebelumnya)->format('d F Y H:i:s');
|
||||
}
|
||||
|
||||
|
||||
if($obj->biaya_kjpp_sebelumnya)
|
||||
{
|
||||
$data[$i]->biaya_kjpp_sebelumnya = formatRupiah($obj->biaya_kjpp_sebelumnya);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// date_range
|
||||
if($obj->start_date && $obj->end_date)
|
||||
{
|
||||
$data[$i]->date_range = Carbon::parse($obj->start_date)->format('d M Y').' - '.Carbon::parse($obj->end_date)->format('d M Y');
|
||||
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
@@ -135,6 +136,13 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
public function show($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
if($permohonan->dokumen)
|
||||
{
|
||||
$pdfSPK_path = Storage::url($permohonan->dokumen);
|
||||
$permohonan->dokumen = $pdfSPK_path;
|
||||
$permohonan->dokumen = '| <a download href="'. $pdfSPK_path.'" class="badge badge-sm badge-outline" target="_blank">Dokumen SPK.pdf <i class="ki-filled ki-cloud-download"></i></a>';
|
||||
}
|
||||
|
||||
return view('lpj::registrasifinal.show', compact('id','permohonan'));
|
||||
}
|
||||
|
||||
@@ -151,7 +159,7 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
if (request()->ajax()) {
|
||||
$id = $request->id;
|
||||
$datas = Permohonan::find($id);
|
||||
|
||||
|
||||
if ($datas) {
|
||||
$penawaran=null;
|
||||
$regions=null;
|
||||
@@ -163,7 +171,13 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
{
|
||||
$penawaranString = convertSlug($penawaran->status);
|
||||
$penawaran->status = $penawaranString;
|
||||
}
|
||||
}
|
||||
|
||||
if($datas->dokumen)
|
||||
{
|
||||
$pdfSPK_path = Storage::url($datas->dokumen);
|
||||
$datas->dokumen = $pdfSPK_path;
|
||||
}
|
||||
|
||||
$data['status'] = 'success';
|
||||
$data['regions'] = $regions;
|
||||
@@ -189,14 +203,14 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
$data = array();
|
||||
$dataPermohonan = array();
|
||||
$dataPenawaran = array();
|
||||
|
||||
|
||||
if (request()->ajax()) {
|
||||
$validator = RegistrasiFinalController::rulesEditnya($request, $id);
|
||||
|
||||
|
||||
if ($validator['fails']) {
|
||||
$data['message'] = $validator['errors'];
|
||||
$data['status'] = 'error';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DB::beginTransaction();
|
||||
@@ -210,18 +224,18 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
'keterangan' => $request->catatan,
|
||||
'authorized_at' => now(),
|
||||
'authorized_status' =>1,
|
||||
'authorized_by' => Auth::id()
|
||||
'authorized_by' => Auth::id()
|
||||
];
|
||||
|
||||
$dataPenawaran = ['status' => 'registrasi-final'];
|
||||
|
||||
|
||||
|
||||
$permohonan = Permohonan::find($id);
|
||||
$penawaran = PenawaranTender::where('nomor_registrasi','=',$permohonan->nomor_registrasi)->first();
|
||||
|
||||
$penawaran = PenawaranTender::where('nomor_registrasi','=',$permohonan->nomor_registrasi)->first();
|
||||
|
||||
$permohonan->update($dataPermohonan);
|
||||
$penawaran->update($dataPenawaran);
|
||||
//
|
||||
//
|
||||
DB::commit();
|
||||
|
||||
$data['status'] = 'success';
|
||||
@@ -232,7 +246,7 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
$data['message']['message_try_catch'] = array('Regitrasi Final '.$permohonan->nomor_registrasi.' failed.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['status'] = 'error';
|
||||
$data['message']['message_ajax'] = array("no ajax request");
|
||||
@@ -245,7 +259,7 @@ use Modules\Lpj\Models\PenawaranTender;
|
||||
public function rulesEditnya($request, $id)
|
||||
{
|
||||
$validate_catatan='';
|
||||
|
||||
|
||||
$validateIt = [
|
||||
// 'name' diambil dari definisi parameter yang di kirim pada POST Data
|
||||
'region' => 'required',
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
// use Modules\Lpj\Exports\TujuanPenilaianExport;
|
||||
// use Modules\Lpj\Http\Requests\TujuanPenilaianRequest;
|
||||
// use Modules\Lpj\Models\TujuanPenilaian;
|
||||
use Carbon\Carbon;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Barryvdh\DomPDF\Facade\Pdf; // https://github.com/barryvdh/laravel-dompdf
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
// use Modules\Lpj\Exports\TujuanPenilaianExport;
|
||||
// use Modules\Lpj\Http\Requests\TujuanPenilaianRequest;
|
||||
// use Modules\Lpj\Models\TujuanPenilaian;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class SpkController extends Controller
|
||||
{
|
||||
@@ -19,10 +27,215 @@
|
||||
return view('lpj::spk.index');
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query =Permohonan::query()->with(['penawaran','penawaran.tujuanPenilaianKjpp'])
|
||||
->where('permohonan.status','=','spk');
|
||||
|
||||
// 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('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('penawaran.tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
|
||||
$q->orWhere('status', '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->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
|
||||
|
||||
$data = $query->get();
|
||||
|
||||
$i=0;
|
||||
foreach($data as $obj)
|
||||
{
|
||||
if($obj->tanggal_penilaian_sebelumnya)
|
||||
{
|
||||
$data[$i]->tanggal_penilaian_sebelumnya = Carbon::parse($obj->tanggal_penilaian_sebelumnya)->format('d F Y H:i:s');
|
||||
}
|
||||
|
||||
if($obj->biaya_kjpp_sebelumnya)
|
||||
{
|
||||
$data[$i]->biaya_kjpp_sebelumnya = formatRupiah($obj->biaya_kjpp_sebelumnya);
|
||||
|
||||
}
|
||||
|
||||
// date_range
|
||||
if($obj->start_date && $obj->end_date)
|
||||
{
|
||||
$data[$i]->date_range = Carbon::parse($obj->start_date)->format('d M Y').' - '.Carbon::parse($obj->end_date)->format('d M Y');
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// 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 viewSpk()
|
||||
{
|
||||
// return Excel::download(new TujuanPenilaianExport, 'tujuan_penilaian.xlsx');
|
||||
|
||||
return view('lpj::spk.view');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$penawaran = PenawaranTender::find($id);
|
||||
// return view('lpj::spk.show', compact('id','permohonan'));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'detail_penawaran.biaya_penawaran as detail_penawaran_biaya_penawaran',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name'
|
||||
)->first();
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
->leftJoin('jenis_jaminan', 'jenis_jaminan.id','=','dokumen_jaminan.jenis_jaminan_id')
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name',
|
||||
'dokumen_jaminan.address as dokumen_jaminan_address');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->first();
|
||||
|
||||
return view('lpj::spk.edit', compact('data', 'penawaran'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id): JsonResponse
|
||||
{
|
||||
// init
|
||||
$data1 = array();
|
||||
$dataPermohonan = array();
|
||||
// data
|
||||
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name'
|
||||
)->first();
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
->leftJoin('jenis_jaminan', 'jenis_jaminan.id','=','dokumen_jaminan.jenis_jaminan_id')
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->first();
|
||||
|
||||
$folderPath = 'uploads/spk/';
|
||||
$extension = '.pdf';
|
||||
$newFileName = "SPK_".$penawaran->nomor_registrasi."_".Auth::user()->id."_".time(). $extension;
|
||||
$newFileNameWithPath = $folderPath . $newFileName;
|
||||
|
||||
// update table permohonan
|
||||
$dataPermohonan=['dokumen' => $newFileNameWithPath];
|
||||
$data->update($dataPermohonan);
|
||||
// update table permohonan
|
||||
|
||||
// pdf path
|
||||
$spkpenawaran_path = Storage::url($newFileNameWithPath);
|
||||
|
||||
$pdf =Pdf::loadView('lpj::spk.documentSPK', compact('data', 'penawaran'));
|
||||
|
||||
$content = $pdf->download()->getOriginalContent();
|
||||
Storage::put('public/'.$newFileNameWithPath,$content);
|
||||
|
||||
$data1['status'] = 'success';
|
||||
$data1['spkpenawaran_path'] = $spkpenawaran_path;
|
||||
$data1['message']['message_success'] = array('Generate SPK PDF successfully');
|
||||
|
||||
return response()->json($data1);
|
||||
}
|
||||
|
||||
public function dokumennya()
|
||||
{
|
||||
// return view('lpj::spk.dokumennya');
|
||||
$id="3";
|
||||
$penawaran = PenawaranTender::leftJoin('detail_penawaran', 'detail_penawaran.penawaran_id','=','penawaran.id')
|
||||
->leftJoin('jenis_laporan', 'jenis_laporan.id','=','penawaran.jenis_laporan_id')
|
||||
->leftJoin('kjpp', 'kjpp.id','=','detail_penawaran.kjpp_rekanan_id')
|
||||
->where('detail_penawaran.status','=',1)
|
||||
->where('penawaran.id','=', $id)
|
||||
->select('penawaran.*', 'detail_penawaran.attachment as attachmentku',
|
||||
'detail_penawaran.biaya_penawaran as detail_penawaran_biaya_penawaran',
|
||||
'kjpp.name as kjpp_name',
|
||||
'kjpp.address as kjpp_address',
|
||||
'jenis_laporan.name as jenis_laporan_name'
|
||||
)->first();
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi','=',$penawaran->nomor_registrasi)
|
||||
->leftJoin('dokumen_jaminan', 'dokumen_jaminan.permohonan_id','=','permohonan.id')
|
||||
->leftJoin('jenis_jaminan', 'jenis_jaminan.id','=','dokumen_jaminan.jenis_jaminan_id')
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name',
|
||||
'dokumen_jaminan.address as dokumen_jaminan_address');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->first();
|
||||
|
||||
return view('lpj::spk.dokumennya', compact('data', 'penawaran'));
|
||||
}
|
||||
|
||||
public function download($id) {
|
||||
$document = Permohonan::find($id);
|
||||
|
||||
return response()->download(storage_path('app/public/' .$document->dokumen));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Branch;
|
||||
@@ -32,9 +33,14 @@ use Modules\Lpj\Models\Denah;
|
||||
use Modules\Lpj\Models\FotoJaminan;
|
||||
use Modules\Lpj\Models\Lingkungan;
|
||||
use Modules\Lpj\Models\LantaiUnit;
|
||||
use Modules\Lpj\Models\Lantai;
|
||||
use Modules\Lpj\Models\ViewUnit;
|
||||
use Modules\Lpj\Models\ObjekJaminan;
|
||||
use Modules\Lpj\Models\RuteJaminan;
|
||||
use Modules\Lpj\Models\AnalisaUnit;
|
||||
use Modules\Lpj\Models\GolonganMasySekitar;
|
||||
use Modules\Lpj\Models\TingkatKeramaian;
|
||||
use Modules\Lpj\Models\LaluLintasLokasi;
|
||||
use Modules\Lpj\Models\SpekBagunanAnalisaDetail;
|
||||
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||
@@ -42,6 +48,7 @@ use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||
class SurveyorController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
@@ -113,6 +120,8 @@ class SurveyorController extends Controller
|
||||
->where('permohonan_id', $id)
|
||||
->get();
|
||||
|
||||
|
||||
|
||||
return view('lpj::surveyor.detail', compact(
|
||||
'buttonDisable',
|
||||
'fotojaminan',
|
||||
@@ -508,6 +517,11 @@ class SurveyorController extends Controller
|
||||
|
||||
$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'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
@@ -552,6 +566,8 @@ class SurveyorController extends Controller
|
||||
{
|
||||
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
|
||||
|
||||
|
||||
|
||||
$branches = Branch::all();
|
||||
$provinces = Province::all();
|
||||
|
||||
@@ -570,6 +586,11 @@ class SurveyorController extends Controller
|
||||
$spekBangunan = SpekBangunan::all();
|
||||
$saranaPelengkap = SaranaPelengkap::all();
|
||||
$arahMataAngin = ArahMataAngin::all();
|
||||
$lantai = Lantai::all();
|
||||
$viewUnit = ViewUnit::all();
|
||||
$golMasySekitar = GolonganMasySekitar::all();
|
||||
$tingkatKeramaian = TingkatKeramaian::all();
|
||||
$laluLintasLokasi = LaluLintasLokasi::all();
|
||||
|
||||
|
||||
$analisa = Analisa::with('analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
|
||||
@@ -597,6 +618,11 @@ class SurveyorController extends Controller
|
||||
'spekBangunan',
|
||||
'saranaPelengkap',
|
||||
'arahMataAngin',
|
||||
'lantai',
|
||||
'viewUnit',
|
||||
'golMasySekitar',
|
||||
'tingkatKeramaian',
|
||||
'laluLintasLokasi'
|
||||
));
|
||||
}
|
||||
|
||||
@@ -625,10 +651,6 @@ class SurveyorController extends Controller
|
||||
$provinces = Province::all();
|
||||
|
||||
$fotoJaminan = FotoJaminan::with(['objekJaminan', 'lantaiUnit' ,'ruteJaminan', 'lingkungan'])->where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
|
||||
// return response()->json([
|
||||
// 'data' => $fotoJaminan,
|
||||
// ]);
|
||||
return view('lpj::surveyor.components.foto', compact('permohonan', 'surveyor', 'branches', 'provinces', 'fotoJaminan'));
|
||||
}
|
||||
|
||||
@@ -658,25 +680,18 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function getHeader(string $type): array
|
||||
{
|
||||
return self::HEADERS[$type] ?? [];
|
||||
}
|
||||
|
||||
public function data(Request $request)
|
||||
{
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
|
||||
$header = $this->getHeader($request->route('type'));
|
||||
return view('lpj::surveyor.data.index', compact('header'));
|
||||
}
|
||||
|
||||
@@ -684,21 +699,9 @@ class SurveyorController extends Controller
|
||||
public function createData($type)
|
||||
{
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
return view('lpj::surveyor.data.form', compact('header'));
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
$header = $this->getHeader($type);
|
||||
return view('lpj::surveyor.data.form', compact('header', 'spekKategoriBagunan'));
|
||||
}
|
||||
|
||||
|
||||
@@ -708,37 +711,37 @@ class SurveyorController extends Controller
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
|
||||
$type = $request->route('type');
|
||||
try {
|
||||
$type = $request->route('type');
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
if (!$modelClass) {
|
||||
return redirect()
|
||||
->route('basicdata.'. $type .'.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
$data = $request->all();
|
||||
$data['status'] = true;
|
||||
if ($type == 'spek-bangunan') {
|
||||
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$data = array_merge($validate, ['status' => true]);
|
||||
$modelClass::create($data);
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.' . $type .'.index')
|
||||
->with('success', 'created successfully');
|
||||
|
||||
} catch (Exeception $e) {
|
||||
|
||||
return response()->json(array('error' => $e->getMessage()), 400);
|
||||
// return redirect()
|
||||
// ->route('basicdata.' . $type .'.index')
|
||||
// ->with('error', $th->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,6 +760,9 @@ class SurveyorController extends Controller
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class],
|
||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::class],
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit', Lantai::class],
|
||||
'view-unit' => ['View Unit', 'view-unit', ViewUnit::class],
|
||||
'gol-mas-sekitar' => ['Golongan Masyarakat Sekitar', 'gol-mas-sekitar', GolonganMasySekitar::class],
|
||||
];
|
||||
|
||||
|
||||
@@ -769,7 +775,13 @@ class SurveyorController extends Controller
|
||||
$header = $dataMap[$type] ?? '';
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
return view('lpj::surveyor.data.form', compact('header', 'model'));
|
||||
if ($type == 'spek-bangunan') {
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return view('lpj::surveyor.data.form', compact('header', 'model', 'spekKategoriBagunan'));
|
||||
}
|
||||
|
||||
|
||||
@@ -777,26 +789,22 @@ class SurveyorController extends Controller
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
];
|
||||
if ($type == 'spek-bangunan') {
|
||||
$validate['spek_kategori_bagunan_id'] = $request->spek_kategori_bagunan_id;
|
||||
|
||||
}
|
||||
|
||||
// Check if the provided type exists in the modelClasses
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
if (!$modelClass) {
|
||||
return redirect()
|
||||
->route('basicdata.' . $type . '.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
$modelClass = $modelClasses[$type];
|
||||
|
||||
|
||||
|
||||
$model = $modelClass::findOrFail($id);
|
||||
$model->update($validate);
|
||||
|
||||
@@ -817,8 +825,6 @@ class SurveyorController extends Controller
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
|
||||
$models = [
|
||||
'Bentuk Tanah' => BentukTanah::class,
|
||||
'Kontur Tanah' => KonturTanah::class,
|
||||
@@ -828,9 +834,14 @@ class SurveyorController extends Controller
|
||||
'Jenis Bangunan' => JenisBangunan::class,
|
||||
'Kondisi Bangunan' => KondisiBangunan::class,
|
||||
'Sifat Bangunan' => SifatBangunan::class,
|
||||
// 'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||
// 'Spek Bangunan' => SpekBangunan::class,
|
||||
'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||
'Spek Bangunan' => SpekBangunan::class,
|
||||
'Sarana Pelengkap' => SaranaPelengkap::class,
|
||||
'Lalu Lintas Depan Lokasi' => LaluLintasLokasi::class,
|
||||
'Tingkat Keramaian' => TingkatKeramaian::class,
|
||||
'Golongan Masyarakat Sekitar' => GolonganMasySekitar::class,
|
||||
'Lantai Unit' => Lantai::class,
|
||||
'View Unit' => ViewUnit::class,
|
||||
];
|
||||
|
||||
|
||||
@@ -840,8 +851,6 @@ class SurveyorController extends Controller
|
||||
throw new InvalidArgumentException("Invalid type: $type");
|
||||
}
|
||||
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
@@ -897,24 +906,13 @@ class SurveyorController extends Controller
|
||||
{
|
||||
try {
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
if (!$modelClass) {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
$model->delete();
|
||||
@@ -948,6 +946,55 @@ class SurveyorController extends Controller
|
||||
->findOrFail($id);
|
||||
}
|
||||
|
||||
public function submitSurveyor(Request $request, $id)
|
||||
{
|
||||
|
||||
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
]);
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('success', 'form surveyor submitted successfully');
|
||||
|
||||
}
|
||||
|
||||
|
||||
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,
|
||||
'spek-bangunan' => SpekBangunan::class,
|
||||
'lantai-unit' => Lantai::class,
|
||||
'view-unit' => ViewUnit::class,
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
private function getCommonData()
|
||||
{
|
||||
return [
|
||||
@@ -964,21 +1011,34 @@ class SurveyorController extends Controller
|
||||
'spekKategoriBangunan' => SpekKategoritBangunan::all(),
|
||||
'spekBangunan' => SpekBangunan::all(),
|
||||
'saranaPelengkap' => SaranaPelengkap::all(),
|
||||
'arahMataAngin' => ArahMataAngin::all()
|
||||
'arahMataAngin' => ArahMataAngin::all(),
|
||||
'lantai' => Lantai::all(),
|
||||
'viewUnit' => ViewUnit::all(),
|
||||
'golMasySekitar' => GolonganMasySekitar::all(),
|
||||
'tingkatKeramaian' => TingkatKeramaian::all(),
|
||||
'laluLintasLokasi' => LaluLintasLokasi::all(),
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function submitSurveyor(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
]);
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('success', 'form surveyor submitted successfully');
|
||||
|
||||
}
|
||||
private const HEADERS = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
'lalu-lintas-lokasi' => ['Lalu Lintas Depan Lokasi', 'lalu-lintas-lokasi'],
|
||||
'tingkat-keramaian' => ['Tingkat Keramaian', 'tingkat-keramaian'],
|
||||
'gol-mas-sekitar' => ['Golongan Masyarakat Sekitar', 'gol-mas-sekitar'],
|
||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan'],
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan'],
|
||||
'lantai-unit' => ['Lantai Unit', 'lantai-unit'],
|
||||
'view-unit' => ['View Unit', 'view-unit'],
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -31,20 +31,25 @@ class TeamsController extends Controller
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
{
|
||||
|
||||
// cek region apakah sudah ada di tabel teams
|
||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||
$region = Regions::whereNotIn('id', $regionTeam)->get();
|
||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||
|
||||
// cek user apakah sudah ada di tabel teams_users
|
||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||
$user = User::whereNotIn('id', $userTeam)
|
||||
->with('roles')
|
||||
->get();
|
||||
$regions = Regions::whereNotIn('id', $regionTeam)->get();
|
||||
|
||||
return view('lpj::teams.form', compact('region', 'user'));
|
||||
}
|
||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||
$usersWithRole = User::whereNotIn('id', $userTeam)
|
||||
->with('roles') // Eager load roles
|
||||
->get();
|
||||
|
||||
$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.
|
||||
@@ -97,16 +102,23 @@ class TeamsController extends Controller
|
||||
{
|
||||
$teams = Teams::find($id);
|
||||
|
||||
|
||||
$region = Regions::all();
|
||||
$regions = Regions::all();
|
||||
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
||||
$user = User::whereNotIn('id', $usedUsers)
|
||||
$usersWithRole = User::whereNotIn('id', $usedUsers)
|
||||
->with('roles')
|
||||
->get();
|
||||
|
||||
|
||||
$user = $usersWithRole->filter(function ($user) {
|
||||
return $user->roles->contains(function ($role) {
|
||||
return $role->name === 'surveyor' || $role->name === 'surveyor-penilai' || $role->name === 'senior-officer';
|
||||
});
|
||||
});
|
||||
|
||||
// Ambil user yang sudah ada di tim ini
|
||||
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
||||
|
||||
return view('lpj::teams.form', compact('teams', 'region', 'user', 'selectedUsers'));
|
||||
return view('lpj::teams.form', compact('teams', 'regions', 'user', 'selectedUsers'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,11 +33,16 @@ class PenilaianRequest extends FormRequest
|
||||
'tanggal_kunjungan' => 'required|max:255',
|
||||
'status' => 'required|string',
|
||||
'nomor_registrasi' => 'required|string',
|
||||
'surveyor_id' => 'nullable|required_without:penilai_surveyor_id',
|
||||
'penilaian_id' => 'nullable|required_without:penilai_surveyor_id',
|
||||
'penilai_surveyor_id' => 'nullable|required_without_all:surveyor_id,penilaian_id',
|
||||
|
||||
'surveyor_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_region_id,penilai_id',
|
||||
'penilai_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_region_id,surveyor_id',
|
||||
'penilai_surveyor_id' => 'nullable',
|
||||
'surveyor_region_id' => 'nullable|required_without_all:penilai_surveyor_id,penilai_region_id,penilai_id,surveyor_id',
|
||||
'penilai_region_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_id,surveyor_id',
|
||||
|
||||
'keterangan' => 'nullable',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
'nomor_registrasi' => 'nullable|string|max:10',
|
||||
'tanggal_permohonan' => 'nullable|date',
|
||||
'user_id' => 'nullable|exists:users,id',
|
||||
'branch_id' => 'required|exists:branches,id',
|
||||
'branch_id' => 'nullable|exists:branches,id',
|
||||
'tujuan_penilaian_id' => 'required|exists:tujuan_penilaian,id',
|
||||
'debiture_id' => 'required|exists:debitures,id',
|
||||
'status' => 'required|string',
|
||||
'status' => 'nullable|string',
|
||||
'jenis_fasilitas_kredit_id' => 'required|exists:jenis_fasilitas_kredit,id',
|
||||
'nilai_plafond_id' => 'required|exists:nilai_plafond,id',
|
||||
'status_bayar' => 'required|string',
|
||||
@@ -49,6 +49,7 @@
|
||||
'tanggal_permohonan' => date('Y-m-d'),
|
||||
'user_id' => auth()->user()->id,
|
||||
'branch_id' => auth()->user()->branch_id,
|
||||
'status' => 'order'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,62 +4,138 @@ namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class SurveyorRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
* Table mapping for different actionszz
|
||||
*/
|
||||
public function rules()
|
||||
: array
|
||||
{
|
||||
|
||||
$action = $this->input('action');
|
||||
|
||||
$uniqueTable = [
|
||||
'bentuk-tanah' => 'bentuk_tanah',
|
||||
'kontur-tanah' => 'kontur_tanah',
|
||||
'posisi-kavling' => 'posisi_kavling',
|
||||
'ketinggian-tanah' => 'ketinggian_tanah',
|
||||
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
|
||||
'kondisi-bangunan' => 'kondisi_bangunan',
|
||||
'jenis-bangunan' => 'jenis_bangunan',
|
||||
'sifat-bangunan' => 'sifat_bangunan',
|
||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||
'lalu_lintas_lokasi' => 'lalu_lintas_lokasi',
|
||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
||||
];
|
||||
|
||||
|
||||
|
||||
$rules = [
|
||||
'name' => 'required|max:255',
|
||||
|
||||
];
|
||||
|
||||
$id = $this->route('id');
|
||||
|
||||
if ($this->method() == 'PUT' || $this->method() == 'PATCH') {
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code,' . $id;
|
||||
} else {
|
||||
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
private const TABLE_MAPPING = [
|
||||
'bentuk-tanah' => 'bentuk_tanah',
|
||||
'kontur-tanah' => 'kontur_tanah',
|
||||
'posisi-kavling' => 'posisi_kavling',
|
||||
'ketinggian-tanah' => 'ketinggian_tanah',
|
||||
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
|
||||
'kondisi-bangunan' => 'kondisi_bangunan',
|
||||
'jenis-bangunan' => 'jenis_bangunan',
|
||||
'sifat-bangunan' => 'sifat_bangunan',
|
||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||
'lalu-lintas-lokasi' => 'lalu_lintas_lokasi',
|
||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
||||
'gol-mas-sekitar' => 'gol_mas_sekitar',
|
||||
'spek-kategori-bangunan' => 'spek_kategori_bangunan',
|
||||
'spek-bangunan' => 'spek_bangunan',
|
||||
'lantai-unit' => 'lantai',
|
||||
'view-unit' => 'view_unit',
|
||||
];
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize()
|
||||
: bool
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return array_merge(
|
||||
$this->getBaseRules(),
|
||||
$this->getActionSpecificRules(),
|
||||
$this->getCodeValidationRules()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get base validation rules
|
||||
*/
|
||||
private function getBaseRules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get action specific validation rules
|
||||
*/
|
||||
private function getActionSpecificRules(): array
|
||||
{
|
||||
$action = $this->input('action');
|
||||
|
||||
return match ($action) {
|
||||
'spek-bangunan' => [
|
||||
'spek_kategori_bangunan_id' => [
|
||||
'required',
|
||||
|
||||
],
|
||||
],
|
||||
// Add more action specific rules here
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code validation rules
|
||||
*/
|
||||
private function getCodeValidationRules(): array
|
||||
{
|
||||
$action = $this->input('action');
|
||||
$table = self::TABLE_MAPPING[$action] ?? null;
|
||||
|
||||
if (!$table) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$rules = ['required', 'max:50'];
|
||||
|
||||
if ($this->isMethod('PUT') || $this->isMethod('PATCH')) {
|
||||
$rules[] = Rule::unique($table, 'code')->ignore($this->route('id'));
|
||||
} else {
|
||||
$rules[] = Rule::unique($table, 'code');
|
||||
}
|
||||
|
||||
return ['code' => $rules];
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom messages for validator errors.
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => 'Nama harus diisi',
|
||||
'name.max' => 'Nama tidak boleh lebih dari 255 karakter',
|
||||
'code.required' => 'Kode harus diisi',
|
||||
'code.max' => 'Kode tidak boleh lebih dari 50 karakter',
|
||||
'code.unique' => 'Kode sudah digunakan',
|
||||
'spek_kategori_bangunan_id.required' => 'Kategori bangunan harus dipilih',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom attributes for validator errors.
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'Nama',
|
||||
'code' => 'Kode',
|
||||
'spek_kategori_bangunan_id' => 'Kategori Bangunan',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,12 @@ class GolonganMasySekitar extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'gol_mas_sekitar';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
|
||||
protected static function newFactory(): GolonganMasySekitarFactory
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ class KondisiBangunan extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code','name'];
|
||||
|
||||
protected static function newFactory(): KondisiBangunanFactory
|
||||
{
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,9 @@ class PenawaranTender extends Model
|
||||
}
|
||||
|
||||
// menambahkan relasi tujuan penilaian KJPP
|
||||
public function tujuanPenilaianKJPP()
|
||||
public function tujuanPenilaianKjpp()
|
||||
{
|
||||
return $this->hasMany(TujuanPenilaianKJPP::class, 'id', 'tujuan_penilaian_kjpp_id');
|
||||
return $this->belongsTo(TujuanPenilaianKJPP::class, 'tujuan_penilaian_kjpp_id','id');
|
||||
}
|
||||
|
||||
public function permohonan()
|
||||
@@ -46,4 +46,6 @@ class PenawaranTender extends Model
|
||||
{
|
||||
return $this->belongsTo(JenisLaporan::class, 'jenis_laporan_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class Penilaian extends Model
|
||||
*/
|
||||
protected $table = 'penilaian';
|
||||
protected $fillable = [
|
||||
'jenis_penilaian_id', 'teams_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi','penilaian_id','surveyor_id','penilai_surveyor_id',
|
||||
'jenis_penilaian_id', 'penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi',
|
||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
@@ -39,23 +39,12 @@ class Penilaian extends Model
|
||||
|
||||
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()
|
||||
{
|
||||
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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->hasMany(Penilaian::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): PenilaianTeamFactory
|
||||
{
|
||||
//return PenilaianTeamFactory::new();
|
||||
}
|
||||
}
|
||||
@@ -84,4 +84,13 @@ class Permohonan extends Base
|
||||
{
|
||||
return $this->hasMany(PenawaranTender::class, 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Regions::class, 'region_id');
|
||||
}
|
||||
|
||||
public function penawaran(){
|
||||
return $this->belongsTo(PenawaranTender::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class SpekBangunan extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code','name','status','spek_kategori_bangunan_id','authorized_status'];
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class SpekKategoritBangunan extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
protected $fillable = ['code','name','status','authorized_status'];
|
||||
|
||||
|
||||
public function bangunan()
|
||||
|
||||
@@ -30,8 +30,8 @@ class Teams extends Model
|
||||
return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
return $this->hasMany(Penilaian::class, 'teams_id', 'id');
|
||||
public function penilaianTeam(){
|
||||
return $this->hasMany(PenilaianTeam::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ class TingkatKeramaian extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tingkat_keramaian';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
|
||||
23
app/Models/ViewUnit.php
Normal file
23
app/Models/ViewUnit.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\ViewUnitFactory;
|
||||
|
||||
class ViewUnit extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'view_unit';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['name', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'code'];
|
||||
|
||||
protected static function newFactory(): ViewUnitFactory
|
||||
{
|
||||
//return ViewUnitFactory::new();
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ return new class extends Migration
|
||||
$table->unsignedBigInteger('permohonan_id');
|
||||
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
||||
$table->string('luas');
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -18,7 +18,7 @@ return new class () extends Migration {
|
||||
|
||||
$table->string('foto_denah');
|
||||
$table->string('luas');
|
||||
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -16,7 +16,7 @@ return new class () extends Migration {
|
||||
$table->foreign('permohonan_id')->references('id')->on('permohonan');
|
||||
|
||||
$table->string('pendamping');
|
||||
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -19,6 +19,7 @@ return new class () extends Migration {
|
||||
$table->string('name');
|
||||
$table->string('foto_objek');
|
||||
|
||||
$table->unsignedBigInteger('jenis_jaminan_id');
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('lantai', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->boolean('status')->default(true);
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('lokasi_unit');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('view_unit', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique()->index();
|
||||
$table->string('name');
|
||||
$table->boolean('status')->default(true);
|
||||
$table->char('authorized_status', 1)->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('authorized_at')->nullable();
|
||||
$table->unsignedBigInteger('authorized_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('view_unit');
|
||||
}
|
||||
};
|
||||
@@ -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');
|
||||
}
|
||||
};
|
||||
106
module.json
106
module.json
@@ -89,6 +89,15 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "SPK",
|
||||
"path": "spk",
|
||||
"icon": "ki-filled ki-file-added text-lg",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator", "admin"]
|
||||
},
|
||||
{
|
||||
"title": "Registrasi Final",
|
||||
"path": "registrasifinal",
|
||||
@@ -141,7 +150,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["senior-officer"]
|
||||
"roles": ["administrator","senior-officer"]
|
||||
},
|
||||
{
|
||||
"title": "Otorisator",
|
||||
@@ -150,7 +159,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["senior-officer"],
|
||||
"roles": ["administrator","senior-officer"],
|
||||
"sub": [
|
||||
{
|
||||
"title": "Pelaporan",
|
||||
@@ -158,7 +167,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["senior-officer"]
|
||||
"roles": ["administrator","senior-officer"]
|
||||
},
|
||||
{
|
||||
"title": "Pembayaran",
|
||||
@@ -166,7 +175,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["senior-officer"]
|
||||
"roles": ["administrator","senior-officer"]
|
||||
},
|
||||
{
|
||||
"title": "Pembatalan",
|
||||
@@ -174,7 +183,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["senior-officer"]
|
||||
"roles": ["administrator","senior-officer"]
|
||||
},
|
||||
{
|
||||
"title": "SLA",
|
||||
@@ -182,7 +191,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["senior-officer"]
|
||||
"roles": ["administrator","senior-officer"]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -193,7 +202,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
|
||||
{
|
||||
@@ -218,7 +227,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Laporan",
|
||||
@@ -430,12 +439,12 @@
|
||||
"roles": ["administrator", "admin"]
|
||||
},
|
||||
{
|
||||
"title": "Bentuk Tanah",
|
||||
"title": "Bentuk",
|
||||
"path": "basicdata.bentuk-tanah",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kontur Tanah",
|
||||
@@ -443,7 +452,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Posisi Kavling",
|
||||
@@ -451,7 +460,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Ketinggian Tanah",
|
||||
@@ -459,7 +468,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kondisi Fisik Tanah",
|
||||
@@ -467,7 +476,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Jenis Bangunan",
|
||||
@@ -475,7 +484,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kondisi Bangunan",
|
||||
@@ -483,7 +492,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Sifat Bangunan",
|
||||
@@ -491,7 +500,7 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
|
||||
{
|
||||
@@ -500,8 +509,67 @@
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["surveyor"]
|
||||
}
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Lalu Lintas Sekitar",
|
||||
"path": "basicdata.lalu-lintas-lokasi",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Tingkat Keramaian",
|
||||
"path": "basicdata.tingkat-keramaian",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Masyarakat Sekitar",
|
||||
"path": "basicdata.gol-mas-sekitar",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Lantai Unit",
|
||||
"path": "basicdata.lantai-unit",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "View unit",
|
||||
"path": "basicdata.view-unit",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Spesifikasi Bangunan",
|
||||
"path": "basicdata.spek-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
},
|
||||
{
|
||||
"title": "Kategori Speksikasi Bangunan",
|
||||
"path": "basicdata.spek-kategori-bangunan",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": ["administrator","surveyor"]
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -46,14 +46,14 @@
|
||||
@php
|
||||
|
||||
$sortedTeamsActivity = $teamsActivity->sortBy(function ($item) {
|
||||
return $item->team->penilaian
|
||||
->filter(function ($penilaian) use ($item) {
|
||||
return $penilaian->penilaian_id == $item->user->id ||
|
||||
$penilaian->surveyor_id == $item->user->id ||
|
||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
||||
|
||||
return $item->team->penilaianTeam
|
||||
->filter(function ($penilaianTeam) use ($item) {
|
||||
return $penilaianTeam->user_id == $item->user->id;
|
||||
})
|
||||
->count();
|
||||
});
|
||||
|
||||
@endphp
|
||||
|
||||
@foreach ($sortedTeamsActivity as $index => $item)
|
||||
@@ -70,11 +70,9 @@
|
||||
<th class="min-w-[150px]">
|
||||
<span class="text-base text-gray-900 font-normal">
|
||||
@php
|
||||
$totalTasks = $item->team->penilaian
|
||||
->filter(function ($penilaian) use ($item) {
|
||||
return $penilaian->penilaian_id == $item->user->id ||
|
||||
$penilaian->surveyor_id == $item->user->id ||
|
||||
$penilaian->penilai_surveyor_id == $item->user->id;
|
||||
$totalTasks = $item->team->penilaianTeam
|
||||
->filter(function ($penilaianTeam) use ($item) {
|
||||
return $penilaianTeam->user_id == $item->user->id;
|
||||
})
|
||||
->count();
|
||||
@endphp
|
||||
@@ -156,8 +154,6 @@
|
||||
const apiUrl = accordion.querySelector('.card-grid').getAttribute(
|
||||
'data-api-url');
|
||||
|
||||
console.log("This is the API URL: " + apiUrl);
|
||||
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
@@ -180,7 +176,7 @@
|
||||
},
|
||||
jenis_asset: {
|
||||
title: 'Jenis Asset',
|
||||
render: (item, data) => `${data.jenis_asset || ''}`,
|
||||
render: (item, data) => `${data.permohonan.debiture.documents.map(d => d.jenis_jaminan.name) || ''}`,
|
||||
},
|
||||
jenis_report: {
|
||||
title: 'Jenis Report',
|
||||
|
||||
@@ -69,16 +69,28 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-3 max-w-[100px]">
|
||||
<td class="py-3 max-w-[100px] align-top" >
|
||||
Dokumen Jaminan
|
||||
</td>
|
||||
<td class="py-3 text-gray-700 text-2sm font-normal">
|
||||
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download',['id'=>$permohonan->debiture->id,'dokumen'=>$detail->id]) }}" class="badge badge-sm badge-outline mt-2 badge-info"><i class="ki-filled ki-cloud-download mr-2"></i> Download</a>
|
||||
) @endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($detail->dokumen_jaminan) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endif
|
||||
<span class="badge badge-sm badge-outline badge-warning mt-2" onclick="viewPDF('{{ Storage::url($dokumen_jaminan[$index]) }}')"><i class="ki-filled ki-eye mr-2"></i>Preview</span>
|
||||
<br>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -132,41 +132,57 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($document->id))
|
||||
@foreach($document->detail as $detail)
|
||||
<input type="hidden" name="detail_dokumen_jaminan_id[]" value="{{ $detail->id }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nama Dokumen">
|
||||
<div id="doctainer" class="grid gap-5">
|
||||
@if(isset($document->id))
|
||||
@php $n = 0; @endphp
|
||||
@foreach($document->detail as $detail)
|
||||
<input type="hidden" name="detail_dokumen_jaminan_id[]" value="{{ $detail->id }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $detail->jenis_legalitas_jaminan_id }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[]" value="">
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
<a href="{{ route('debitur.jaminan.download',['id'=>$debitur->id,'dokumen'=>$detail->id]) }}" class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
|
||||
<i class="ki-filled ki-cloud-download"></i></a>
|
||||
@endif
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="{{ $detail->name ?? "" }}" placeholder="Nama Dokumen">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@php $custom_field = json_decode($detail->details,true) @endphp
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" multiple>
|
||||
<button type="button" class="btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
|
||||
</div>
|
||||
<div id="additional-files-{{ $n }}"></div>
|
||||
</div>
|
||||
|
||||
@if(isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) ? json_decode($detail->dokumen_jaminan) : [$detail->dokumen_jaminan];
|
||||
@endphp
|
||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||
<a href="{{ route('debitur.jaminan.download', ['id' => $debitur->id, 'dokumen' => $detail->id, 'index' => $index]) }}"
|
||||
class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
{{ basename($dokumen) }}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($detail->details)
|
||||
@php $custom_field = json_decode($detail->details,true) @endphp
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
|
||||
@@ -175,21 +191,103 @@
|
||||
<input class="input" type="text" name="custom_field[][$detail->jenisLegalitasJaminan->custom_field]" value="{{ $custom_field[$detail->jenisLegalitasJaminan->custom_field] }}">
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
@if($detail->jenisLegalitasJaminan->custom_field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ str_replace('_',' ',$detail->jenisLegalitasJaminan->custom_field) }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if($detail->jenisLegalitasJaminan->custom_field_type === "text")
|
||||
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "number")
|
||||
<input class="input" type="number" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "date")
|
||||
<input class="input" type="date" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@elseif($detail->jenisLegalitasJaminan->custom_field_type === "textarea")
|
||||
<textarea class="textarea" rows="3" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2"></textarea>
|
||||
@else
|
||||
<input class="input" type="text" name="custom_field[][{{$detail->jenisLegalitasJaminan->custom_field}}]" placeholder="... M2">
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]">{{ $detail->keterangan ?? "" }}</textarea>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]">{{ $detail->keterangan ?? "" }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@endforeach
|
||||
@foreach($legalitas as $item)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
{{ $n + 1 }}. {{ $item->name }}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value=" {{ $item->id }}">
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="doctainer" class="grid gap-5">
|
||||
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nama Dokumen">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col w-full gap-2" id="file-container-{{$n}}">
|
||||
<div class="flex items-center gap-2">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[{{ $n }}][]" multiple>
|
||||
<button type="button" class="btn btn-primary w-[100px] text-center" onclick="addFileInput({{ $n }})">Add More</button>
|
||||
</div>
|
||||
<div id="additional-files-{{ $n }}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($item->custom_field)
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
{{ str_replace('_',' ',$item->custom_field) }}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if($item->custom_field_type === "text")
|
||||
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@elseif($item->custom_field_type === "number")
|
||||
<input class="input" type="number" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@elseif($item->custom_field_type === "date")
|
||||
<input class="input" type="date" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@elseif($item->custom_field_type === "textarea")
|
||||
<textarea class="textarea" rows="3" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2"></textarea>
|
||||
@else
|
||||
<input class="input" type="text" name="custom_field[][{{$item->custom_field}}]" placeholder="... M2">
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@php $n++; @endphp
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -311,13 +409,13 @@
|
||||
@push('scripts')
|
||||
{{--Pemilik Jaminan--}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const namaSertifikatDiv = document.getElementById("nama_sertifikat");
|
||||
|
||||
// Function to add delete event listeners to existing buttons
|
||||
function addDeleteListeners() {
|
||||
document.querySelectorAll(".delete-button").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
button.addEventListener("click", function () {
|
||||
this.closest(".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5").remove();
|
||||
});
|
||||
});
|
||||
@@ -326,7 +424,7 @@
|
||||
// Add delete listeners to existing buttons
|
||||
addDeleteListeners();
|
||||
|
||||
document.getElementById("tambah_sertifikat").addEventListener("click", function() {
|
||||
document.getElementById("tambah_sertifikat").addEventListener("click", function () {
|
||||
const newDiv = document.createElement("div");
|
||||
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
|
||||
newDiv.innerHTML = `
|
||||
@@ -367,11 +465,14 @@
|
||||
<script>
|
||||
function getLegalitasJaminan() {
|
||||
var legalitasJaminan = document.getElementById("jenis_jaminan_id").value;
|
||||
var url = "/basic-data/jenis-jaminan/legalitas/" + legalitasJaminan;
|
||||
var documentId = "{{ $document->id ?? "0" }}";
|
||||
var debiturId = "{{ $debitur->id }}";
|
||||
var url = `/basic-data/jenis-jaminan/legalitas/${documentId}/${legalitasJaminan}`;
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
"Content-Type": "application/json",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
@@ -385,66 +486,128 @@
|
||||
doctainer.innerHTML = "";
|
||||
data.forEach((item, index) => {
|
||||
doctainer.innerHTML += `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
${index + 1}. ${item.name}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.id}">
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input " type="text" id="name" name="name[]" value="" placeholder="Nama Dokumen">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 font-bold">
|
||||
${index + 1}. ${item.name}
|
||||
</label>
|
||||
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}">
|
||||
${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[]" value="">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama Dokumen
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="text" name="name[]" value="${item.name || ''}" placeholder="Nama Dokumen">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
${item.custom_field && item.custom_field.length > 0 ? `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${item.custom_field.replace(/_/g, " ")}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${item.custom_field_type === "text" ? `
|
||||
<input class="input" type="text" name="custom_field[][${item.custom_field}]">
|
||||
` : item.custom_field_type === "number" ? `
|
||||
<input class="input" type="number" name="custom_field[][${item.custom_field}]">
|
||||
` : item.custom_field_type === "date" ? `
|
||||
<input class="input" type="date" name="custom_field[][${item.custom_field}]">
|
||||
` : item.custom_field_type === "textarea" ? `
|
||||
<textarea class="textarea" rows="3" name="custom_field[][${item.custom_field}]"></textarea>
|
||||
` : `
|
||||
<input class="input" type="text" name="custom_field[][${item.custom_field}]">
|
||||
`}
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Dokumen Jaminan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
|
||||
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id) : ''}
|
||||
<div class="flex items-center gap-2 my-2 w-full">
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[${index}][]" multiple>
|
||||
<button type="button" class="btn btn-primary w-[100px] text-center" onclick="addFileInput(${index})">Add File</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
` : ""}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" type="number" name="keterangan[]"></textarea>
|
||||
${item.custom_field ? `
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 capitalize">
|
||||
${item.custom_field.replace(/_/g, " ")}
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)}
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
` : ''}
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Keterangan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error);
|
||||
// Handle the error here
|
||||
});
|
||||
.catch(error => console.error('Error:', error));
|
||||
}
|
||||
|
||||
function renderExistingFiles(dokumenJaminan, debiturId, itemId) {
|
||||
if (typeof dokumenJaminan === 'string') {
|
||||
return `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
${dokumenJaminan.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`;
|
||||
} else if (Array.isArray(dokumenJaminan)) {
|
||||
return dokumenJaminan.map(file => `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${encodeURIComponent(file)}" class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`).join('');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function addFileInput(index) {
|
||||
const container = document.getElementById(`file-container-${index}`);
|
||||
const newInput = document.createElement('div');
|
||||
newInput.className = 'flex items-center gap-2 mb-2 w-full';
|
||||
newInput.innerHTML = `
|
||||
<input class="file-input" type="file" name="dokumen_jaminan[${index}][]" multiple>
|
||||
<button type="button" class="btn btn-danger w-[100px] text-center" onclick="removeFileInput(this)">Remove</button>
|
||||
`;
|
||||
container.appendChild(newInput);
|
||||
}
|
||||
|
||||
function removeFileInput(button) {
|
||||
button.closest('.flex.items-center.gap-2.mb-2').remove();
|
||||
}
|
||||
|
||||
function renderExistingFiles(dokumenJaminan, debiturId, itemId) {
|
||||
if (typeof dokumenJaminan === 'string') {
|
||||
return `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="badge badge-sm badge-outline mt-2">
|
||||
${dokumenJaminan.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`;
|
||||
} else if (Array.isArray(dokumenJaminan)) {
|
||||
return dokumenJaminan.map(file => `
|
||||
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="badge badge-sm badge-outline mt-2 mr-2">
|
||||
${file.split('/').pop()}
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a>
|
||||
`).join('');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function getCustomFieldInput(type, fieldName, value) {
|
||||
value = value ? JSON.parse(value)[fieldName] || '' : '';
|
||||
switch (type) {
|
||||
case "text":
|
||||
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
case "number":
|
||||
return `<input class="input" type="number" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
case "date":
|
||||
return `<input class="input" type="date" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
case "textarea":
|
||||
return `<textarea class="textarea" rows="3" name="custom_field[][${fieldName}]">${value}</textarea>`;
|
||||
default:
|
||||
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -183,15 +183,14 @@
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang Dilakukan oleh
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="nomor_registrasi"
|
||||
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input"
|
||||
type="hidden" name="jenis_penilaian_id" value="{{ $jenisPenilaian->id }}"
|
||||
>
|
||||
<input class="input" type="hidden" name="jenis_penilaian_id"
|
||||
value="{{ $jenisPenilaian->id }}">
|
||||
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $jenisPenilaian->name }}"
|
||||
readonly>
|
||||
type="text" value="{{ $jenisPenilaian->name }}" readonly>
|
||||
@error('jenis_penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
@@ -203,9 +202,7 @@
|
||||
Tim Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input"
|
||||
type="hidden" name="teams_id" value="{{ $regionName->id }}"
|
||||
>
|
||||
<input class="input" type="hidden" name="teams_id" value="{{ $regionName->id }}">
|
||||
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $regionName->name }}" readonly>
|
||||
@error('teams_id')
|
||||
@@ -214,62 +211,217 @@
|
||||
</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">
|
||||
Surveyor yang di tunjuk
|
||||
Pilih Surveyor dan Penilai
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="surveyor_id" name="surveyor_id"
|
||||
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="input-group w-full">
|
||||
<select id="surveyor_selection" name="surveyor_selection"
|
||||
class="tomselect input @error('surveyor_selection') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
<option value="penilai_dan_surveyor">Penilai dan Surveyor Sama</option>
|
||||
<option value="berbeda">Berbeda</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@error('surveyor_id')
|
||||
@error('surveyor_selection')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="penilaian_id" name="penilaian_id"
|
||||
class="input tomselect @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('penilaian_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
<div id="same_surveyor_penilai" class="hidden">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor dan Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="input-group w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
@foreach ($teamPenilai as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Surveyor dan penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
|
||||
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
|
||||
<option value="">Pilih Surveyor dan Penilai</option>
|
||||
@foreach ($teamPenilai->first()->teamsUsers as $item)
|
||||
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('penilai_surveyor_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
<div id="different_surveyor_penilai" class="{{ $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">
|
||||
<label class="form-label max-w-56">
|
||||
Jadwal Kunjungan
|
||||
@@ -307,16 +459,9 @@
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -376,8 +521,57 @@
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
document.getElementById('surveyor_selection').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const sameSurveyorPenilai = document.getElementById('same_surveyor_penilai');
|
||||
const differentSurveyorPenilai = document.getElementById('different_surveyor_penilai');
|
||||
|
||||
if (selectedValue === 'penilai_dan_surveyor') {
|
||||
sameSurveyorPenilai.classList.remove('hidden');
|
||||
differentSurveyorPenilai.classList.add('hidden');
|
||||
} else if (selectedValue === 'berbeda') {
|
||||
sameSurveyorPenilai.classList.add('hidden');
|
||||
differentSurveyorPenilai.classList.remove('hidden');
|
||||
|
||||
} else {
|
||||
sameSurveyorPenilai.classList.add('hidden');
|
||||
differentSurveyorPenilai.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('surveyor_id').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const surveyorRegion = document.getElementById('surveyorRegion');
|
||||
|
||||
if (selectedValue === 'pilih_dari_region') {
|
||||
surveyorRegion.classList.remove('hidden');
|
||||
surveyorRegion.classList.add('flex');
|
||||
} else {
|
||||
surveyorRegion.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('penilai_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() {
|
||||
const revisiForm = document.getElementById('revisiForm');
|
||||
const btnSubmit = document.getElementById('btnSubmit');
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('penilaian') }}
|
||||
@endsection --}}
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('otorisator.'. strtolower($header)) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@@ -57,10 +57,7 @@
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</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>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -86,10 +83,48 @@
|
||||
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script>
|
||||
function otorisator(){
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`permohonan/${data}`, {
|
||||
type: 'POST'
|
||||
}).then((response) => {
|
||||
swal.fire('eddited!', 'Pelaporan has been edited.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="module">
|
||||
const element = document.querySelector('#permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
@@ -135,9 +170,6 @@
|
||||
return `${data.tujuan_penilaian.name}`;
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status'
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<form action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
|
||||
<form id="approveForm" action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@csrf
|
||||
<div class="card-body lg:py-7.5">
|
||||
@@ -160,14 +160,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer flex justify-end">
|
||||
<button type="submit" name="status" value="preregister" class="btn btn-success">
|
||||
<button onclick="return otorisator()" type="button" name="status" value="preregister" class="btn btn-success">
|
||||
Approve
|
||||
</button>
|
||||
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
|
||||
Revisi
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
|
||||
<script>
|
||||
function otorisator(){
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
document.getElementById('approveForm').submit();
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
|
||||
@if(isset($permohonan->id))
|
||||
@method('PUT')
|
||||
<input type="hidden" name="id" value="{{ $permohonan->id }}">
|
||||
@endif
|
||||
@csrf
|
||||
|
||||
@@ -52,19 +53,14 @@
|
||||
Tujuan Penilaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<select class="input tomselect w-full @error('tujuan_penilaian_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<option value="">Pilih Tujuan Penilaian</option>
|
||||
@if(isset($tujuanPenilaian))
|
||||
@foreach($tujuanPenilaian as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('tujuan_penilaian_id') == $row->id) || (isset($permohonan) && $permohonan->tujuan_penilaian_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@@ -83,19 +79,14 @@
|
||||
<option value="">Pilih Fasilitas Kredit</option>
|
||||
@if(isset($fasilitasKredit))
|
||||
@foreach($fasilitasKredit as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->jenis_fasilitas_kredit_id) && $permohonan->jenis_fasilitas_kredit_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('jenis_fasilitas_kredit_id') == $row->id) || (isset($permohonan) && $permohonan->jenis_fasilitas_kredit_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('jenis_fasilitas_kredit_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -107,22 +98,17 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
|
||||
<option value="">Pilih Nilai Flafond</option>
|
||||
<option value="">Pilih Nilai Plafond</option>
|
||||
@if(isset($plafond))
|
||||
@foreach($plafond as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->nilai_plafond_id) && $permohonan->nilai_plafond_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('nilai_plafond_id') == $row->id) || (isset($permohonan) && $permohonan->nilai_plafond_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('nilai_plafond_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -135,10 +121,10 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option {{ $permohonan->status_bayar=="sudah_bayar" ? 'selected' : '' }} value="sudah_bayar">Sudah Bayar</option>
|
||||
<option {{ $permohonan->status_bayar=="belum_bayar" ? 'selected' : '' }} value="belum_bayar">Belum Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status')
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -149,12 +135,16 @@
|
||||
Nilai NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror"
|
||||
type="text"
|
||||
name="nilai_njop"
|
||||
value="{{ old('nilai_njop', $permohonan->nilai_njop ?? '') }}">
|
||||
@error('nilai_njop')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($permohonan->status=='revisi')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
Catatan : <br>
|
||||
@@ -211,19 +201,14 @@
|
||||
Tujuan Penilaian
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<select class="input tomselect w-full @error('tujuan_penilaian_id') border-danger bg-danger-light @enderror" name="tujuan_penilaian_id" id="tujuan_penilaian_id">
|
||||
<option value="">Pilih Tujuan Penilaian</option>
|
||||
@if(isset($tujuanPenilaian))
|
||||
@foreach($tujuanPenilaian as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('tujuan_penilaian_id') == $row->id) || (isset($permohonan) && $permohonan->tujuan_penilaian_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@@ -242,19 +227,14 @@
|
||||
<option value="">Pilih Fasilitas Kredit</option>
|
||||
@if(isset($fasilitasKredit))
|
||||
@foreach($fasilitasKredit as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->jenis_fasilitas_kredit_id) && $permohonan->jenis_fasilitas_kredit_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('jenis_fasilitas_kredit_id') == $row->id) || (isset($permohonan) && $permohonan->jenis_fasilitas_kredit_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('jenis_fasilitas_kredit_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -266,22 +246,17 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
|
||||
<option value="">Pilih Nilai Flafond</option>
|
||||
<option value="">Pilih Nilai Plafond</option>
|
||||
@if(isset($plafond))
|
||||
@foreach($plafond as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->id }}" {{ isset($permohonan->nilai_plafond_id) && $permohonan->nilai_plafond_id == $row->id ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->id }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
<option value="{{ $row->id }}"
|
||||
{{ (old('nilai_plafond_id') == $row->id) || (isset($permohonan) && $permohonan->nilai_plafond_id == $row->id) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
@error('nilai_plafond_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -294,10 +269,10 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status_bayar') border-danger bg-danger-light @enderror" name="status_bayar" id="status_bayar">
|
||||
<option value="">Pilih Status Bayar</option>
|
||||
<option value="sudah_bayar">Sudah Bayar</option>
|
||||
<option value="belum_bayar">Belum Bayar</option>
|
||||
<option value="sudah_bayar" {{ (old('status_bayar') == 'sudah_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'sudah_bayar') ? 'selected' : '' }}>Sudah Bayar</option>
|
||||
<option value="belum_bayar" {{ (old('status_bayar') == 'belum_bayar') || (isset($permohonan) && $permohonan->status_bayar == 'belum_bayar') ? 'selected' : '' }}>Belum Bayar</option>
|
||||
</select>
|
||||
@error('status')
|
||||
@error('status_bayar')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
@@ -308,41 +283,16 @@
|
||||
Nilai NJOP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror" type="text" name="nilai_njop" value="{{ $permohonan->nilai_njop ?? '' }}">
|
||||
<input class="input @error('nilai_njop') border-danger bg-danger-light @enderror"
|
||||
type="text"
|
||||
name="nilai_njop"
|
||||
value="{{ old('nilai_njop', $permohonan->nilai_njop ?? '') }}">
|
||||
@error('nilai_njop')
|
||||
<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">
|
||||
Status Permohonan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('status') border-danger bg-danger-light @enderror" name="status" id="status">
|
||||
<option value="">Pilih Status Permohonan</option>
|
||||
@if(isset($status))
|
||||
@foreach($status as $row)
|
||||
@if(isset($permohonan))
|
||||
<option value="{{ $row->slug }}" {{ isset($permohonan->status) && $permohonan->status == $row->slug ?'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $row->slug }}">
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('status')
|
||||
<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
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Kode Penawaran </span>
|
||||
<th class="min-w-[150px]" data-datatable-column="debiture">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="start_date">
|
||||
@@ -132,8 +132,16 @@
|
||||
'nomor_registrasi': {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
code: {
|
||||
title: 'Kode Penawaran',
|
||||
debiture: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
if(data.permohonan) {
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
start_date: {
|
||||
title: 'Tanggal Penawaran',
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
@include('lpj::prosespenawaran.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
@include('lpj::prosespenawaran.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
$(document).ready(function() {
|
||||
prepareForm();
|
||||
});
|
||||
|
||||
function prepareForm()
|
||||
|
||||
function prepareForm()
|
||||
{
|
||||
setData();
|
||||
}
|
||||
|
||||
function setData()
|
||||
{
|
||||
function setData()
|
||||
{
|
||||
let id = $("#id").val();
|
||||
let token = "{{ csrf_token() }}";
|
||||
// alert('token = ' + token);
|
||||
@@ -33,7 +33,7 @@
|
||||
// }
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
|
||||
if ('success' == response.status)
|
||||
{
|
||||
$("#textReg").text(response.penawaran.nomor_registrasi);
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
function setTablesKJPP1(datas)
|
||||
{
|
||||
let i=1;
|
||||
let i=1;
|
||||
$.each(datas, function(key, value){
|
||||
var kjppName = value.kjpp_code+' - '+value.kjpp_name;
|
||||
var biaya_penawaran = value.biaya_penawaran;// alert(biaya_penawaran);
|
||||
@@ -72,7 +72,7 @@
|
||||
markup +='<td valign="top"><div class="input-group"><span class="inputku btn btn-input" id="{{$route[1]}}_rp_'+value.id+'">Rp.</span><input type="text" disabled="" style="text-align: right;" onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" class="inputku input" id="{{$route[1]}}_biayaPenawaran_'+value.id+'" name="{{$route[1]}}_biayaPenawaran_'+value.id+'"></div><em id="{{$route[1]}}_biayaPenawaran_msg_'+value.id+'" class="alert text-danger text-sm"></em></td>';
|
||||
markup +='<td><input type="file" disabled="" class="inputku file-input" id="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" name="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" accept="application/pdf" /><em id="{{$route[1]}}_dokumenPersetujuan_msg_'+value.id+'" class="alert text-danger text-sm"></em>'+htmlDokumenPersetujuanDownload+'</td>';
|
||||
markup +='<td><div class="flex flex-nowrap justify-center">';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-notepad-edit"></i></a>';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-bookmark"></i></a>';
|
||||
markup +='<a disabled="" class="delete btn btn-sm btn-icon btn-clear btn-danger" id="{{$route[1]}}_icon_delete_'+value.id+'" onclick="deleteData('+value.id+',\''+kjppName+'\')" title="Hapus Proses Penawaran '+kjppName+'"><i class="ki-outline ki-trash"></i></a>';
|
||||
markup +='<label class="switch"><input name="{{$route[1]}}_check_'+value.id+'" id="{{$route[1]}}_check_'+value.id+'" onclick="switchProses('+value.id+')" type="checkbox" value="0"/><span class="switch-label">Proses</span></label></div></td>';
|
||||
markup += '</tr>';
|
||||
@@ -107,11 +107,11 @@
|
||||
// updateAll penawaran & permohonan status
|
||||
$("#{{$route[1]}}_toEdit").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.updateAll',$id) }}";
|
||||
|
||||
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id = "{{ $id }}";
|
||||
@@ -122,15 +122,15 @@
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
|
||||
|
||||
if ('success' == response.status)
|
||||
{
|
||||
// toastr.success(response.message);
|
||||
// success
|
||||
var message = response.message;
|
||||
toastrku("success", message);
|
||||
setTimeout(function () {
|
||||
var url = "{{ route('tender.prosespenawaran.index') }}";
|
||||
setTimeout(function () {
|
||||
var url = "{{ route('tender.prosespenawaran.index') }}";
|
||||
$(location).attr('href',url);
|
||||
}, 2000);
|
||||
|
||||
@@ -147,8 +147,8 @@
|
||||
console.log(response);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
@include('lpj::prosespenawaranulang.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
@include('lpj::prosespenawaranulang.js.editextjs')
|
||||
<script type="module">
|
||||
|
||||
$(document).ready(function() {
|
||||
prepareForm();
|
||||
});
|
||||
|
||||
function prepareForm()
|
||||
|
||||
function prepareForm()
|
||||
{
|
||||
setData();
|
||||
}
|
||||
|
||||
function setData()
|
||||
{
|
||||
function setData()
|
||||
{
|
||||
let id = $("#id").val();
|
||||
let token = "{{ csrf_token() }}";
|
||||
// alert('token = ' + token);
|
||||
@@ -49,7 +49,7 @@
|
||||
var message = response.message;
|
||||
toastrku("error", message);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr) {
|
||||
},
|
||||
@@ -57,10 +57,10 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setTablesKJPP1(datas)
|
||||
{
|
||||
let i=1;
|
||||
let i=1;
|
||||
$.each(datas, function(key, value){
|
||||
var kjppName = value.kjpp_code+' - '+value.kjpp_name;
|
||||
var biaya_penawaran = value.biaya_penawaran;// alert(biaya_penawaran);
|
||||
@@ -77,7 +77,7 @@
|
||||
markup +='<td valign="top"><div class="input-group"><span class="inputku btn btn-input" id="{{$route[1]}}_rp_'+value.id+'">Rp.</span><input type="text" disabled="" style="text-align: right;" onkeydown="return numbersonly(this, event);" onkeyup="javascript:tandaPemisahTitik(this);" class="inputku input" id="{{$route[1]}}_biayaPenawaran_'+value.id+'" name="{{$route[1]}}_biayaPenawaran_'+value.id+'"></div><em id="{{$route[1]}}_biayaPenawaran_msg_'+value.id+'" class="alert text-danger text-sm"></em></td>';
|
||||
markup +='<td><input type="file" disabled="" class="inputku file-input" id="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" name="{{$route[1]}}_dokumenPersetujuan_'+value.id+'" accept="application/pdf" /><em id="{{$route[1]}}_dokumenPersetujuan_msg_'+value.id+'" class="alert text-danger text-sm"></em>'+htmlDokumenPersetujuanDownload+'</td>';
|
||||
markup +='<td><div class="flex flex-nowrap justify-center">';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-notepad-edit"></i></a>';
|
||||
markup +='<a disabled="" class="btn btn-sm btn-icon btn-clear btn-info" href="javascript:void(0)" id="{{$route[1]}}_icon_update_'+value.id+'" title="Proses Penawaran '+kjppName+'" onclick="updateData('+value.id+','+value.kjpp_rekanan_id+',\''+kjppName+'\')"><i class="ki-outline ki-bookmark"></i></a>';
|
||||
markup +='<a disabled="" class="delete btn btn-sm btn-icon btn-clear btn-danger" id="{{$route[1]}}_icon_delete_'+value.id+'" onclick="deleteData('+value.id+',\''+kjppName+'\')" title="Hapus Proses Penawaran '+kjppName+'"><i class="ki-outline ki-trash"></i></a>';
|
||||
markup +='<label class="switch"><input name="{{$route[1]}}_check_'+value.id+'" id="{{$route[1]}}_check_'+value.id+'" onclick="switchProses('+value.id+')" type="checkbox" value="0"/><span class="switch-label">Proses</span></label></div></td>';
|
||||
markup += '</tr>';
|
||||
@@ -92,7 +92,7 @@
|
||||
i++;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(document).on("input", "input:file", function(e) {
|
||||
let fileName = e.target.files[0].name;
|
||||
let inputFile = e.target.id;
|
||||
@@ -109,4 +109,4 @@
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
||||
@@ -81,6 +81,15 @@
|
||||
<option></option>
|
||||
</select>
|
||||
<em id="{{$route[0]}}_region_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_catatan2" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="inputku textarea" name="{{$route[0]}}_catatan2" id="{{$route[0]}}_catatan2" placeholder="Catatan..." rows="6"></textarea>
|
||||
<em id="{{$route[0]}}_catatan2_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
$("#{{ $route[0] }}_div_jenis_pilihan").show();
|
||||
$("#{{ $route[0] }}_div_catatan").hide();
|
||||
$("#{{ $route[0] }}_div_region").hide();
|
||||
$("#{{ $route[0] }}_div_catatan2").show();
|
||||
// prepare data
|
||||
setData();
|
||||
}
|
||||
@@ -94,12 +95,14 @@
|
||||
$("#{{ $route[0] }}_div_jenis_pilihan").show();
|
||||
$("#{{ $route[0] }}_catatan").val('');
|
||||
$("#{{ $route[0] }}_div_catatan").hide();
|
||||
$("#{{ $route[0] }}_div_catatan2").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#{{$route[0]}}_jenis_penilaian option[value=0]").prop('selected', true);
|
||||
$("#{{ $route[0] }}_div_jenis_pilihan").hide();
|
||||
$("#{{ $route[0] }}_div_catatan").show();
|
||||
$("#{{ $route[0] }}_div_catatan2").hide();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -115,6 +118,7 @@
|
||||
let jenis_penilaian = $("#{{$route[0]}}_jenis_penilaian").val();
|
||||
let region = $("#{{$route[0]}}_region").val();
|
||||
let catatan = $("#{{$route[0]}}_catatan").val();
|
||||
let catatan2 = $("#{{$route[0]}}_catatan2").val();
|
||||
|
||||
if(jenis_penilaian==0)
|
||||
jenis_penilaian='';
|
||||
@@ -129,6 +133,7 @@
|
||||
input_data.jenis_penilaian= jenis_penilaian;
|
||||
input_data.region= region;
|
||||
input_data.catatan = catatan;
|
||||
input_data.catatan2 = catatan2;
|
||||
|
||||
let useURL= '{{ route($route[0].'.update', $id) }}';
|
||||
$.ajax({
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
<em id="{{$route[0]}}_catatan_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_region" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mt-5">
|
||||
<div id="{{ $route[0] }}_div_region" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Region
|
||||
</label>
|
||||
@@ -208,6 +208,15 @@
|
||||
<option></option>
|
||||
</select>
|
||||
<em id="{{$route[0]}}_region_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div><br />
|
||||
<div id="{{ $route[0] }}_div_catatan2" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="inputku textarea" name="{{$route[0]}}_catatan2" id="{{$route[0]}}_catatan2" placeholder="Catatan..." rows="6"></textarea>
|
||||
<em id="{{$route[0]}}_catatan2_msg" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end mt-5">
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<em id="" class="alert text-danger text-sm"></em>
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2"><a href="javascript:void(0)" class="badge badge-sm badge-outline">SPK_Dokumen.pdf <i class="ki-filled ki-cloud-download"></i></a></div>
|
||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2"><a download id="pdfSPK" class="badge badge-sm badge-outline" target="_blank">Dokumen SPK.pdf <i class="ki-filled ki-cloud-download"></i></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="{{ $route[0] }}_div_region" class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
|
||||
@@ -133,10 +133,10 @@
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a onclick="showRegistrasiFinal(${data.id})" class="btn btn-sm btn-icon btn-clear btn-primary" title="Detail">
|
||||
<a onclick="showRegistrasiFinal(${data.permohonan.id})" class="btn btn-sm btn-icon btn-clear btn-primary" title="Detail">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Proses Penawaran" href="registrasifinal/${data.id}/edit">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" title="Proses Penawaran" href="registrasifinal/${data.permohonan.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
$("#textCodePenawaran").text(response.penawaran.code);
|
||||
$("#textStatusPenawaran").text(response.penawaran.status);
|
||||
setRegionList(response.regions,0);
|
||||
// alert(response.datas.dokumen);
|
||||
$("#pdfSPK").attr("href", response.datas.dokumen);
|
||||
|
||||
// success
|
||||
// var message = response.message;
|
||||
|
||||
@@ -45,10 +45,9 @@
|
||||
Tujan Permohonan:
|
||||
</h3>
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ $permohonan->tujuanPenilaian->name }}
|
||||
{{ $permohonan->tujuanPenilaian->name }} {!! $permohonan->dokumen !!}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
182
resources/views/spk/documentSPK.blade.php
Normal file
182
resources/views/spk/documentSPK.blade.php
Normal file
File diff suppressed because one or more lines are too long
185
resources/views/spk/dokumennya.blade.php
Normal file
185
resources/views/spk/dokumennya.blade.php
Normal file
File diff suppressed because one or more lines are too long
211
resources/views/spk/edit.blade.php
Normal file
211
resources/views/spk/edit.blade.php
Normal file
File diff suppressed because one or more lines are too long
@@ -1,27 +1,26 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.tujuan-penilaian') }}
|
||||
{{ Breadcrumbs::render('spk') }}
|
||||
@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="tujuan-penilaian-table" data-api-url="{{ route('basicdata.tujuan-penilaian.datatables') }}">
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="spk-table" data-api-url="{{ route('spk.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
SPK Menu
|
||||
Daftar SPK
|
||||
</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 Doc SPK" id="search" type="text" value="">
|
||||
<input placeholder="Search SPK" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<!-- <div class="flex flex-wrap gap-2.5">
|
||||
<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="{{ route('basicdata.tujuan-penilaian.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('basicdata.tujuan-penilaian.create') }}"> Tambah Tujuan Penilaian </a>
|
||||
</div> -->
|
||||
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -32,12 +31,28 @@
|
||||
<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"> No SPK </span>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="name">
|
||||
<span class="sort"> <span class="sort-label"> Perihal </span>
|
||||
<th class="min-w-[150px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Kode Penawaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="start_date">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penawaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_kjpp_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_kjpp_sebelumnya">
|
||||
<span class="sort"> <span class="sort-label">KJPP Data</span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</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>
|
||||
@@ -62,87 +77,131 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<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() }}'
|
||||
}
|
||||
});
|
||||
<script type="text/javascript">
|
||||
function spkShow(regId)
|
||||
{
|
||||
var url = "{{ url('show') }}/"+regId;
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
$.ajax(`basic-data/tujuan-penilaian/${data}`, {
|
||||
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('#tujuan-penilaian-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
function spkCreate(regId)
|
||||
{
|
||||
var url1 = "/spk/"+regId+"/edit";
|
||||
var url = "{{ url('/') }}"+url1;
|
||||
$(location).attr('href',url);
|
||||
}
|
||||
|
||||
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();
|
||||
},
|
||||
function formatTanggalIndonesia(dateString) {
|
||||
const date = new Date(dateString);
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const monthNames = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'];
|
||||
const month = monthNames[date.getMonth()];
|
||||
const year = date.getFullYear();
|
||||
return `${day} ${month} ${year}`;
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#spk-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
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: 'Tujuan Penilaian',
|
||||
},
|
||||
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/tujuan-penilaian/${data.id}/edit">
|
||||
<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>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
'nomor_registrasi': {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
code: {
|
||||
title: 'Kode Penawaran',
|
||||
render: (item, data) => {
|
||||
if(data.penawaran) {
|
||||
return `${data.penawaran.code}`;
|
||||
}
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
date_range: {
|
||||
title: 'Tanggal Penawaran',
|
||||
render: (item, data) => {
|
||||
const startDate = formatTanggalIndonesia(data.penawaran.start_date);
|
||||
const endDate = formatTanggalIndonesia(data.penawaran.end_date);
|
||||
return `${startDate} - ${endDate}`;
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_kjpp_name: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
if(data.penawaran.tujuan_penilaian_kjpp) {
|
||||
return `${data.penawaran.tujuan_penilaian_kjpp.name}`;
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
nama_kjpp_sebelumnya: {
|
||||
title: 'Nama KJPP Terpilih',
|
||||
render: (item, data) => {
|
||||
return `${data.penawaran.nama_kjpp_sebelumnya}`+'<br />'
|
||||
+`${data.penawaran.biaya_kjpp_sebelumnya}`+'<br /> '
|
||||
+`${data.penawaran.tanggal_penilaian_sebelumnya}`;
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `${data.penawaran.status}`.toUpperCase();
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
var spkShow ='';
|
||||
var spkCreate='';
|
||||
if(!data.dokumen)
|
||||
{
|
||||
spkCreate=`<a class="btn btn-sm btn-icon btn-clear btn-info" title="Proses Penawaran" onclick="spkCreate(${data.penawaran.id})" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>`;
|
||||
}
|
||||
else
|
||||
{
|
||||
spkShow =`<div class="flex flex-nowrap justify-center">
|
||||
<a href="/spk/${data.id}/download" class="btn btn-sm btn-icon btn-clear btn-primary" title="Download SPK">
|
||||
<i class="ki-filled ki-cloud-download"></i>
|
||||
</a> `;
|
||||
spkCreate=`<a class="btn btn-sm btn-icon btn-clear btn-info" title="Buat SPK" onclick="spkCreate(${data.penawaran.id})" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">`
|
||||
+spkShow+spkCreate+
|
||||
`</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
|
||||
|
||||
|
||||
39
resources/views/spk/js/editjs.blade.php
Normal file
39
resources/views/spk/js/editjs.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
@push('scripts')
|
||||
@include('lpj::assetsku.includenya')
|
||||
<script type="text/javascript">
|
||||
function buildSPKPDF(penawaran_id) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "Yakin Generate SPK ke PDF?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`spk/${penawaran_id}`, {
|
||||
type: 'PUT'
|
||||
}).then((response) => {
|
||||
// alert('ok Sukses');
|
||||
swal.fire('Success!', 'File SPK berhasil di generate.', 'success').then(() => {
|
||||
// window.location.reload();
|
||||
});
|
||||
$('#download-button').removeAttr('disabled');
|
||||
$("#download-button").attr("href", response.spkpenawaran_path);
|
||||
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while generate the PDF file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
192
resources/views/surveyor/components/alat-berat.blade.php
Normal file
192
resources/views/surveyor/components/alat-berat.blade.php
Normal file
@@ -0,0 +1,192 @@
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Nama Jalan', 'index' => 0],
|
||||
['label' => 'Perumahan/Gang', 'index' => 1],
|
||||
['label' => 'Blok/Nomor', 'index' => 2],
|
||||
['label' => 'Desa/Kelurahan', 'index' => 3],
|
||||
['label' => 'Kecamatan', 'index' => 4],
|
||||
['label' => 'Kota/Kotamadya', 'index' => 5],
|
||||
['label' => 'Provinsi', 'index' => 6]
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataLoaksi) > 0)
|
||||
@foreach ($inputDataLoaksi as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Nomor Lambung', 'index' => 0],
|
||||
['label' => 'Model Unit', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Merk', 'index' => 3],
|
||||
['label' => 'Negara Pembuat', 'index' => 4],
|
||||
['label' => 'Tahun Pembelian', 'index' => 5],
|
||||
['label' => 'Nomor Faktur/Invoice', 'index' => 6],
|
||||
['label' => 'Nomor Kontrak Pembelian', 'index' => 7],
|
||||
['label' => 'Nama Pemilik', 'index' => 8],
|
||||
['label' => 'Alamaat Pemilik', 'index' => 9],
|
||||
['label' => 'Nomor Asuransi', 'index' => 10],
|
||||
['label' => 'Nomor Rangka', 'index' => 11],
|
||||
['label' => 'Nomor Mesin', 'index' => 12],
|
||||
['label' => 'Hour Mesin', 'index' => 13],
|
||||
['label' => 'Overhaul Mesin', 'index' => 14],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($inputDataJaminan) > 0)
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Kondisi Objek Jaminan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Model</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
|
||||
name="hadapMataAngin">
|
||||
<option value="">Select Model Kendaraan </option>
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$kondisiObjeck = [];
|
||||
|
||||
$kondisiObjeck = [
|
||||
['label' => 'Mesin dan Panel Instrument', 'index' => 0],
|
||||
['label' => 'Fungsi mesin dan panel instrument', 'index' => 1],
|
||||
['label' => 'Interior (jok, dll)', 'index' => 2],
|
||||
['label' => 'Rangka dan Karoseri', 'index' => 3],
|
||||
['label' => 'Ban', 'index' => 4],
|
||||
['label' => 'Velg', 'index' => 5],
|
||||
['label' => 'Air Conditioner', 'index' => 6],
|
||||
['label' => 'Aksesoris Tambahan lainnya', 'index' => 7],
|
||||
['label' => 'LCD', 'index' => 8],
|
||||
['label' => 'Perlengkapan Keamanan', 'index' => 9],
|
||||
['label' => 'Asuransi', 'index' => 10],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@if (count($kondisiObjeck) > 0)
|
||||
@foreach ($kondisiObjeck as $item)
|
||||
<!-- Nomor Lambung -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">{{ $item['label'] }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="bentuk_tanah" class="input"
|
||||
placeholder="Masukkan {{ $item['label'] }}">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class=" py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Unit</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -104,8 +104,8 @@
|
||||
class="input tomselect w-full @error('lantai') border-danger bg-danger-light @enderror"
|
||||
name="lantai">
|
||||
<option value="">Select Lantai</option>
|
||||
@if (isset($posisiKavling))
|
||||
@foreach ($posisiKavling as $item)
|
||||
@if (isset($lantai))
|
||||
@foreach ($lantai as $item)
|
||||
<option value="{{ $item->name }}" {{ old('lantai', isset($analisa) && optional($analisa->analisaUnit)->lantai) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -126,8 +126,8 @@
|
||||
class="input tomselect w-full @error('view') border-danger bg-danger-light @enderror"
|
||||
name="view">
|
||||
<option value="">Select View</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
@if (isset($viewUnit))
|
||||
@foreach ($viewUnit as $item)
|
||||
<option value="{{ $item->name }}" {{ old('view', isset($analisa) && optional($analisa->analisaUnit)->view) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -146,8 +146,8 @@
|
||||
class="input tomselect w-full @error('bentuk_unit') border-danger bg-danger-light @enderror"
|
||||
name="bentuk_unit">
|
||||
<option value="">Select Bentuk Unit</option>
|
||||
@if (isset($kondisiFisikTanah))
|
||||
@foreach ($kondisiFisikTanah as $item)
|
||||
@if (isset($bentukTanah))
|
||||
@foreach ($bentukTanah as $item)
|
||||
<option value="{{ $item->name }}" {{ old('bentuk_unit', isset($analisa) && optional($analisa->analisaUnit)->bentuk_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
232
resources/views/surveyor/components/bangunan.blade.php
Normal file
232
resources/views/surveyor/components/bangunan.blade.php
Normal file
@@ -0,0 +1,232 @@
|
||||
|
||||
{{-- @if ($analisaType == 'tanah_bangunan') --}}
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="y-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="luas_tanah_bagunan" value="sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'sesuai' ? 'checked' : '' }}>
|
||||
<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="luas_tanah_bagunan" value="tidak sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('luas_tanah_bagunan')
|
||||
<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('jenis_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="jenis_bangunan">
|
||||
<option value="">Select Jenis Bangunan</option>
|
||||
@if (isset($jenisBangunan))
|
||||
@foreach ($jenisBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('jenis_bangunan')
|
||||
<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('kondisi_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="kondisi_bangunan">
|
||||
<option value="">Select Kondisi Bangunan</option>
|
||||
@if (isset($kondisiBangunan))
|
||||
@foreach ($kondisiBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisi_bangunan')
|
||||
<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('sifat_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="sifat_bangunan">
|
||||
<option value="">Select Sifat Bangunan</option>
|
||||
@if (isset($sifatBangunan))
|
||||
@foreach ($sifatBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sifat_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Spek Bangunan -->
|
||||
<div class="gap-2.5">
|
||||
<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" id="spek-bangunan-container">
|
||||
<div class="spek-bangunan w-full gap-4">
|
||||
<input type="hidden" name="nama_bagunan[]" value="Bangunan">
|
||||
<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('name') border-danger bg-danger-light @enderror"
|
||||
name="name[]">
|
||||
<option value="">Select {{ $item->name }}</option>
|
||||
@foreach ($spekBangunan as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<option value="{{ $spek->name }}"
|
||||
{{ old('name') == $spek->name ? 'selected' : '' }}>
|
||||
{{ $spek->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button"
|
||||
class="mt-2 btn btn-danger btn-outline btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah bangunan
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</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('sarana_pelengkap') border-danger bg-danger-light @enderror"
|
||||
name="sarana_pelengkap">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($saranaPelengkap))
|
||||
@foreach ($saranaPelengkap as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sarana_pelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- @endif --}}
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const spekBangunanContainer = document.getElementById('spek-bangunan-container');
|
||||
|
||||
function updateDeleteButtonsVisibility() {
|
||||
const allDeleteButtons = spekBangunanContainer.querySelectorAll('.delete-button');
|
||||
// Only show the delete buttons if there are more than one form
|
||||
allDeleteButtons.forEach(button => {
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
button.style.display = 'inline-block';
|
||||
} else {
|
||||
button.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('addBagunan').addEventListener('click', function() {
|
||||
const newDiv = spekBangunanContainer.querySelector('.spek-bangunan').cloneNode(true);
|
||||
|
||||
// Clear the selected values of the cloned input fields
|
||||
newDiv.querySelectorAll('select').forEach(select => {
|
||||
select.value = '';
|
||||
});
|
||||
|
||||
// Append the cloned div to the container
|
||||
spekBangunanContainer.appendChild(newDiv);
|
||||
|
||||
// Add event listener to the delete button in the cloned div
|
||||
newDiv.querySelector('.delete-button').addEventListener('click', function() {
|
||||
spekBangunanContainer.removeChild(newDiv);
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Update delete buttons visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Initial delete button visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
|
||||
// Add delete functionality to the initial form
|
||||
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const spekBangunan = this.closest('.spek-bangunan');
|
||||
|
||||
// Make sure not to delete the last remaining form
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
spekBangunan.remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -5,6 +5,7 @@
|
||||
@endsection --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card min-w-full">
|
||||
<div class="card min-w-full">
|
||||
@@ -120,7 +121,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('surveyor.storeFoto') }}" method="POST" class="grid gap-5"
|
||||
@@ -167,6 +167,8 @@
|
||||
}
|
||||
@endphp
|
||||
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
|
||||
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Rute Menuju Lokasi</h1>
|
||||
@@ -177,25 +179,33 @@
|
||||
|
||||
@if (isset($fotoJaminan))
|
||||
@foreach ($fotoJaminan->ruteJaminan as $item)
|
||||
|
||||
@if (isset($item->foto_rute))
|
||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<div id="inputContainerRute" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
@if (isset($item->foto_rute))
|
||||
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@error('foto_rute.*')
|
||||
<span class="alert text-danger text-sm">{{ $message }}</span>
|
||||
@@ -211,9 +221,17 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Rute Menuju Lokasi</span>
|
||||
</label>
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -231,7 +249,7 @@
|
||||
|
||||
|
||||
<div class="bg-white rounded-lg shadow-md">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
|
||||
</div>
|
||||
@php
|
||||
@@ -267,9 +285,16 @@
|
||||
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
||||
style="width: 12rem;">
|
||||
@endif
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<textarea name="name_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]) ? str_replace($view['label'] . ': ', '', $fotoJaminan->objekJaminan[$view['index']]->name_objek) : '' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -289,7 +314,7 @@
|
||||
|
||||
|
||||
<div class="flex flex-wrap gap-4 w-full">
|
||||
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<div class=" text-white py-4 px-6 flex items-center justify-between w-full">
|
||||
<label class="form-label">
|
||||
<span class="form-label">Lantai</span>
|
||||
</label>
|
||||
@@ -336,10 +361,16 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Lantai 1</span>
|
||||
</label>
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -377,10 +408,16 @@
|
||||
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -401,9 +438,18 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -436,8 +482,16 @@
|
||||
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
|
||||
alt="Gambar Pendamping" style="width: 12rem;">
|
||||
@endif
|
||||
<input id="inputPendamping" type="file" name="pendamping"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputPendamping" type="file" name="pendamping"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
@@ -459,11 +513,266 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal Kamera -->
|
||||
|
||||
<div class="modal fade" data-modal="true" id="cameraModal" data-backdrop="" data-keyboard="false">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Ambil Foto</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true" id="closeModal">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Camera Interface -->
|
||||
<div class="modal-body">
|
||||
<div class="camera-container relative">
|
||||
<video id="video" class="w-full h-auto" autoplay playsinline></video>
|
||||
<canvas id="canvas" class="hidden w-full h-auto"></canvas>
|
||||
<canvas id="drawingCanvas" class="hidden absolute top-0 left-0 w-full h-full"></canvas>
|
||||
<div id="textOverlay" class="position-absolute top-0 left-0 w-100 h-100 pointer-events-none">
|
||||
<!-- Text elements will be added here dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer mt-2">
|
||||
<div id="cameraControls" class="flex justify-center gap-2 mt-4">
|
||||
<button id="startButton" class="btn btn-primary">
|
||||
<i class="ki-outline ki-camera"></i> Start Camera
|
||||
</button>
|
||||
<button id="takePhotoButton" class="btn btn-success" disabled>
|
||||
<i class="ki-outline ki-photograph"></i> Ambil Foto
|
||||
</button>
|
||||
<button id="switchButton" class="btn btn-info" disabled>
|
||||
<i class="ki-outline ki-arrows-circle"></i> Switch Camera
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Editor Controls -->
|
||||
<div id="editorControls" class=" flex flex-wrap gap-2 mt-4">
|
||||
<div class="drawing-tools flex gap-2">
|
||||
|
||||
<button class="tool-btn btn btn-sm" data-tool="brush">
|
||||
<i class="ki-filled ki-brush"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="rectangle">
|
||||
<i class="ki-filled ki-frame"></i>
|
||||
</button>
|
||||
<button class="btn btn-light btn-sm tool-btn" data-tool="arrow">
|
||||
<i class="ki-duotone ki-arrow-right fs-2"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="circle">
|
||||
<i class="ki-filled ki-mouse-circle"></i>
|
||||
</button>
|
||||
<button class="tool-btn btn btn-sm" data-tool="text">
|
||||
<i class="ki-filled ki-text"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="drawing-settings flex gap-2">
|
||||
<input type="color" id="colorPicker" class="w-8 h-8 rounded">
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="range" id="brushSize" min="1" max="20" value="5"
|
||||
class="range range-sm">
|
||||
<span id="brushSizeValue" class="text-sm">5px</span>
|
||||
</div>
|
||||
<input type="text" id="textInput" class="input" placeholder="Enter text">
|
||||
<button type="button" class="btn btn-primary" id="confirmTextBtn">Add Text</button>
|
||||
</div>
|
||||
|
||||
<div class="history-controls flex gap-2">
|
||||
<button id="undoButton" class="btn btn-sm">
|
||||
<i class="ki-filled ki-arrows-loop"></i>
|
||||
</button>
|
||||
<button id="resetButton" class="btn btn-sm">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="final-controls flex gap-2">
|
||||
<button type="button" class="btn btn-light btn-sm" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="backButton" class="btn btn-warning btn-sm">
|
||||
<i class="ki-outline ki-arrow-left"></i> Kembali
|
||||
</button>
|
||||
<button id="saveButton" class="btn btn-success btn-sm">
|
||||
<i class="ki-outline ki-check"></i> Simpan
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
<script>
|
||||
const style = document.createElement('style');
|
||||
style.textContent = `
|
||||
.draggable-text {
|
||||
z-index: 1000;
|
||||
}
|
||||
.draggable-text:hover {
|
||||
outline: 1px dashed #666;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Initialize camera editor
|
||||
const editor = new UniversalCameraEditor();
|
||||
|
||||
// Get all camera buttons
|
||||
const cameraButtons = document.querySelectorAll('#btnCamera');
|
||||
const modal = document.getElementById('cameraModal');
|
||||
const closeModal = document.getElementById('closeModal');
|
||||
|
||||
// Current input field to update
|
||||
let currentInputField = null;
|
||||
|
||||
// Confirm text button
|
||||
|
||||
|
||||
// Handle camera button click
|
||||
cameraButtons.forEach(button => {
|
||||
button.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const inputContainer = this.closest('.input-group');
|
||||
currentInputField = inputContainer.querySelector('input[type="file"]');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('modal-open');
|
||||
editor.startCamera();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
closeModal.addEventListener('click', function() {
|
||||
modal.classList.add('hidden');
|
||||
editor.closeCamera();
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Override save function
|
||||
editor.saveAndUpload = async function() {
|
||||
try {
|
||||
// Membuat canvas akhir
|
||||
const finalCanvas = document.createElement('canvas');
|
||||
finalCanvas.width = this.canvas.width;
|
||||
finalCanvas.height = this.canvas.height;
|
||||
const ctx = finalCanvas.getContext('2d');
|
||||
|
||||
// Menggambar foto asli dan hasil edit di canvas akhir
|
||||
ctx.drawImage(this.canvas, 0, 0);
|
||||
ctx.drawImage(this.drawingCanvas, 0, 0);
|
||||
|
||||
// Konversi canvas ke Blob dan buat file
|
||||
finalCanvas.toBlob(async (blob) => {
|
||||
const file = new File([blob], `camera_photo_${Date.now()}.jpg`, {
|
||||
type: "image/jpeg"
|
||||
});
|
||||
|
||||
// Membuat FileList dan memperbarui field input
|
||||
const dataTransfer = new DataTransfer();
|
||||
dataTransfer.items.add(file);
|
||||
|
||||
if (currentInputField) {
|
||||
currentInputField.files = dataTransfer.files;
|
||||
|
||||
// Trigger event "change" untuk memperbarui tampilan
|
||||
const event = new Event('change', {
|
||||
bubbles: true
|
||||
});
|
||||
currentInputField.dispatchEvent(event);
|
||||
|
||||
// Tampilkan preview jika container preview ada
|
||||
const previewContainer = currentInputField.closest('.input-group')
|
||||
.querySelector('.preview-container');
|
||||
if (previewContainer) {
|
||||
const img = document.createElement('img');
|
||||
img.src = URL.createObjectURL(file);
|
||||
img.className = 'w-full h-32 object-cover rounded-lg';
|
||||
previewContainer.innerHTML = ''; // Bersihkan container preview
|
||||
previewContainer.appendChild(img); // Tambah gambar preview
|
||||
}
|
||||
}
|
||||
|
||||
// Menutup modal
|
||||
const modal = document.getElementById('cameraModal');
|
||||
modal.classList.remove('show');
|
||||
modal.style.display = 'none';
|
||||
modal.setAttribute('aria-hidden', 'true');
|
||||
document.body.classList.remove('modal-open');
|
||||
|
||||
// Menghapus backdrop modal jika ada
|
||||
const backdrop = document.querySelector('.modal-backdrop');
|
||||
if (backdrop) {
|
||||
backdrop.remove();
|
||||
}
|
||||
|
||||
// Hentikan stream kamera
|
||||
if (editor.stream) {
|
||||
editor.stream.getTracks().forEach(track => track.stop());
|
||||
editor.stream = null;
|
||||
}
|
||||
|
||||
// Mengatur ulang ke kondisi awal (reset kamera)
|
||||
editor.closeCamera()
|
||||
|
||||
}, 'image/jpeg', 0.8);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error saving photo:', error);
|
||||
alert('Error saving photo. Please try again.');
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Preview for regular file input change
|
||||
document.addEventListener('change', function(e) {
|
||||
if (e.target && e.target.type === 'file') {
|
||||
const file = e.target.files[0];
|
||||
if (file && file.type.startsWith('image/')) {
|
||||
const previewContainer = e.target.closest('.input-group').querySelector('.preview-container');
|
||||
if (previewContainer) {
|
||||
const img = document.createElement('img');
|
||||
img.src = URL.createObjectURL(file);
|
||||
img.className = 'w-full h-32 object-cover rounded-lg';
|
||||
previewContainer.innerHTML = '';
|
||||
previewContainer.appendChild(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Handle escape key
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
const modal = document.getElementById('cameraModal');
|
||||
if (modal.classList.contains('modal-open')) {
|
||||
modal.classList.remove('modal-open');
|
||||
modal.classList.add('hidden');
|
||||
if (editor.stream) {
|
||||
editor.stream.getTracks().forEach(track => track.stop());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
// Generic function to handle adding new input and delete functionality
|
||||
|
||||
@@ -139,48 +139,62 @@
|
||||
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
|
||||
|
||||
@php
|
||||
$analisaType = 'unknown';
|
||||
$data = [
|
||||
'tanah' => 'Tanah',
|
||||
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
|
||||
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
|
||||
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
|
||||
'tanah_bangunan' => 'Mall',
|
||||
];
|
||||
$analisaType = 'unknown';
|
||||
$data = [
|
||||
'tanah' => 'Tanah',
|
||||
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
|
||||
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
|
||||
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
|
||||
'tanah_bangunan' => 'Mall',
|
||||
];
|
||||
|
||||
|
||||
if (isset($analisa->id)) {
|
||||
$analisaType = $analisa->type;
|
||||
} else {
|
||||
foreach ($data as $key => $value) {
|
||||
if (isset($jenisJaminanData) &&
|
||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))) {
|
||||
$analisaType = $key;
|
||||
break;
|
||||
if (isset($analisa->id)) {
|
||||
$analisaType = $analisa->type;
|
||||
} else {
|
||||
foreach ($data as $key => $value) {
|
||||
if (
|
||||
isset($jenisJaminanData) &&
|
||||
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
|
||||
) {
|
||||
$analisaType = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($analisaType === 'tanah') {
|
||||
$analisaType = 'tanah_bangunan';
|
||||
}
|
||||
if ($analisaType === 'tanah') {
|
||||
$analisaType = 'tanah_bangunan';
|
||||
}
|
||||
|
||||
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
|
||||
$analisaType = 'unit';
|
||||
}
|
||||
|
||||
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
|
||||
$analisaType = 'unit';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<input type="hidden" name="action" value="{{ $analisaType }}">
|
||||
<input type="hidden" name="type" value="{{ $analisaType }}">
|
||||
|
||||
@if ($analisaType == 'tanah_bangunan')
|
||||
@include('lpj::surveyor.components.tanah-bangunan')
|
||||
@else
|
||||
@include('lpj::surveyor.components.tanah')
|
||||
@elseif($analisaType == 'unit')
|
||||
@include('lpj::surveyor.components.apartemen-kantor')
|
||||
@elseif($analisaType == 'alat-berat')
|
||||
@include('lpj::surveyor.components.alat-berat')
|
||||
@elseif($analisaType == 'mesin')
|
||||
@include('lpj::surveyor.components.mesin')
|
||||
@elseif($analisaType == 'kapal')
|
||||
@include('lpj::surveyor.components.kapal')
|
||||
@elseif($analisaType == 'kendaraan')
|
||||
@include('lpj::surveyor.components.kendaraan')
|
||||
@endif
|
||||
|
||||
@if($analisaType == 'tanah_bangunan')
|
||||
@include('lpj::surveyor.components.bangunan')
|
||||
@endif
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-green-600 text-white py-4 px-6">
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
<div class=" bg-white rounded-lg overflow-hidden">
|
||||
<div class=" text-white py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -244,9 +258,9 @@
|
||||
<select
|
||||
class="input tomselect w-full @error('lalu_lintas') border-danger bg-danger-light @enderror"
|
||||
name="lalu_lintas">
|
||||
<option value="">Select PLalulintas Depan Lokasi</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
<option value="">Select Lalulintas Depan Lokasi</option>
|
||||
@if (isset($laluLintasLokasi))
|
||||
@foreach ($laluLintasLokasi as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('lalu_lintas', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lalu_lintas : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -268,8 +282,9 @@
|
||||
class="input tomselect w-full @error('gol_mas_sekitar') border-danger bg-danger-light @enderror"
|
||||
name="gol_mas_sekitar">
|
||||
<option value="">Select Golongan Hidup Sekitar</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
|
||||
@if (isset($golMasySekitar))
|
||||
@foreach ($golMasySekitar as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('gol_mas_sekitar', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->gol_mas_sekitar : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -291,8 +306,8 @@
|
||||
class="input tomselect w-full @error('tingkat_keramaian') border-danger bg-danger-light @enderror"
|
||||
name="tingkat_keramaian">
|
||||
<option value="">Select Tingkat Keramaian</option>
|
||||
@if (isset($konturTanah))
|
||||
@foreach ($konturTanah as $item)
|
||||
@if (isset($tingkatKeramaian))
|
||||
@foreach ($tingkatKeramaian as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('tingkat_keramaian', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->tingkat_keramaian : '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}</option>
|
||||
@@ -446,9 +461,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class=" bg-white rounded-lg overflow-hidden">
|
||||
<div class=" py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -472,6 +488,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Rute Menuju</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@@ -539,14 +556,17 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container mx-auto ">
|
||||
<!-- Informasi Tata Ruang -->
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
|
||||
<div class="">
|
||||
<!-- Header -->
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
|
||||
</div>
|
||||
|
||||
@@ -656,15 +676,47 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Gistaru</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
|
||||
<input id="inputRute" type="file" name="foto_rute"
|
||||
class="file-input file-input-bordered w-full" accept="image/*">
|
||||
<button id="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>
|
||||
|
||||
<!-- Peta Section -->
|
||||
|
||||
<div class="mt-2" style="margin-top: 20px">
|
||||
<input type="hidden" name="lat" id="lat"
|
||||
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
|
||||
<input type="hidden" name="lng" id="lng"
|
||||
value="{{ old('lng', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lng : '') }}">
|
||||
<div class="bg-info border p-6 rounded-lg shadow-lg flex items-center justify-center"
|
||||
<div class=" border p-6 rounded-lg shadow-lg flex items-center justify-center"
|
||||
style="height: 300px">
|
||||
<iframe id="mapFrame" frameborder="0" style="width: 100%; height: 100%;"></iframe>
|
||||
</div>
|
||||
@@ -706,6 +758,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="submit" class="btn btn-success">
|
||||
@@ -717,8 +770,74 @@
|
||||
</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
|
||||
@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>
|
||||
// Fungsi untuk mengambil lokasi pengguna
|
||||
function getUserLocation() {
|
||||
|
||||
488
resources/views/surveyor/components/kapal.blade.php
Normal file
488
resources/views/surveyor/components/kapal.blade.php
Normal file
@@ -0,0 +1,488 @@
|
||||
|
||||
|
||||
<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">Jenis</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 Jenis</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>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Size</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 Size</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>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kondisi</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 Jenis</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>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Klasifikasi</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 Jenis</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' => 'Nama Kapal', 'index' => 0],
|
||||
['label' => 'Pemilik Kapal', 'index' => 1],
|
||||
['label' => 'Bendera', 'index' => 2],
|
||||
['label' => 'Nomor Tanda Selar', 'index' => 3],
|
||||
['label' => 'Kapal', 'index' => 4],
|
||||
['label' => 'Galangan', 'index' => 5],
|
||||
['label' => 'Kapal/Shipyard', 'index' => 6],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 7],
|
||||
['label' => 'Tahun Lanuncing', 'index' => 8],
|
||||
['label' => 'DWT (ton)', 'index' => 9],
|
||||
['label' => 'LWT (ton)', 'index' => 10],
|
||||
['label' => 'Gross Tonnage (ton)', 'index' => 11],
|
||||
['label' => 'Net Tonnage (ton)', 'index' => 12],
|
||||
['label' => 'Tenaga Mesin (HP)', 'index' => 13],
|
||||
['label' => 'LOA', 'index' => 14],
|
||||
['label' => 'LBP', 'index' => 15],
|
||||
['label' => 'Beam', 'index' => 16],
|
||||
['label' => 'Depth', 'index' => 17],
|
||||
['label' => 'Draft', 'index' => 18],
|
||||
];
|
||||
@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 class="flex justify-end" style="margin-top: 10px">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah mesin
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</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">Struktur Kapal</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Lambung Kapal', 'index' => 0],
|
||||
['label' => 'Dek', 'index' => 1],
|
||||
['label' => 'Struktur Rangka', 'index' => 2],
|
||||
['label' => 'Palka', 'index' => 3],
|
||||
['label' => 'Pondasi Mesin', 'index' => 4],
|
||||
['label' => 'Area Mesin', 'index' => 5],
|
||||
['label' => 'Cat dan Korosi', 'index' => 6],
|
||||
['label' => 'Sistem Pengelasan', 'index' => 7]
|
||||
];
|
||||
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Peralatan Keselamatan --}}
|
||||
<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">Peralatan Keselamatan</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Sekoci/Lifeboat', 'index' => 0],
|
||||
['label' => 'Jaket Pelampung', 'index' => 1],
|
||||
['label' => 'Alat Pemadam', 'index' => 2],
|
||||
['label' => 'Rambu Darurat', 'index' => 3],
|
||||
['label' => 'Sistem Alarm', 'index' => 4],
|
||||
['label' => 'Sistem Pencegah', 'index' => 5],
|
||||
['label' => 'Kebaran', 'index' => 6],
|
||||
['label' => 'Lampu Darurat', 'index' => 7]
|
||||
];
|
||||
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Sistwm Navigasi dan Komunikasi --}}
|
||||
<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">Sistem Navigasi dan Komunikasi</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Gps', 'index' => 0],
|
||||
['label' => 'Radat', 'index' => 1],
|
||||
['label' => 'Radio Komunikasi', 'index' => 2],
|
||||
['label' => 'Lampu Navigasi', 'index' => 3],
|
||||
['label' => 'Sistem Kendali otomatis', 'index' => 4],
|
||||
['label' => 'Kompas', 'index' => 5],
|
||||
];
|
||||
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Sistwm Mesin dan Penggerak Kapal --}}
|
||||
<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">Sistem Mesin dan Penggerak Kapal</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Mesin Utama', 'index' => 0],
|
||||
['label' => 'Mesin Bantu', 'index' => 1],
|
||||
['label' => 'Pompa Pendingin', 'index' => 2],
|
||||
['label' => 'Sistem Pelumasan', 'index' => 3],
|
||||
['label' => 'Propeller', 'index' => 4],
|
||||
['label' => 'Sistem Kelistrikan', 'index' => 5],
|
||||
];
|
||||
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Sistwm kelistrikan dan Elektronik --}}
|
||||
<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">Sistem Kelistrikan dan Elektronik</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Lampu Navigasi', 'index' => 0],
|
||||
['label' => 'Sistem Penerangan', 'index' => 1],
|
||||
['label' => 'Sistem Panel Distribusi', 'index' => 2],
|
||||
['label' => 'Kabel dan Perangkat Pendukung', 'index' => 3],
|
||||
];
|
||||
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Linkungan dan Kebersihan Kapal --}}
|
||||
<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">Linkungan dan Kebersihan Kapal</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$inputDataLoaksi = [];
|
||||
|
||||
$inputDataLoaksi = [
|
||||
['label' => 'Kebersihan Dek Luar', 'index' => 0],
|
||||
['label' => 'Tangki Limbah', 'index' => 1],
|
||||
['label' => 'Sistem Pengelolaan Limbah', 'index' => 2],
|
||||
['label' => 'Pengelolaan Air Ballast', 'index' => 3],
|
||||
];
|
||||
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
160
resources/views/surveyor/components/kendaraan.blade.php
Normal file
160
resources/views/surveyor/components/kendaraan.blade.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<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">Order Penilaian</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Survey</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" name="tanggal_survey" class="input" placeholder="Masukkan Hubungan Calon Debitur">
|
||||
|
||||
@error('bentuk_tanah')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</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">Identitas Debitur</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">Nama Wakil 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="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>
|
||||
|
||||
<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">BPKB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="tanggal_survey" class="input" placeholder="BPKP">
|
||||
@error('hadapMataAngin')
|
||||
<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">STNK</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="tanggal_survey" class="input" placeholder="STNK">
|
||||
@error('hadapMataAngin')
|
||||
<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">Deskripsi kendaraan sesuai dokument</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
|
||||
@error('hadapMataAngin')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [];
|
||||
$inputDataJaminan = [
|
||||
['label' => 'Tipe/Model', 'index' => 0],
|
||||
['label' => 'Merek', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Negara Pembuat', 'index' => 3],
|
||||
['label' => 'Kondisi Mesin', 'index' => 4],
|
||||
];
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
133
resources/views/surveyor/components/mesin.blade.php
Normal file
133
resources/views/surveyor/components/mesin.blade.php
Normal file
@@ -0,0 +1,133 @@
|
||||
|
||||
|
||||
<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' => 'Tipe/Model', 'index' => 0],
|
||||
['label' => 'Merek', 'index' => 1],
|
||||
['label' => 'Tahun Pembuatan', 'index' => 2],
|
||||
['label' => 'Negara Pembuat', 'index' => 3],
|
||||
['label' => 'Kondisi Mesin', 'index' => 4],
|
||||
];
|
||||
@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 class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea name="deskripsi" id="" class="textarea"></textarea>
|
||||
@error('deskripsi')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end" style="margin-top: 10px">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah mesin
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="bg-blue-600 text-white py-4 px-6">
|
||||
<div class="py-4 px-6">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisa Tanah</h1>
|
||||
</div>
|
||||
<div class="grid gap-5">
|
||||
@@ -246,235 +246,3 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($analisaType == 'tanah_bangunan')
|
||||
<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="luas_tanah_bagunan" value="sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'sesuai' ? 'checked' : '' }}>
|
||||
<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="luas_tanah_bagunan" value="tidak sesuai"
|
||||
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@error('luas_tanah_bagunan')
|
||||
<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('jenis_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="jenis_bangunan">
|
||||
<option value="">Select Jenis Bangunan</option>
|
||||
@if (isset($jenisBangunan))
|
||||
@foreach ($jenisBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('jenis_bangunan')
|
||||
<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('kondisi_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="kondisi_bangunan">
|
||||
<option value="">Select Kondisi Bangunan</option>
|
||||
@if (isset($kondisiBangunan))
|
||||
@foreach ($kondisiBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('kondisi_bangunan')
|
||||
<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('sifat_bangunan') border-danger bg-danger-light @enderror"
|
||||
name="sifat_bangunan">
|
||||
<option value="">Select Sifat Bangunan</option>
|
||||
@if (isset($sifatBangunan))
|
||||
@foreach ($sifatBangunan as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sifat_bangunan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Spek Bangunan -->
|
||||
<div class="gap-2.5">
|
||||
<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" id="spek-bangunan-container">
|
||||
<div class="spek-bangunan w-full gap-4">
|
||||
<input type="hidden" name="nama_bagunan[]" value="Bangunan">
|
||||
<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('name') border-danger bg-danger-light @enderror"
|
||||
name="name[]">
|
||||
<option value="">Select {{ $item->name }}</option>
|
||||
@foreach ($spekBangunan as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<option value="{{ $spek->name }}"
|
||||
{{ old('name') == $spek->name ? 'selected' : '' }}>
|
||||
{{ $spek->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@error('name')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button"
|
||||
class="mt-2 btn btn-danger btn-outline btn-xs delete-button">Hapus</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah bangunan
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
</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('sarana_pelengkap') border-danger bg-danger-light @enderror"
|
||||
name="sarana_pelengkap">
|
||||
<option value="">Select Posisi Kavling</option>
|
||||
@if (isset($saranaPelengkap))
|
||||
@foreach ($saranaPelengkap as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
@error('sarana_pelengkap')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const spekBangunanContainer = document.getElementById('spek-bangunan-container');
|
||||
|
||||
function updateDeleteButtonsVisibility() {
|
||||
const allDeleteButtons = spekBangunanContainer.querySelectorAll('.delete-button');
|
||||
// Only show the delete buttons if there are more than one form
|
||||
allDeleteButtons.forEach(button => {
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
button.style.display = 'inline-block';
|
||||
} else {
|
||||
button.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('addBagunan').addEventListener('click', function() {
|
||||
const newDiv = spekBangunanContainer.querySelector('.spek-bangunan').cloneNode(true);
|
||||
|
||||
// Clear the selected values of the cloned input fields
|
||||
newDiv.querySelectorAll('select').forEach(select => {
|
||||
select.value = '';
|
||||
});
|
||||
|
||||
// Append the cloned div to the container
|
||||
spekBangunanContainer.appendChild(newDiv);
|
||||
|
||||
// Add event listener to the delete button in the cloned div
|
||||
newDiv.querySelector('.delete-button').addEventListener('click', function() {
|
||||
spekBangunanContainer.removeChild(newDiv);
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Update delete buttons visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
});
|
||||
|
||||
// Initial delete button visibility
|
||||
updateDeleteButtonsVisibility();
|
||||
|
||||
// Add delete functionality to the initial form
|
||||
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const spekBangunan = this.closest('.spek-bangunan');
|
||||
|
||||
// Make sure not to delete the last remaining form
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
spekBangunan.remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render(request()->route()->getName()) }}
|
||||
@endsection --}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@@ -33,7 +33,7 @@
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger bg-danger-light @enderror" type="text"
|
||||
name="code" value="{{ $model->code ?? '' }}" >
|
||||
name="code" value="{{ $model->code ?? '' }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
@@ -51,6 +51,41 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (isset($header[1]) && $header[1] == 'spek-bangunan')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Kategori
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select
|
||||
class="input tomselect w-full @error('spek_kategori_bangunan_id') border-danger bg-danger-light @enderror"
|
||||
name="spek_kategori_bangunan_id">
|
||||
<option value="">Select Kategori Bangunan</option>
|
||||
@if (isset($spekKategoriBagunan))
|
||||
@foreach ($spekKategoriBagunan as $item)
|
||||
@if (isset($model->spek_kategori_bangunan_id))
|
||||
<option value="{{ $model->spek_kategori_bangunan_id }}"
|
||||
{{ $model->spek_kategori_bangunan_id == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $item->id }}"
|
||||
{{ old('spek_kategori_bangunan_id') == $item->id ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
@error('spek_kategori_bangunan_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
{{-- @section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('surveyor.bentuk-tanah') }}
|
||||
@endsection --}}
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('basicdata.' . $header[1]) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid">
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
|
||||
@if (request()->has('form') && request('form') !== 'data-pembanding')
|
||||
<div class="card-footer">
|
||||
<form action="{{ route('surveyor.submitSurveyor', $surveyor) }}" method="POST">
|
||||
<form action="{{ route('surveyor.submitSurveyor', $surveyor ) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-primary " {{ $buttonDisable ? 'disabled' : '' }}>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
@push('styles')
|
||||
<style>
|
||||
.modal {
|
||||
|
||||
width: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -201,10 +202,10 @@
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Assigned',
|
||||
render: (item, data) => {
|
||||
const createdAt = convertDate(data.penilaian.created_at);
|
||||
return createdAt;
|
||||
},
|
||||
// render: (item, data) => {
|
||||
// const createdAt = convertDate(data.penilaian.created_at);
|
||||
// return createdAt;
|
||||
// },
|
||||
},
|
||||
|
||||
user_id: {
|
||||
@@ -231,9 +232,6 @@
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" data-modal-toggle="#modal_revisi" >
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
@@ -249,10 +247,10 @@
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
statusFilter.addEventListener('change', function() {
|
||||
const selectedStatus = this.value;
|
||||
dataTable.search(selectedStatus);
|
||||
});
|
||||
// statusFilter.addEventListener('change', function() {
|
||||
// const selectedStatus = this.value;
|
||||
// dataTable.search(selectedStatus);
|
||||
// });
|
||||
|
||||
function convertDate(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
|
||||
@@ -61,14 +61,14 @@
|
||||
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror"
|
||||
name="regions_id">
|
||||
<option value="">Select Region</option>
|
||||
@if (isset($region))
|
||||
@foreach ($region as $regions)
|
||||
@if (isset($regions))
|
||||
@foreach ($regions as $region)
|
||||
@if (isset($teams))
|
||||
<option value="{{ $regions->id }}"
|
||||
{{ $teams->regions_id == $regions->id ? 'selected' : '' }}>
|
||||
{{ $regions->name }}</option>
|
||||
<option value="{{ $region->id }}"
|
||||
{{ $teams->regions_id == $region->id ? 'selected' : '' }}>
|
||||
{{ $region->name }}</option>
|
||||
@else
|
||||
<option value="{{ $regions->id }}">{{ $regions->name }}</option>
|
||||
<option value="{{ $region->id }}">{{ $region->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -98,6 +98,7 @@
|
||||
@endforeach
|
||||
</option>
|
||||
@else
|
||||
|
||||
<option value="{{ $users->id }}">{{ $users->name . ' | ' }}
|
||||
|
||||
@foreach ($users->roles as $role)
|
||||
|
||||
@@ -498,6 +498,15 @@ Breadcrumbs::for('otorisasitender.penawaran.show', function (BreadcrumbTrail $tr
|
||||
$trail->push('Detail Data Otorisasi Penawaran');
|
||||
});
|
||||
// andy add Otorisasi Tender
|
||||
// spk
|
||||
Breadcrumbs::for('spk', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('SPK', route('spk.index'));
|
||||
});
|
||||
Breadcrumbs::for('spk.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('spk');
|
||||
$trail->push('Buat SPK');
|
||||
});
|
||||
// spk
|
||||
// andy add registrasi final
|
||||
Breadcrumbs::for('registrasifinal', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Registrasi Final', route('registrasifinal.index'));
|
||||
@@ -518,6 +527,79 @@ Breadcrumbs::for('otorisator.pelaporan.index', function (BreadcrumbTrail $trail)
|
||||
$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) {
|
||||
$trail->push('Laporan', route('laporan.sederhana.index'));
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@ use Modules\Lpj\Http\Controllers\RegistrasiController;
|
||||
use Modules\Lpj\Http\Controllers\ProsesPenawaranController;
|
||||
use Modules\Lpj\Http\Controllers\ProsesPenawaranUlangController;
|
||||
use Modules\Lpj\Http\Controllers\OtorisasiPenawaranController;
|
||||
use Modules\Lpj\Http\Controllers\SpkController;
|
||||
use Modules\Lpj\Http\Controllers\RegistrasiFinalController;
|
||||
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
@@ -85,6 +86,18 @@ Route::middleware(['auth'])->group(function () {
|
||||
});
|
||||
});
|
||||
|
||||
Route::controller(SpkController::class)->group(function(){
|
||||
Route::get('/spk/dokumennya', 'dokumennya')->name('spk.dokumennya');
|
||||
|
||||
Route::get('/spk', 'index')->name('spk.index');
|
||||
Route::get('/spk/datatables', 'dataForDatatables')->name('spk.datatables');
|
||||
Route::get('/spk/{spk}', 'show')->name('spk.show');
|
||||
Route::get('/spk/{spk}/edit', 'edit')->name('spk.edit');
|
||||
Route::put('/spk/{spk}', 'update')->name('spk.update');
|
||||
|
||||
Route::get('spk/{spk}/download', 'download')->name('spk.download');
|
||||
});
|
||||
|
||||
Route::controller(RegistrasiFinalController::class)->group(function(){
|
||||
Route::get('/registrasifinal', 'index')->name('registrasifinal.index');
|
||||
Route::get('/registrasifinal/datatables', 'dataForDatatables')->name('registrasifinal.datatables');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Lpj\Http\Controllers\SLAController;
|
||||
use Modules\Lpj\Http\Controllers\SpkController;
|
||||
use Modules\Lpj\Http\Controllers\KJPPController;
|
||||
use Modules\Lpj\Http\Controllers\TeamsController;
|
||||
use Modules\Lpj\Http\Controllers\RegionController;
|
||||
@@ -67,7 +66,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::resource('jenis-legalitas-jaminan', JenisLegalitasJaminanController::class);
|
||||
|
||||
Route::name('jenis-jaminan.')->prefix('jenis-jaminan')->group(function () {
|
||||
Route::get('legalitas/{id}', [JenisJaminanController::class, 'legalitasJaminan'])->name('legalitas');
|
||||
Route::get('legalitas/{id}/{jenisJaminanId}', [DokumenJaminanController::class, 'getLegalitasJaminan'])->name('legalitas');
|
||||
Route::get('restore/{id}', [JenisJaminanController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [JenisJaminanController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [JenisJaminanController::class, 'export'])->name('export');
|
||||
@@ -286,9 +285,15 @@ Route::middleware(['auth'])->group(function () {
|
||||
'jenis-bangunan' => 'Jenis Bangunan',
|
||||
'kondisi-bangunan' => 'Kondisi Bangunan',
|
||||
'sifat-bangunan' => 'Sifat Bangunan',
|
||||
// 'spek-bangunan' => 'Speksifikasi Bangunan',
|
||||
// 'spek-kategori-bagunan' => 'Speksifikasi Kategori Bangunan',
|
||||
'spek-bangunan' => 'Speksifikasi Bangunan',
|
||||
'spek-kategori-bangunan' => 'Speksifikasi Kategori Bangunan',
|
||||
'sarana-pelengkap' => 'Sarana Pelengkap',
|
||||
'lalu-lintas-lokasi' => 'Lalu Lintas',
|
||||
'tingkat-keramaian' => 'Tingkat Keramaian',
|
||||
'gol-mas-sekitar' => 'Golongan Masyarakat Sekitar',
|
||||
'lantai-unit' => 'Lantai Unit',
|
||||
'view-unit' => 'View Unit',
|
||||
'bentuk-unit' => 'Bentuk unit',
|
||||
];
|
||||
|
||||
foreach ($headers as $type => $header) {
|
||||
@@ -347,18 +352,6 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('print/{id}', [PermohonanController::class, 'print'])->name('print');
|
||||
});
|
||||
|
||||
Route::name('spk.')->prefix('spk')->group(function () {
|
||||
// Route::get('download', [PermohonanController::class, 'createPermohonan'])->name('create.debitur');
|
||||
Route::get('view', [SpkController::class, 'viewSpk'])->name('spk.view');
|
||||
// Route::get('{id}/create', [PermohonanController::class, 'createPermohonan'])->name('create.debitur');
|
||||
// Route::get('download/{id}', [PermohonanController::class, 'download'])->name('download');
|
||||
// Route::get('restore/{id}', [PermohonanController::class, 'restore'])->name('restore');
|
||||
// Route::get('datatables', [PermohonanController::class, 'dataForDatatables'])->name('datatables');
|
||||
// Route::get('export', [PermohonanController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::resource('spk', SpkController::class);
|
||||
|
||||
Route::get('authorization', [PermohonanController::class, 'authorization'])->name('authorization.index');
|
||||
|
||||
Route::resource('permohonan', PermohonanController::class);
|
||||
@@ -431,6 +424,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('restore/{id}', [ActivityController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [ActivityController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [ActivityController::class, 'export'])->name('export');
|
||||
|
||||
Route::get('/', [ActivityController::class, 'index'])->name('index');
|
||||
|
||||
Route::get('/{id}/show', [ActivityController::class, 'show'])->name('show');
|
||||
|
||||
Reference in New Issue
Block a user