<?php
// Form untuk menambah penguji baru
if (isset($_POST['tambah_penguji'])) {
    $nama = $_POST['nama'];
    $nip = $_POST['nip'];
    $spesialisasi = $_POST['spesialisasi'];
    
    try {
        $stmt = $pdo->prepare("INSERT INTO penguji (nama, nip, spesialisasi) VALUES (?, ?, ?)");
        $stmt->execute([$nama, $nip, $spesialisasi]);
        $success_message = "Penguji berhasil ditambahkan";
    } catch (PDOException $e) {
        $error_message = "Error menambah penguji: " . $e->getMessage();
    }
}
?>

<!-- Form tambah penguji -->
<div class="card mt-4">
    <div class="card-header bg-secondary text-white">
        <h5 class="card-title mb-0"><i class="bi bi-person-plus me-2"></i>Tambah Penguji Baru</h5>
    </div>
    <div class="card-body">
        <form method="POST" action="">
            <div class="row">
                <div class="col-md-4">
                    <div class="mb-3">
                        <label for="nama" class="form-label">Nama Penguji</label>
                        <input type="text" class="form-control" name="nama" required>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="mb-3">
                        <label for="nip" class="form-label">NIP</label>
                        <input type="text" class="form-control" name="nip" required>
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="mb-3">
                        <label for="spesialisasi" class="form-label">Spesialisasi</label>
                        <input type="text" class="form-control" name="spesialisasi">
                    </div>
                </div>
            </div>
            <button type="submit" name="tambah_penguji" class="btn btn-success">
                <i class="bi bi-plus-circle me-2"></i>Tambah Penguji
            </button>
        </form>
    </div>
</div>