<div class="row">
    <div class="col-md-12 mb-4">
        <div class="card shadow mb-4">
            <div class="card-header py-3">
                <h6 class="m-0 font-weight-bold">Tambah Interpretasi Fuzzy</h6>
            </div>
            <div class="card-body">
                <form method="post">
                    <div class="form-group">
                        <label>Kategori</label>
                        <input type="text" class="form-control" name="kategori" required>
                    </div>
                    <div class="form-group">
                        <label>Nilai Interpretasi</label>
                        <input type="number" step="0.1" class="form-control" name="nilai_interpretasi" required>
                    </div>
                    <button type="submit" class="btn btn-primary" name="save">Simpan</button>
                </form>
            </div>
        </div>
    </div>
</div>

<?php
if (isset($_POST['save'])) {
    $kategori = mysqli_real_escape_string($koneksi, $_POST['kategori']);
    $nilai_interpretasi = mysqli_real_escape_string($koneksi, $_POST['nilai_interpretasi']);

    $koneksi->query("INSERT INTO interpretasi_fuzzy (kategori, nilai_interpretasi) VALUES ('$kategori', '$nilai_interpretasi')");

    echo "<script>alert('Data Berhasil Disimpan');</script>";
    echo "<script>location ='index.php?halaman=nilaifuzzydaftar';</script>";
}
?>