<!doctype html><html lang="id"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Presensi {{ $session->title }}</title><link rel="stylesheet" href="{{ asset('assets/css/app.css') }}"></head><body class="attendance-body"><main class="attendance-shell"><div class="attendance-head"><div class="brand-mark">NU</div><div><b>MWCNU TUGU</b><small>Presensi Kegiatan</small></div></div><div class="attendance-card"><span class="pill">{{ $session->isOpen()?'PRESENSI DIBUKA':'PRESENSI DITUTUP' }}</span><h1>{{ $session->title }}</h1><p>{{ $session->location_name }}<br>@if($session->opens_at){{ $session->opens_at->format('d M Y H:i') }}@endif @if($session->closes_at) – {{ $session->closes_at->format('d M Y H:i') }}@endif</p>@if(session('success'))<div class="alert success">{{ session('success') }}</div>@else @if($errors->any())<div class="alert danger">{{ $errors->first() }}</div>@endif<form id="attendanceForm" method="post" enctype="multipart/form-data" action="{{ route('attendance.submit',$session->token) }}">@csrf<label>Nama Lengkap<input name="full_name" required></label><label>Nama Panggilan<input name="nickname"></label><div class="two"><label>Ranting/Banom/Lembaga<input name="organization_name"></label><label>Jabatan<input name="position"></label></div><label>Nomor WhatsApp<input name="whatsapp" inputmode="tel"></label><input type="hidden" name="device_id" id="device_id"><input type="hidden" name="latitude" id="latitude"><input type="hidden" name="longitude" id="longitude">@if($session->require_location)<div class="location-box" id="locationStatus">📍 Mengambil lokasi...</div>@endif @if($session->require_photo)<label>Foto Presensi<input type="file" name="photo" accept="image/*" capture="environment" required><small>Ambil foto di lokasi kegiatan.</small></label>@endif<div class="privacy-note">Lokasi dan foto digunakan untuk verifikasi kehadiran dan hanya dapat diakses pengurus berwenang.</div><button class="btn primary wide" id="submitBtn" {{ $session->isOpen()?'':'disabled' }}>Kirim Presensi</button></form>@endif</div></main><script>const deviceKey='nutugu_device_id';let device=localStorage.getItem(deviceKey);if(!device){device=(crypto.randomUUID?crypto.randomUUID():(Date.now()+'-'+Math.random()));localStorage.setItem(deviceKey,device)}document.getElementById('device_id').value=device;@if($session->require_location)if(navigator.geolocation){navigator.geolocation.getCurrentPosition(p=>{document.getElementById('latitude').value=p.coords.latitude;document.getElementById('longitude').value=p.coords.longitude;document.getElementById('locationStatus').innerHTML='✅ Lokasi diperoleh • akurasi ±'+Math.round(p.coords.accuracy)+' m';},e=>{document.getElementById('locationStatus').innerHTML='❌ Lokasi belum diizinkan. Aktifkan izin lokasi pada browser.';},{enableHighAccuracy:true,timeout:15000,maximumAge:0});}else{document.getElementById('locationStatus').innerHTML='❌ Browser tidak mendukung lokasi.';}@endif</script></body></html>
