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

$id          = intval($_POST['id_kelas']);
$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,"UPDATE kelas SET

nama_kelas='$nama_kelas',
wali_kelas='$wali_kelas',
status='$status'

WHERE id_kelas='$id'
");

if($sql){

echo "<script>

alert('Data berhasil diperbarui');

window.location='index.php';

</script>";

}else{

echo "<script>

alert('Data gagal diperbarui');

history.back();

</script>";

}
?>