<script>
function isiLokasiAbsensi() {
 // GANTI \'text-1\' dengan name field yang kamu lihat di Inspect, contoh: \'text-1\'
 var lokasiField = document.querySelector(\'input[name=\"text-1\"]\');
 if (!lokasiField) {
 console.log(\'Field lokasi tidak ditemukan\');
 return;
 }

 if (!navigator.geolocation) {
 lokasiField.value = \'Geolocation not supported\';
 lokasiField.readOnly = true;
 console.log(\'Geolocation not supported\');
 return;
 }

 lokasiField.placeholder = \'Mengambil lokasi... izinkan browser\';

 navigator.geolocation.getCurrentPosition(
 function (pos) {
 var lat = pos.coords.latitude.toFixed(6);
 var lng = pos.coords.longitude.toFixed(6);
 lokasiField.value = lat + \', \' + lng;
 lokasiField.placeholder = \'\';
 lokasiField.readOnly = true;
 console.log(\'Lokasi terisi:\', lokasiField.value);
 },
 function (err) {
 lokasiField.value = \'Location error: \' + err.message;
 lokasiField.readOnly = true;
 console.log(\'Error lokasi:\', err.message);
 },
 { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }
 );
}

document.addEventListener(\'DOMContentLoaded\', function () {
 console.log(\'DOMContentLoaded, panggil isiLokasiAbsensi\');
 isiLokasiAbsensi();
});
</script>
<script>
document.addEventListener(\'DOMContentLoaded\', function () {
var uidField = document.querySelector(\'.absen-userid input\');
var unameField = document.querySelector(\'.absen-username input\');
var uemailField = document.querySelector(\'.absen-useremail input\');

if (uidField && uidField.value) localStorage.setItem(\'absen_uid\', uidField.value);
if (unameField && unameField.value)localStorage.setItem(\'absen_uname\', unameField.value);
if (uemailField && uemailField.value)localStorage.setItem(\'absen_uemail\', uemailField.value);

// fallback kalau field kosong tapi localStorage ada
if (uidField && !uidField.value) uidField.value = localStorage.getItem(\'absen_uid\') || \'\';
if (unameField && !unameField.value)unameField.value = localStorage.getItem(\'absen_uname\') || \'\';
if (uemailField && !uemailField.value)uemailField.value = localStorage.getItem(\'absen_uemail\') || \'\';
});
</script>