@extends('layouts.admin') @section('title','Presensi Link') @section('page_title','Presensi Berbasis Link') @section('page_subtitle','1 perangkat = 1 peserta • lokasi GPS • foto presensi')
@section('content')
<div class="grid form-grid"><form class="card form" method="post" action="{{ route('attendance.store') }}">@csrf<h3>Generate Link Presensi</h3><label>Unit<select name="organization_id">@foreach($orgs as $o)<option value="{{ $o->id }}">{{ $o->acronym ?: $o->name }}</option>@endforeach</select></label><label>Kegiatan (opsional)<select name="activity_id"><option value="">Tanpa kegiatan terhubung</option>@foreach($activities as $a)<option value="{{ $a->id }}">{{ $a->title }}</option>@endforeach</select></label><label>Judul Presensi<input name="title" required placeholder="Rapat Pleno MWCNU Tugu"></label><div class="two"><label>Dibuka<input type="datetime-local" name="opens_at"></label><label>Ditutup<input type="datetime-local" name="closes_at"></label></div><label>Nama Lokasi<input name="location_name" placeholder="Kantor MWCNU Tugu"></label><div class="three"><label>Latitude<input name="latitude"></label><label>Longitude<input name="longitude"></label><label>Radius (meter)<input type="number" name="radius_meters" value="300" required></label></div><div class="toggle-grid"><label><input type="checkbox" name="require_location" value="1" checked> Wajib lokasi</label><label><input type="checkbox" name="require_photo" value="1" checked> Wajib foto</label><label><input type="checkbox" name="one_device_one_person" value="1" checked> 1 perangkat = 1 orang</label></div><label>Simpan foto selama<select name="retention_months"><option value="3">3 bulan</option><option value="6" selected>6 bulan</option><option value="12">12 bulan</option></select></label><button class="btn primary">Generate Link</button></form><div class="card tip"><h3>Catatan</h3><p>Validasi perangkat memakai ID browser tersimpan. Ini cocok untuk kontrol operasional, tetapi bukan identitas perangkat permanen yang mustahil diakali.</p></div></div>
<div class="card table-card"><div class="table-wrap"><table><thead><tr><th>Presensi</th><th>Unit</th><th>Periode</th><th>Peserta</th><th>Link</th><th>Status</th></tr></thead><tbody>@foreach($sessions as $s)<tr><td><b>{{ $s->title }}</b><small>{{ $s->location_name }} • radius {{ $s->radius_meters }} m</small></td><td>{{ $s->organization?->acronym }}</td><td>{{ $s->opens_at?->format('d M H:i') }} – {{ $s->closes_at?->format('d M H:i') }}</td><td><a class="btn" href="{{ route('attendance.entries',$s) }}">{{ $s->entries_count }} orang</a></td><td><input value="{{ route('attendance.public',$s->token) }}" readonly onclick="this.select()" style="min-width:280px"></td><td><form method="post" action="{{ route('attendance.toggle',$s) }}">@csrf<button class="btn {{ $s->is_active?'primary':'' }}">{{ $s->is_active?'Aktif':'Nonaktif' }}</button></form></td></tr>@endforeach</tbody></table></div>{{ $sessions->links() }}</div>
@endsection
