 <?php  
 session_start();
include './../koneksi.php'; 
include ('./../cek_login.php');    
ini_set('display_errors',1);
error_reporting(E_ALL);
      
if(isset($_POST)) {
     
$checked_array = $_POST['no'];
foreach ($_POST['id'] as $key => $value) 
{

    if(in_array($_POST['id'][$key], $checked_array))
    {
    $id         = $_POST['id'][$key];
    $nim         = $_POST['nim'][$key];
    $tgl        = date('Y-m-d');
    $kls        = $_POST['kls'][$key];    
    $tahun      = $_POST['tahun'][$key];
    $keterangan = $_POST['keterangan'][$key];
    $tglmasehi  = $_POST['tglmasehi'][$key];
    $username   =  $_SESSION['username'];
    
  
    mysqli_query($koneksi,'INSERT INTO kelas(id,nim,tgl,no_kls,tahun,keterangan,tglmasehi,username,koreksi)
VALUES (

"' . $id. '",
"' . $nim. '",
"' . $tgl. '",
"' . $kls. '",
"' . $tahun. '",
"' . $keterangan. '",
"' . $tglmasehi. '",
"' . $username. '",
"' . $username. '"

)'
)
or die(mysqli_errno($koneksi).':'.mysqli_error($koneksi));
   
    echo "Data Berhasil Disimpan";
}
   
   } 
    
    }
?>
