<?php
include "../../config/koneksi.php";

$nama_kelas = mysqli_real_escape_string($conn,$_POST['nama_kelas']);
$wali_kelas = mysqli_real_escape_string($conn,$_POST['wali_kelas']);
$status      = mysqli_real_escape_string($conn,$_POST['status']);

$sql = mysqli_query($conn,"INSERT INTO kelas
(
nama_kelas,
wali_kelas,
status
)

VALUES
(
'$nama_kelas',
'$wali_kelas',
'$status'
)");

if($sql){

    echo "<script>

    alert('Data berhasil disimpan');

    window.location='index.php';

    </script>";

}else{

    echo "<script>

    alert('Data gagal disimpan');

    history.back();

    </script>";

}
?>