update lokasi otomatis dan print out
This commit is contained in:
@@ -211,8 +211,6 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -537,9 +535,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@endif
|
@endif
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" {{ in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) ? 'checked' : '' }}> {{ $item->name }}
|
<input type="checkbox"
|
||||||
</td>
|
{{ isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) && in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) ? 'checked' : '' }}>
|
||||||
|
{{ $item->name }}
|
||||||
|
</td>
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -51,18 +51,20 @@
|
|||||||
@php
|
@php
|
||||||
$inspeksiId = null;
|
$inspeksiId = null;
|
||||||
$documentId = null;
|
$documentId = null;
|
||||||
|
$jenisJaminanId = null;
|
||||||
foreach ($permohonan->debiture->documents as $item) {
|
foreach ($permohonan->debiture->documents as $item) {
|
||||||
foreach ($item->inspeksi as $key => $value) {
|
foreach ($item->inspeksi as $key => $value) {
|
||||||
$inspeksiId = $item->id;
|
$inspeksiId = $item->id;
|
||||||
}
|
}
|
||||||
$documentId = $item->dokumen_id;
|
$documentId = $item->id;
|
||||||
|
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@if ($dataHeader == 'pelaporan')
|
@if ($dataHeader == 'pelaporan')
|
||||||
<a class="btn btn-success"
|
<a class="btn btn-success"
|
||||||
href="{{ route('penilai.print-out') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
href="{{ route('penilai.print-out') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}">
|
||||||
PRINT OUT
|
Lihat Laporan
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
value="rute_{{ $index }}">
|
value="rute_{{ $index }}">
|
||||||
<input id="inputRute-{{ $index }}" type="file" name="foto_rute[]"
|
<input id="inputRute-{{ $index }}" type="file" name="foto_rute[]"
|
||||||
class="file-input file-input-bordered w-full" accept="image/*"
|
class="file-input file-input-bordered w-full" accept="image/*"
|
||||||
capture="camera" onchange="previewImage(this, 'foto_rute-preview')">
|
capture="camera" onchange="previewImage(this, 'foto_rute-preview-{{ $index }}')">
|
||||||
|
|
||||||
|
|
||||||
<button type="button" id="btnCamera-{{ $index }}" class="btn btn-light"
|
<button type="button" id="btnCamera-{{ $index }}" class="btn btn-light"
|
||||||
@@ -390,7 +390,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<div class="input-group w-full grid gap-5">
|
<div class="input-group w-full grid gap-5">
|
||||||
<div class="preview-container">
|
<div class="preview-container">
|
||||||
<img id="foto_lantai-preview-{{ $loop->index }}"
|
<img id="foto_lantai-preview-{{ $loop->iteration }}"
|
||||||
src="{{ asset('storage/' . old('foto_lantai_unit', $item['foto_lantai_unit'])) }}"
|
src="{{ asset('storage/' . old('foto_lantai_unit', $item['foto_lantai_unit'])) }}"
|
||||||
alt="Foto Lantai" class="mt-2 h-auto"
|
alt="Foto Lantai" class="mt-2 h-auto"
|
||||||
style="{{ old('foto_lantai_unit', $item['foto_lantai_unit']) ? 'display: block;' : 'display: none;' }} width: 30rem;">
|
style="{{ old('foto_lantai_unit', $item['foto_lantai_unit']) ? 'display: block;' : 'display: none;' }} width: 30rem;">
|
||||||
|
|||||||
@@ -218,7 +218,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<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">“Koordinat</label>
|
<label class="form-label max-w-56">Koordinat</label>
|
||||||
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
||||||
<div class="grid grid-cols-2 gap-4 items-center w-full">
|
<div class="grid grid-cols-2 gap-4 items-center w-full">
|
||||||
<input class="input" type="text" placeholder="Masukan Koordinat Latitude" type="text"
|
<input class="input" type="text" placeholder="Masukan Koordinat Latitude" type="text"
|
||||||
@@ -228,10 +228,12 @@
|
|||||||
name="kordinat_lng" id="lng"
|
name="kordinat_lng" id="lng"
|
||||||
value="{{ old('kordinat_lng', isset($forminspeksi['asset']['kordinat_lng']) ? $forminspeksi['asset']['kordinat_lng'] : '') }}">
|
value="{{ old('kordinat_lng', isset($forminspeksi['asset']['kordinat_lng']) ? $forminspeksi['asset']['kordinat_lng'] : '') }}">
|
||||||
</div>
|
</div>
|
||||||
<a target="_blank" href="https://www.google.com/maps" type="button"
|
<a onclick="getCoordinates()" type="button" class="btn btn-md btn-outline btn-primary">
|
||||||
class="btn btn-md btn-outline btn-primary">
|
|
||||||
<i class="ki-filled ki-map"></i>Ambil
|
<i class="ki-filled ki-map"></i>Ambil
|
||||||
Koordinat </a>
|
Koordinat </a>
|
||||||
|
<a target="_blank" href="https://www.google.com/maps" type="button"
|
||||||
|
class="btn btn-md btn-outline btn-success">
|
||||||
|
<i class="ki-filled ki-map"></i>Ke google Maps</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -443,11 +445,9 @@
|
|||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
|
||||||
<input id="hub_penghuni_tidak_sesuai" class="input"
|
<input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai"
|
||||||
name="hub_penghuni_tidak_sesuai"
|
|
||||||
placeholder="Masukkan Hubungin penghuni jaminan"
|
placeholder="Masukkan Hubungin penghuni jaminan"
|
||||||
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
|
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
|
||||||
|
|
||||||
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}">
|
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}">
|
||||||
</div>
|
</div>
|
||||||
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
|
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
|
||||||
@@ -460,6 +460,43 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
function getCoordinates() {
|
||||||
|
if (navigator.geolocation) {
|
||||||
|
navigator.geolocation.getCurrentPosition(
|
||||||
|
(position) => {
|
||||||
|
// Ambil latitude dan longitude
|
||||||
|
const lat = position.coords.latitude;
|
||||||
|
const lng = position.coords.longitude;
|
||||||
|
|
||||||
|
// Masukkan ke dalam input field
|
||||||
|
document.getElementById('lat').value = lat;
|
||||||
|
document.getElementById('lng').value = lng;
|
||||||
|
toastrSuccessBuild('Koordinat berhasil diambil!');
|
||||||
|
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
// Handle error
|
||||||
|
switch (error.code) {
|
||||||
|
case error.PERMISSION_DENIED:
|
||||||
|
toastrErrorBuild('Pengguna menolak permintaan geolokasi.');
|
||||||
|
break;
|
||||||
|
case error.POSITION_UNAVAILABLE:
|
||||||
|
toastrErrorBuild('Informasi lokasi tidak tersedia.');
|
||||||
|
break;
|
||||||
|
case error.TIMEOUT:
|
||||||
|
toastrErrorBuild('Permintaan geolokasi mengalami timeout.');
|
||||||
|
break;
|
||||||
|
case error.UNKNOWN_ERROR:
|
||||||
|
toastrErrorBuild('Terjadi kesalahan yang tidak diketahui.');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
toastrErrorBuild('Geolocation tidak didukung oleh browser ini.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Cek radio button saat halaman dimuat
|
// Cek radio button saat halaman dimuat
|
||||||
const sesuaiRadio = document.querySelector('input[name="alamat_sesuai"][value="sesuai"]');
|
const sesuaiRadio = document.querySelector('input[name="alamat_sesuai"][value="sesuai"]');
|
||||||
|
|||||||
@@ -1,3 +1,17 @@
|
|||||||
|
<style>
|
||||||
|
.camera-container {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
video, canvas {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="modal fade" data-modal="true" id="cameraModal" data-backdrop="" data-keyboard="false">
|
<div class="modal fade" data-modal="true" id="cameraModal" data-backdrop="" data-keyboard="false">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
||||||
@@ -85,4 +99,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user