<?php
require("../../config/koneksi.php");
require("../../config/function.php");
require("../../config/crud.php");
(isset($_GET['pg'])) ? $pg = $_GET['pg'] : $pg = '';

if ($pg == 'tambah') {


$ket = $_POST['ket'];	
$nis = $_POST['nis'];
$kelas = $_POST['kelas'];	
$mapel = $_POST['mapel'];	
$ki = $_POST['ki'];
$smt = $_POST['smt'];
$tahun = $_POST['tahun'];
$nilai = $_POST['nilai'];	

$count = count($_POST['ket']);
$sql   = "INSERT INTO nilai_rapor(nis,mapel,kelas,ket,nilai,ki,smt,tahun) VALUES ";
for( $i=0; $i < $count; $i++ )
{
$sql .= "('{$nis[$i]}','{$mapel[$i]}','{$kelas[$i]}','{$ket[$i]}','{$nilai[$i]}','{$ki[$i]}','{$smt[$i]}','{$tahun[$i]}')";
$sql .= ",";
}
$sql = rtrim($sql,",");
$exec = $koneksi->query($sql);
echo "ok";
}
    