@extends('layouts.app')

@section('title', 'Undangan Ujian Skripsi (P5)')

@section('content')
<div class="card">
    <div class="card-header">
        <h3 class="card-title">Daftar Undangan P5</h3>
        <div class="card-tools"><a href="{{ route('p5.undangan_ujian.create') }}" class="btn btn-primary btn-sm">Buat Undangan P5</a></div>
    </div>
    <div class="card-body">
        <table class="table table-bordered table-striped datatables">
            <thead>
                <tr>
                    <th>No. Surat</th>
                    <th>NIM</th>
                    <th>Mahasiswa</th>
                    <th>Tgl Ujian</th>
                    <th>Jam</th>
                    <th>Aksi</th>
                </tr>
            </thead>
            <tbody>
                @foreach($p5 as $item)
                <tr>
                    <td>{{ $item->nosrt }}</td>
                    <td>{{ $item->nim }}</td>
                    <td>{{ $item->nama }}</td>
                    <td>{{ $item->tanggal_ujian }}</td>
                    <td>{{ $item->jam }}</td>
                    <td>
                        <a href="{{ route('p5.undangan_ujian.pdf', $item->nosrt) }}" target="_blank" class="btn btn-info btn-sm">Print</a>
                        <a href="{{ route('p5.undangan_ujian.edit', $item->nosrt) }}" class="btn btn-warning btn-sm">Edit</a>
                        <form action="{{ route('p5.undangan_ujian.destroy', $item->nosrt) }}" method="POST" style="display:inline;">
                            @csrf
                            @method('DELETE')
                            <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Yakin ingin menghapus?')">Hapus</button>
                        </form>
                    </td>

                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>
@endsection
