Merge remote-tracking branch 'composer/feature/senior-officer' into staging

# Conflicts:
#	resources/views/penilaian/otorisator/show.blade.php
This commit is contained in:
Daeng Deni Mardaeni
2024-12-24 11:56:47 +07:00
8 changed files with 1032 additions and 501 deletions

View File

@@ -107,7 +107,7 @@
value="rute_{{ $index }}">
<input id="inputRute-{{ $index }}" type="file" name="foto_rute[]"
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"
@@ -390,7 +390,7 @@
</label>
<div class="input-group w-full grid gap-5">
<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'])) }}"
alt="Foto Lantai" class="mt-2 h-auto"
style="{{ old('foto_lantai_unit', $item['foto_lantai_unit']) ? 'display: block;' : 'display: none;' }} width: 30rem;">

View File

@@ -218,7 +218,7 @@
</div>
<div class="card-body">
<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 class="grid grid-cols-2 gap-4 items-center w-full">
<input class="input" type="text" placeholder="Masukan Koordinat Latitude" type="text"
@@ -228,10 +228,12 @@
name="kordinat_lng" id="lng"
value="{{ old('kordinat_lng', isset($forminspeksi['asset']['kordinat_lng']) ? $forminspeksi['asset']['kordinat_lng'] : '') }}">
</div>
<a target="_blank" href="https://www.google.com/maps" type="button"
class="btn btn-md btn-outline btn-primary">
<a onclick="getCoordinates()" type="button" class="btn btn-md btn-outline btn-primary">
<i class="ki-filled ki-map"></i>Ambil
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>
@@ -443,11 +445,9 @@
@endphp
<input id="hub_penghuni_tidak_sesuai" class="input"
name="hub_penghuni_tidak_sesuai"
<input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai"
placeholder="Masukkan Hubungin penghuni jaminan"
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}">
</div>
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
@@ -460,6 +460,43 @@
</div>
</div>
<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() {
// Cek radio button saat halaman dimuat
const sesuaiRadio = document.querySelector('input[name="alamat_sesuai"][value="sesuai"]');

View File

@@ -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-content">
@@ -85,4 +99,4 @@
</div>
</div>
</div>
</div>
</div>