@extends('layouts.admin') @section('title','Surat Menyurat') @section('page_title','Surat Menyurat') @section('page_subtitle','Surat masuk, keluar, disposisi, arsip & QR verifikasi') @section('content')
<div class="grid form-grid"><section class="card"><h3>Buat / Catat Surat</h3><form method="post" action="{{ route('letters.store') }}" class="form">@csrf<div class="two"><label>Unit<select name="organization_id">@foreach($orgs as $o)<option value="{{ $o->id }}">{{ $o->acronym }}</option>@endforeach</select></label><label>Arah Surat<select name="direction"><option value="outgoing">Surat Keluar</option><option value="incoming">Surat Masuk</option></select></label></div><div class="two"><label>Jenis<input name="type" value="Undangan" required></label><label>Nomor Surat<input name="number" placeholder="Mengikuti pedoman unit"></label></div><label>Perihal<input name="subject" required></label><div class="two"><label>Pengirim<input name="sender"></label><label>Tujuan<input name="recipient"></label></div><div class="two"><label>Tanggal<input type="date" name="letter_date" value="{{ now()->toDateString() }}" required></label><label>Status<select name="status"><option value="draft">Draft</option><option value="pending">Menunggu Persetujuan</option><option value="published">Diterbitkan</option><option value="disposition">Disposisi</option><option value="done">Selesai</option></select></label></div><label>Isi / Catatan<textarea name="body" rows="5"></textarea></label><button class="btn primary">Simpan Surat</button></form></section><section class="card tip"><h3>Pedoman Persuratan</h3><p>Format nomor, kop, kode klasifikasi, tanda tangan dan stempel <b>tidak disamakan antar unit</b>. Starter ini menyiapkan struktur datanya; aturan final perlu diisi sesuai pedoman resmi MWCNU, Ansor, Fatayat, Muslimat, IPNU, IPPNU, LAZISNU, LBMNU dan Perekonomian.</p><p>Setiap surat mendapat token verifikasi yang bisa dikembangkan menjadi QR Code.</p></section></div>
<section class="card table-card"><div class="section-head"><h3>Arsip Surat</h3><span>{{ $letters->total() }} surat</span></div><div class="table-wrap"><table><thead><tr><th>Tanggal</th><th>Unit</th><th>Nomor</th><th>Perihal</th><th>Arah</th><th>Status</th><th>Verifikasi</th></tr></thead><tbody>@foreach($letters as $l)<tr><td>{{ $l->letter_date?->format('d/m/Y') }}</td><td>{{ $l->organization?->acronym }}</td><td>{{ $l->number ?: 'Belum bernomor' }}</td><td><b>{{ $l->subject }}</b><small>{{ $l->type }}</small></td><td>{{ $l->direction==='outgoing'?'Keluar':'Masuk' }}</td><td><span class="pill">{{ $l->status }}</span></td><td>@if($l->qr_token)<a href="{{ route('verify.letter',$l->qr_token) }}" target="_blank">Cek ↗</a>@endif</td></tr>@endforeach</tbody></table></div>{{ $letters->links() }}</section>@endsection