Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -89,13 +89,16 @@ class LaporanPenilaiJaminanController extends Controller
|
|||||||
$userTeam = TeamsUsers::with('team')->firstWhere('user_id', $user->id);
|
$userTeam = TeamsUsers::with('team')->firstWhere('user_id', $user->id);
|
||||||
$regionId = $userTeam?->team->regions_id;
|
$regionId = $userTeam?->team->regions_id;
|
||||||
}
|
}
|
||||||
|
$paramsSearch = null;
|
||||||
|
// dd($startDate);
|
||||||
// Retrieve data from the database
|
// Retrieve data from the database
|
||||||
$query = Permohonan::query();
|
$query = Permohonan::query();
|
||||||
|
|
||||||
// Apply search filter if provided
|
// Apply search filter if provided
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
|
$paramsSearch = json_decode($search);
|
||||||
|
|
||||||
$query->where(function ($q) use ($search) {
|
$query->where(function ($q) use ($search) {
|
||||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%')
|
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%')
|
||||||
->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%')
|
->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%')
|
||||||
@@ -104,10 +107,14 @@ class LaporanPenilaiJaminanController extends Controller
|
|||||||
->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%')
|
->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%')
|
||||||
->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||||
|
|
||||||
// Split search term by comma to allow multiple statuses
|
if (!empty($paramsSearch->tanggal_awal) && !empty($paramsSearch->tanggal_akhir)) {
|
||||||
|
$q->whereBetween('tanggal_permohonan', [$paramsSearch->tanggal_awal, $paramsSearch->tanggal_akhir]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$statusKeywords = explode(',', $search);
|
$statusKeywords = explode(',', $search);
|
||||||
foreach ($statusKeywords as $keyword) {
|
foreach ($statusKeywords as $keyword) {
|
||||||
$q->orWhere('status', 'LIKE', '%' . trim($keyword) . '%');
|
$q->orWhereRelation('penilai', 'type_penilai', 'LIKE', '%' . trim($keyword) . '%');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,6 +167,23 @@ class SurveyorController extends Controller
|
|||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$validatedData = $request->all();
|
$validatedData = $request->all();
|
||||||
|
|
||||||
|
$fotoTypes = [
|
||||||
|
'foto_gistaru',
|
||||||
|
'foto_bhumi',
|
||||||
|
'foto_argis_region',
|
||||||
|
'foto_tempat',
|
||||||
|
'foto_sentuh_tanahku',
|
||||||
|
'upload_gs'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Hapus data foto dari $validatedData
|
||||||
|
foreach ($fotoTypes as $fotoType) {
|
||||||
|
if (isset($validatedData[$fotoType])) {
|
||||||
|
unset($validatedData[$fotoType]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
||||||
|
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
@@ -2028,9 +2045,9 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
{
|
{
|
||||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
// if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
}
|
// }
|
||||||
|
|
||||||
$query = Permohonan::query();
|
$query = Permohonan::query();
|
||||||
$query = $query->orderBy('nomor_registrasi', 'desc');
|
$query = $query->orderBy('nomor_registrasi', 'desc');
|
||||||
@@ -2099,7 +2116,7 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
public function dataForDatatablesData(Request $request, $type)
|
public function dataForDatatablesData(Request $request, $type)
|
||||||
{
|
{
|
||||||
if (is_null($this->user) || !$this->user->can('jenis_aset.view')) {
|
if (is_null(auth()->user()) || !$this->user->can('jenis_aset.view')) {
|
||||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2818,4 +2835,73 @@ class SurveyorController extends Controller
|
|||||||
], 500);
|
], 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function uploadFileFoto(Request $request, $url)
|
||||||
|
{
|
||||||
|
|
||||||
|
// dd($request->all());
|
||||||
|
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||||
|
->where('dokument_id', $request->input('dokument_id'))
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$fotoTypes = [
|
||||||
|
'foto_gistaru',
|
||||||
|
'foto_bhumi',
|
||||||
|
'foto_argis_region',
|
||||||
|
'foto_tempat',
|
||||||
|
'foto_sentuh_tanahku',
|
||||||
|
'upload_gs'
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!in_array($url, $fotoTypes)) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'Invalid key for upload'
|
||||||
|
], 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$existingData = $inspeksi ? json_decode($inspeksi->data_form, true) : [];
|
||||||
|
$existingData = $existingData ?? [];
|
||||||
|
|
||||||
|
|
||||||
|
$factData = $existingData;
|
||||||
|
if ($request->hasFile('file')) {
|
||||||
|
$file = $request->file('file');
|
||||||
|
$filePath = $file->store('uploads', 'public');
|
||||||
|
$uploadedPath = str_replace('public/', '', $filePath);
|
||||||
|
|
||||||
|
|
||||||
|
$factData[$url] = $uploadedPath;
|
||||||
|
|
||||||
|
|
||||||
|
$existingData = $factData;
|
||||||
|
if ($inspeksi) {
|
||||||
|
$inspeksi->data_form = json_encode($existingData);
|
||||||
|
$inspeksi->save();
|
||||||
|
} else {
|
||||||
|
Inspeksi::create([
|
||||||
|
'permohonan_id' => $request->input('permohonan_id'),
|
||||||
|
'dokument_id' => $request->input('document_id'),
|
||||||
|
'data_form' => json_encode($existingData),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => 'No file uploaded for the given key'
|
||||||
|
], 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'success' => true,
|
||||||
|
'message' => 'Berhasil upload file foto',
|
||||||
|
'data' => [
|
||||||
|
'key' => $url,
|
||||||
|
'path' => $factData[$url] ?? null
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,44 +10,50 @@ class SaveFormInspesksiService
|
|||||||
public function storeInspeksi(array $validatedData, string $type, Request $request)
|
public function storeInspeksi(array $validatedData, string $type, Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$processedData = $this->getActionSpecificRules($validatedData, $type, $request);
|
$inspeksi = Inspeksi::firstOrNew(
|
||||||
|
[
|
||||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
|
||||||
->where('dokument_id', $request->input('dokument_id'))
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($inspeksi) {
|
|
||||||
// Jika data sudah ada, merge dengan data yang baru
|
|
||||||
$existingData = json_decode($inspeksi->data_form, true) ?: [];
|
|
||||||
|
|
||||||
if (isset($existingData['signature']) && !isset($processedData['signature'])) {
|
|
||||||
$processedData['signature'] = $existingData['signature'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$mergedData = $this->arrayMergeRecursive($existingData, $processedData);
|
|
||||||
|
|
||||||
// Update record
|
|
||||||
$inspeksi->update([
|
|
||||||
'data_form' => json_encode($mergedData),
|
|
||||||
'name' => $request->input('type')
|
|
||||||
]);
|
|
||||||
|
|
||||||
$responseData = $mergedData;
|
|
||||||
} else {
|
|
||||||
// Jika belum ada data, buat record baru
|
|
||||||
$inspeksi = Inspeksi::create([
|
|
||||||
'permohonan_id' => $request->input('permohonan_id'),
|
'permohonan_id' => $request->input('permohonan_id'),
|
||||||
'dokument_id' => $request->input('dokument_id'),
|
'dokument_id' => $request->input('dokument_id')
|
||||||
'data_form' => json_encode($processedData),
|
]
|
||||||
'name' => $request->input('type')
|
);
|
||||||
]);
|
|
||||||
|
|
||||||
$responseData = $processedData;
|
$inspeksi->name = $request->input('type');
|
||||||
|
|
||||||
|
$processedData = $this->getActionSpecificRules($validatedData, $type, $request, $inspeksi);
|
||||||
|
|
||||||
|
// Merge data lama dengan data baru
|
||||||
|
$existingData = json_decode($inspeksi->data_form, true) ?: [];
|
||||||
|
|
||||||
|
$fotoTypes = [
|
||||||
|
'foto_gistaru',
|
||||||
|
'foto_bhumi',
|
||||||
|
'foto_argis_region',
|
||||||
|
'foto_tempat',
|
||||||
|
'foto_sentuh_tanahku',
|
||||||
|
'upload_gs'
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($fotoTypes as $fotoType) {
|
||||||
|
if (isset($existingData[$fotoType])) {
|
||||||
|
$processedData[$fotoType] = $existingData[$fotoType];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mergedData = $this->arrayMergeRecursive($existingData, $processedData);
|
||||||
|
|
||||||
|
if (isset($existingData['signature']) && !isset($processedData['signature'])) {
|
||||||
|
$mergedData['signature'] = $existingData['signature'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$inspeksi->data_form = json_encode($mergedData);
|
||||||
|
$inspeksi->save();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => 'Data berhasil disimpan',
|
'message' => 'Data berhasil disimpan',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return [
|
return [
|
||||||
'success' => false,
|
'success' => false,
|
||||||
@@ -58,7 +64,7 @@ class SaveFormInspesksiService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getActionSpecificRules($data, $action, $request): array
|
private function getActionSpecificRules($data, $action, $request, $inspeksi): array
|
||||||
{
|
{
|
||||||
$allowedActions = [
|
$allowedActions = [
|
||||||
'apartemen-kantor' => 'getUnitData',
|
'apartemen-kantor' => 'getUnitData',
|
||||||
@@ -95,7 +101,7 @@ class SaveFormInspesksiService
|
|||||||
if (isset($allowedActions[$act])) {
|
if (isset($allowedActions[$act])) {
|
||||||
$method = $allowedActions[$act];
|
$method = $allowedActions[$act];
|
||||||
|
|
||||||
$actionRules = $this->$method($data, $request);
|
$actionRules = $this->$method($data, $request, $inspeksi);
|
||||||
$rules = array_merge($rules, $actionRules);
|
$rules = array_merge($rules, $actionRules);
|
||||||
|
|
||||||
// Cek apakah act memerlukan asset description rules
|
// Cek apakah act memerlukan asset description rules
|
||||||
@@ -374,7 +380,7 @@ class SaveFormInspesksiService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function getFactData($data, $request): array
|
private function getFactData($data, $request, $inspeksi): array
|
||||||
{
|
{
|
||||||
$factData = [
|
$factData = [
|
||||||
'fakta' => [
|
'fakta' => [
|
||||||
@@ -400,44 +406,16 @@ class SaveFormInspesksiService
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))->where('dokument_id', $request->input('dokument_id'))->first();
|
|
||||||
|
|
||||||
|
|
||||||
$fotoTypes = [
|
|
||||||
'foto_gistaru',
|
|
||||||
'foto_bhumi',
|
|
||||||
'foto_argis_region',
|
|
||||||
'foto_tempat',
|
|
||||||
'foto_sentuh_tanahku',
|
|
||||||
'upload_gs'
|
|
||||||
];
|
|
||||||
|
|
||||||
if ($inspeksi) {
|
|
||||||
$dataForm = json_decode($inspeksi->data_form, true);
|
|
||||||
foreach ($fotoTypes as $fotoType) {
|
|
||||||
// Jika ada file baru diupload
|
|
||||||
if ($request->hasFile($fotoType)) {
|
|
||||||
$factData[$fotoType] = $this->updateOrDeleteFile($dataForm, $request, $fotoType) ?: null;
|
|
||||||
} else {
|
|
||||||
$factData[$fotoType] = $dataForm[$fotoType] ?? null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach ($fotoTypes as $fotoType) {
|
|
||||||
$factData[$fotoType] = $this->updateOrDeleteFile($data, $request, $fotoType) ?: null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $factData;
|
return $factData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getRapData($data, $request): array
|
private function getRapData($data, $request, $inspeksi): array
|
||||||
{
|
{
|
||||||
|
|
||||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
|
||||||
->where('dokument_id', $request->input('dokument_id'))
|
|
||||||
->first();
|
|
||||||
|
|
||||||
$dataForm = json_decode($inspeksi->data_form, true);
|
$dataForm = json_decode($inspeksi->data_form, true);
|
||||||
|
|
||||||
$perizinanData = isset($dataForm['perizinan']) ? $dataForm['perizinan'] : [];
|
$perizinanData = isset($dataForm['perizinan']) ? $dataForm['perizinan'] : [];
|
||||||
@@ -966,14 +944,14 @@ class SaveFormInspesksiService
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function arrayMergeRecursive($arr1, $arr2)
|
private function arrayMergeRecursive(array $arr1, array $arr2): array
|
||||||
{
|
{
|
||||||
foreach ($arr2 as $key => $value) {
|
foreach ($arr2 as $key => $value) {
|
||||||
if ($key === 'signature' && isset($arr1['signature'])) {
|
if ($key === 'signature' && isset($arr1['signature'])) {
|
||||||
// Jika key adalah signature, gabungkan secara spesifik
|
// Gabungkan 'signature' secara spesifik
|
||||||
$arr1['signature'] = array_merge($arr1['signature'], $value);
|
$arr1['signature'] = array_merge_recursive((array) $arr1['signature'], (array) $value);
|
||||||
} elseif (is_array($value) && isset($arr1[$key]) && is_array($arr1[$key])) {
|
} elseif (is_array($value) && isset($arr1[$key]) && is_array($arr1[$key])) {
|
||||||
// Rekursif untuk key lainnya
|
// Rekursif untuk elemen array
|
||||||
$arr1[$key] = $this->arrayMergeRecursive($arr1[$key], $value);
|
$arr1[$key] = $this->arrayMergeRecursive($arr1[$key], $value);
|
||||||
} else {
|
} else {
|
||||||
// Ganti nilai lama dengan nilai baru
|
// Ganti nilai lama dengan nilai baru
|
||||||
@@ -981,12 +959,8 @@ class SaveFormInspesksiService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bersihkan key lama yang tidak ada di array baru
|
// Hapus key lama yang tidak ada di array baru kecuali 'signature'
|
||||||
foreach ($arr1 as $key => $value) {
|
$arr1 = array_intersect_key($arr1, $arr2 + ['signature' => true]);
|
||||||
if (!array_key_exists($key, $arr2) && $key !== 'signature') {
|
|
||||||
unset($arr1[$key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $arr1;
|
return $arr1;
|
||||||
}
|
}
|
||||||
@@ -1010,7 +984,7 @@ class SaveFormInspesksiService
|
|||||||
throw new Exception("Invalid file upload for {$fileKey}");
|
throw new Exception("Invalid file upload for {$fileKey}");
|
||||||
}
|
}
|
||||||
} elseif (isset($data[$fileKey]) && $data[$fileKey]) {
|
} elseif (isset($data[$fileKey]) && $data[$fileKey]) {
|
||||||
return $data[$fileKey];
|
return $data[$fileKey] ?? null;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,45 +5,45 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@push('styles')
|
@push('styles')
|
||||||
<style>
|
<style>
|
||||||
.dropdown {
|
.dropdown {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdowns-content {
|
.dropdowns-content {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
min-width: 224px;
|
min-width: 224px;
|
||||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
/* Hilangkan jarak antara tombol dan dropdown */
|
/* Hilangkan jarak antara tombol dan dropdown */
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown:hover .dropdowns-content {
|
.dropdown:hover .dropdowns-content {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tambahkan hover untuk elemen dropdown agar tidak hilang */
|
/* Tambahkan hover untuk elemen dropdown agar tidak hilang */
|
||||||
.dropdowns-content:hover {
|
.dropdowns-content:hover {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdowns-content a {
|
.dropdowns-content a {
|
||||||
color: black;
|
color: black;
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdowns-content a:hover {
|
.dropdowns-content a:hover {
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@endpush
|
@endpush
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||||
data-datatable-state-save="false" id="laporan-penilai-jaminan-table"
|
data-datatable-state-save="false" id="laporan-penilai-jaminan-table"
|
||||||
@@ -76,9 +76,8 @@
|
|||||||
<div class="flex">
|
<div class="flex">
|
||||||
<!-- Custom dropdown for status filter -->
|
<!-- Custom dropdown for status filter -->
|
||||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||||
<button
|
<button class="dropdowns-toggle btn btn-light inline-flex justify-between w-full items-center">
|
||||||
class="dropdowns-toggle btn btn-light inline-flex justify-between w-full items-center">
|
Pilih Type Laporan
|
||||||
Pilih Status
|
|
||||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
<i class="ki-outline ki-down dropdown-open:hidden">
|
||||||
</i>
|
</i>
|
||||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
<i class="ki-outline ki-up hidden dropdown-open:block">
|
||||||
@@ -96,9 +95,16 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<!-- Dinamis Status dari Backend -->
|
<!-- Dinamis Status dari Backend -->
|
||||||
@php
|
@php
|
||||||
$status_laporan = ['Standar', 'Sederhana', 'Memo', 'Resume', 'Call Report', 'RAP'];
|
$status_laporan = [
|
||||||
@endphp
|
'Standar',
|
||||||
|
'Sederhana',
|
||||||
|
'Memo',
|
||||||
|
'Resume',
|
||||||
|
'Call Report',
|
||||||
|
'RAP',
|
||||||
|
];
|
||||||
|
@endphp
|
||||||
@foreach ($status_laporan as $item)
|
@foreach ($status_laporan as $item)
|
||||||
<div class="menu-item">
|
<div class="menu-item">
|
||||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||||
@@ -216,10 +222,15 @@
|
|||||||
const dataTableOptions = {
|
const dataTableOptions = {
|
||||||
apiEndpoint: apiUrl,
|
apiEndpoint: apiUrl,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
|
params: {
|
||||||
|
startDate: '',
|
||||||
|
endDate: '',
|
||||||
|
},
|
||||||
order: [{
|
order: [{
|
||||||
column: 'nomor_registrasi',
|
column: 'nomor_registrasi',
|
||||||
dir: 'asc'
|
dir: 'asc'
|
||||||
}],
|
}],
|
||||||
|
|
||||||
columns: {
|
columns: {
|
||||||
select: {
|
select: {
|
||||||
render: (item, data, context) => {
|
render: (item, data, context) => {
|
||||||
@@ -292,7 +303,8 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||||
@@ -312,14 +324,20 @@
|
|||||||
const tanggalAwal = tanggalAwalInput.value;
|
const tanggalAwal = tanggalAwalInput.value;
|
||||||
const tanggalAkhir = tanggalAkhirInput.value;
|
const tanggalAkhir = tanggalAkhirInput.value;
|
||||||
|
|
||||||
if (tanggalAwal && tanggalAkhir) {
|
let filters = {};
|
||||||
// Reload the table with date filters
|
if (searchInput.value) {
|
||||||
dataTable.setParameter('tanggal_awal', tanggalAwal);
|
filters.search = searchInput.value;
|
||||||
dataTable.setParameter('tanggal_akhir', tanggalAkhir);
|
|
||||||
dataTable.reload();
|
|
||||||
} else {
|
|
||||||
alert('Mohon isi tanggal awal dan tanggal akhir');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tanggalAwal) {
|
||||||
|
filters.tanggal_awal = tanggalAwal
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tanggalAkhir) {
|
||||||
|
filters.tanggal_akhir = tanggalAkhir
|
||||||
|
}
|
||||||
|
|
||||||
|
dataTable.search(filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status filter functionality
|
// Status filter functionality
|
||||||
@@ -342,9 +360,11 @@
|
|||||||
.map(checkbox => checkbox.value);
|
.map(checkbox => checkbox.value);
|
||||||
|
|
||||||
if (selectedStatuses.length === 0) {
|
if (selectedStatuses.length === 0) {
|
||||||
dataTable.setParameter('status', null);
|
dataTable.search('');
|
||||||
|
console.log(selectedStatuses);
|
||||||
} else {
|
} else {
|
||||||
dataTable.setParameter('status', selectedStatuses);
|
dataTable.search(selectedStatuses.join(','), true);
|
||||||
|
console.log(selectedStatuses);
|
||||||
}
|
}
|
||||||
|
|
||||||
dataTable.reload();
|
dataTable.reload();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<form id="dataPembandingForm" method="POST" enctype="multipart/form-data" class="grid gap-5">
|
<form id="dataPembandingForm" method="POST" enctype="multipart/form-data" class="grid gap-5">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||||
<input type="hidden" name="type" value="tanah">
|
|
||||||
<input type="hidden" name="dokument_id" value="{{ request('dokument') }}">
|
<input type="hidden" name="dokument_id" value="{{ request('dokument') }}">
|
||||||
<input type="hidden" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi }}">
|
<input type="hidden" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi }}">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@@ -29,9 +29,12 @@
|
|||||||
@php
|
@php
|
||||||
$dokumentName = $dokumen->jenisJaminan->name;
|
$dokumentName = $dokumen->jenisJaminan->name;
|
||||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||||
|
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||||
|
$kategoriUnik = array_unique($kategoriArray);
|
||||||
@endphp
|
@endphp
|
||||||
<input type="hidden" name="action"
|
<input type="hidden" name="action"
|
||||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||||
|
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||||
@if (!in_array(strtoupper($dokumentName), $tanahBangunanTypes))
|
@if (!in_array(strtoupper($dokumentName), $tanahBangunanTypes))
|
||||||
@include('lpj::surveyor.components.pembanding-tanah-bangunan-unit')
|
@include('lpj::surveyor.components.pembanding-tanah-bangunan-unit')
|
||||||
@else
|
@else
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
<input id="inputGistaru" type="file" name="upload_gs"
|
<input id="inputGistaru" type="file" name="upload_gs"
|
||||||
class="file-input file-input-bordered w-full"
|
class="file-input file-input-bordered w-full"
|
||||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||||
onchange="previewImage(this, 'upload-gs-preview')">
|
onchange="uploadFile(this, 'upload-gs-preview', 'upload_gs')">
|
||||||
|
|
||||||
<img id="upload-gs-preview"
|
<img id="upload-gs-preview"
|
||||||
src="{{ asset('storage/' . (isset($forminspeksi['upload_gs']) ? $forminspeksi['upload_gs'] : '')) }}"
|
src="{{ asset('storage/' . (isset($forminspeksi['upload_gs']) ? $forminspeksi['upload_gs'] : '')) }}"
|
||||||
@@ -146,7 +146,8 @@
|
|||||||
<input id="inputGistaru" type="file" name="foto_sentuh_tanahku"
|
<input id="inputGistaru" type="file" name="foto_sentuh_tanahku"
|
||||||
class="file-input file-input-bordered w-full"
|
class="file-input file-input-bordered w-full"
|
||||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||||
onchange="previewImage(this, 'sentuh_tanahku-preview')">
|
onchange="uploadFile(this, 'sentuh_tanahku-preview', 'foto_sentuh_tanahku')"
|
||||||
|
>
|
||||||
|
|
||||||
<img id="sentuh_tanahku-preview"
|
<img id="sentuh_tanahku-preview"
|
||||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
||||||
@@ -169,7 +170,7 @@
|
|||||||
<input id="inputGistaru" type="file" name="foto_gistaru"
|
<input id="inputGistaru" type="file" name="foto_gistaru"
|
||||||
class="file-input file-input-bordered w-full"
|
class="file-input file-input-bordered w-full"
|
||||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||||
onchange="previewImage(this, 'gistaru-preview')">
|
onchange="uploadFile(this, 'gistaru-preview', 'foto_gistaru')">
|
||||||
|
|
||||||
<img id="gistaru-preview"
|
<img id="gistaru-preview"
|
||||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_gistaru']) ? $forminspeksi['foto_gistaru'] : '')) }}"
|
src="{{ asset('storage/' . (isset($forminspeksi['foto_gistaru']) ? $forminspeksi['foto_gistaru'] : '')) }}"
|
||||||
@@ -197,7 +198,7 @@
|
|||||||
<input id="inputBhumi" type="file" name="foto_bhumi"
|
<input id="inputBhumi" type="file" name="foto_bhumi"
|
||||||
class="file-input file-input-bordered w-full "
|
class="file-input file-input-bordered w-full "
|
||||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||||
onchange="previewImage(this, 'bhumi-preview')">
|
onchange="uploadFile(this, 'bhumi-preview', 'foto_bhumi')">
|
||||||
<img id="bhumi-preview"
|
<img id="bhumi-preview"
|
||||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_bhumi']) ? $forminspeksi['foto_bhumi'] : '')) }}"
|
src="{{ asset('storage/' . (isset($forminspeksi['foto_bhumi']) ? $forminspeksi['foto_bhumi'] : '')) }}"
|
||||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||||
@@ -210,97 +211,191 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
<span class="form-label">Blad Tata Ruang Perdaerah</span>
|
<span class="form-label">Blad Tata Ruang Perdaerah</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="input-group w-full flex gap-2">
|
|
||||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
|
||||||
<div class="w-full">
|
|
||||||
<input id="inputArgisRegion" type="file" name="foto_argis_region"
|
|
||||||
class="file-input file-input-bordered w-full"
|
|
||||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
|
||||||
onchange="previewImage(this, 'argis-region-preview')">
|
|
||||||
<img id="argis-region-preview"
|
|
||||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_argis_region']) ? $forminspeksi['foto_argis_region'] : '')) }}"
|
|
||||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
|
||||||
style="{{ isset($forminspeksi['foto_argis_region']) ? '' : 'display: none;' }} max-width: 30rem;">
|
|
||||||
</div>
|
|
||||||
<
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Upload Photo Button -->
|
|
||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
|
||||||
<label for="" class="form-label max-w-56 text-sm font-medium text-gray-700">Upload Peta</label>
|
|
||||||
<div class="w-full grid gap-5">
|
|
||||||
<div class="input-group w-full flex gap-2">
|
<div class="input-group w-full flex gap-2">
|
||||||
<input id="foto_tempat" type="file" name="foto_tempat"
|
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||||
class="file-input file-input-bordered w-full"
|
<div class="w-full">
|
||||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
<input id="inputArgisRegion" type="file" name="foto_argis_region"
|
||||||
onchange="previewImage(this, 'foto_tempat-preview')">
|
class="file-input file-input-bordered w-full"
|
||||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
onchange="uploadFile(this, 'argis-region-preview', 'foto_argis_region')">
|
||||||
</button>
|
<img id="argis-region-preview"
|
||||||
|
src="{{ asset('storage/' . (isset($forminspeksi['foto_argis_region']) ? $forminspeksi['foto_argis_region'] : '')) }}"
|
||||||
|
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||||
|
style="{{ isset($forminspeksi['foto_argis_region']) ? '' : 'display: none;' }} max-width: 30rem;">
|
||||||
|
</div>
|
||||||
|
< </div>
|
||||||
</div>
|
</div>
|
||||||
@php
|
|
||||||
$fotoTempat = $forminspeksi['foto_tempat'] ?? null;
|
|
||||||
$fotoSrc = '';
|
|
||||||
|
|
||||||
if (is_array($fotoTempat)) {
|
|
||||||
$fotoSrc = asset('storage/' . $fotoTempat[0]);
|
|
||||||
} elseif (!empty($fotoTempat)) {
|
|
||||||
$fotoSrc = asset('storage/' . $fotoTempat);
|
|
||||||
}
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
<img id="foto_tempat-preview" src="{{ $fotoSrc ?: '' }}"
|
|
||||||
alt="Foto Tempat" class="mt-2 max-w-full h-auto"
|
|
||||||
style="max-width: 30rem; {{ $fotoSrc ? '' : 'display: none;' }}">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- Upload Photo Button -->
|
||||||
|
|
||||||
<!-- Notes Section -->
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||||
|
<label for="" class="form-label max-w-56 text-sm font-medium text-gray-700">Upload
|
||||||
|
Peta</label>
|
||||||
|
<div class="w-full grid gap-5">
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
|
<input id="foto_tempat" type="file" name="foto_tempat"
|
||||||
|
class="file-input file-input-bordered w-full"
|
||||||
|
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||||
|
onchange="uploadFile(this, 'foto_tempat-preview', 'foto_tempat')">
|
||||||
|
<button type="button" id="btnCamera" class="btn btn-light"
|
||||||
|
data-modal-toggle="#cameraModal">
|
||||||
|
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@php
|
||||||
|
$fotoTempat = $forminspeksi['foto_tempat'] ?? null;
|
||||||
|
$fotoSrc = '';
|
||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
if (is_array($fotoTempat)) {
|
||||||
|
$fotoSrc = asset('storage/' . $fotoTempat[0]);
|
||||||
|
} elseif (!empty($fotoTempat)) {
|
||||||
|
$fotoSrc = asset('storage/' . $fotoTempat);
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
|
||||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
<img id="foto_tempat-preview" src="{{ $fotoSrc ?: '' }}" alt="Foto Tempat"
|
||||||
</label>
|
class="mt-2 max-w-full h-auto"
|
||||||
<div class="w-full">
|
style="max-width: 30rem; {{ $fotoSrc ? '' : 'display: none;' }}">
|
||||||
<div id="keterangan-container" class="flex items-baseline flex-wrap gap-2.5 w-full">
|
|
||||||
@if (!empty($forminspeksi['fakta']['keterangan']) && is_array($forminspeksi['fakta']['keterangan']))
|
</div>
|
||||||
@foreach ($forminspeksi['fakta']['keterangan'] as $index => $item)
|
</div>
|
||||||
|
|
||||||
|
<!-- Notes Section -->
|
||||||
|
|
||||||
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||||
|
|
||||||
|
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||||
|
</label>
|
||||||
|
<div class="w-full">
|
||||||
|
<div id="keterangan-container" class="flex items-baseline flex-wrap gap-2.5 w-full">
|
||||||
|
@if (!empty($forminspeksi['fakta']['keterangan']) && is_array($forminspeksi['fakta']['keterangan']))
|
||||||
|
@foreach ($forminspeksi['fakta']['keterangan'] as $index => $item)
|
||||||
|
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||||
|
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10">{{ old("keterangan.$index", $item) }}</textarea>
|
||||||
|
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||||
|
style="display: none;">
|
||||||
|
<i class="ki-outline ki-trash"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||||
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10">{{ old("keterangan.$index", $item) }}</textarea>
|
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10"></textarea>
|
||||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||||
style="display: none;">
|
style="display: none;">
|
||||||
<i class="ki-outline ki-trash"></i>
|
<i class="ki-outline ki-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<em id="error-keterangan" class="alert text-danger text-sm"></em>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endif
|
||||||
@else
|
</div>
|
||||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
<button type="button" onclick="addClonableItem('keterangan-container', 'keterangan')"
|
||||||
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10"></textarea>
|
class="btn btn-primary btn-sm mt-5 ">
|
||||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
<i class="ki-outline ki-plus"></i>
|
||||||
<i class="ki-outline ki-trash"></i>
|
</button>
|
||||||
</button>
|
|
||||||
<em id="error-keterangan" class="alert text-danger text-sm"></em>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
<button type="button" onclick="addClonableItem('keterangan-container', 'keterangan')"
|
|
||||||
class="btn btn-primary btn-sm mt-5 ">
|
|
||||||
<i class="ki-outline ki-plus"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
@include('lpj::surveyor.components.modal-kamera')
|
@include('lpj::surveyor.components.modal-kamera')
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
@include('lpj::surveyor.js.camera-editor')
|
<script stype="text/javascript">
|
||||||
@endpush
|
function uploadFile(inputElement, previewElement, url) {
|
||||||
|
// Ambil file dari elemen input
|
||||||
|
const file = inputElement.files[0];
|
||||||
|
|
||||||
|
|
||||||
|
if (!file) {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'warning',
|
||||||
|
title: 'Tidak ada file yang dipilih.',
|
||||||
|
toast: true,
|
||||||
|
position: 'top-end',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputElement.files && file) {
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(e) {
|
||||||
|
$('#' + previewElement).attr('src', e.target.result).show();
|
||||||
|
}
|
||||||
|
reader.readAsDataURL(inputElement.files[0]);
|
||||||
|
} else {
|
||||||
|
$('#' + previewElement).hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Buat FormData untuk mengirim file
|
||||||
|
const formData = new FormData();
|
||||||
|
|
||||||
|
const dokument = "{{ request('dokument') }}";
|
||||||
|
const permohonan = "{{ $permohonan->id }}";
|
||||||
|
formData.append('file', file);
|
||||||
|
formData.append('dokument_id', dokument);
|
||||||
|
formData.append('permohonan_id', permohonan);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/surveyor/upload-file-foto/' + url,
|
||||||
|
type: 'POST',
|
||||||
|
headers: {
|
||||||
|
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||||
|
},
|
||||||
|
data: formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function(response) {
|
||||||
|
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
// Tampilkan pesan sukses
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: response.message || 'File berhasil diunggah!',
|
||||||
|
toast: true,
|
||||||
|
position: 'top-end',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
|
||||||
|
// Perbarui elemen preview
|
||||||
|
$(previewElement).attr('src', response.data.path).show();
|
||||||
|
$(inputElement).data('file-name', response.data.file_name);
|
||||||
|
} else {
|
||||||
|
// Tampilkan pesan kesalahan dari server
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: response.message || 'Gagal mengunggah file!',
|
||||||
|
toast: true,
|
||||||
|
position: 'top-end',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
|
||||||
|
|
||||||
|
// Tampilkan pesan kesalahan
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: xhr.responseJSON?.message || 'Terjadi kesalahan saat mengunggah file.',
|
||||||
|
toast: true,
|
||||||
|
position: 'top-end',
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
|
console.error(`Error: ${error}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@include('lpj::surveyor.js.camera-editor')
|
||||||
|
@endpush
|
||||||
|
|||||||
@@ -517,6 +517,19 @@
|
|||||||
showLoadingSwal('Mengirim data ke server...');
|
showLoadingSwal('Mengirim data ke server...');
|
||||||
const form = document.querySelector('form');
|
const form = document.querySelector('form');
|
||||||
const formData = new FormData(form);
|
const formData = new FormData(form);
|
||||||
|
|
||||||
|
const fotoFields = [
|
||||||
|
'foto_gistaru',
|
||||||
|
'foto_bhumi',
|
||||||
|
'foto_argis_region',
|
||||||
|
'foto_tempat',
|
||||||
|
'foto_sentuh_tanahku',
|
||||||
|
'upload_gs'
|
||||||
|
];
|
||||||
|
|
||||||
|
fotoFields.forEach((field) => {
|
||||||
|
formData.delete(field);
|
||||||
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ route('surveyor.store') }}',
|
url: '{{ route('surveyor.store') }}',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
|||||||
@@ -599,6 +599,8 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey');
|
Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey');
|
||||||
Route::post('save-edited-image/', [SurveyorController::class, 'saveEditedImage'])->name('saveEditedImage');
|
Route::post('save-edited-image/', [SurveyorController::class, 'saveEditedImage'])->name('saveEditedImage');
|
||||||
|
|
||||||
|
Route::post('upload-file-foto/{url}', [SurveyorController::class, 'uploadFileFoto'])->name('uploadFileFoto');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::name('penilai.')->prefix('penilai')->group(function () {
|
Route::name('penilai.')->prefix('penilai')->group(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user