<?php
include("sess_check.php");
$nis = $_POST['nis'];
$nama_lengkap = $_POST['nama_lengkap'];
$id_kelas = $_POST['id_kelas'];

$sql = "INSERT INTO siswa(nis,nama_lengkap,id_kelas)VALUES('$nis','$nama_lengkap','$id_kelas')";
$ress = mysqli_query($conn, $sql);
if ($ress) {
	echo "<script>alert('Tambah Siswa Berhasil!');</script>";
	echo "<script type='text/javascript'> document.location = 'siswa.php'; </script>";
} else {
	echo ("Error description: " . mysqli_error($conn));
	echo "<script>alert('Ops, terjadi kesalahan. Silahkan coba lagi.');</script>";
	echo "<script type='text/javascript'> document.location = 'siswa_tambah.php'; </script>";
}
