<?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'];	
$ids = $_POST['ids'];
$kelas = $_POST['kelas'];	
$mapel = $_POST['mapel'];	
$guru = $_POST['guru'];	
$kd = $_POST['tp'];		
$nilai = $_POST['nilai'];	


	
$count = count($_POST['kelas']);
$sql   = "INSERT INTO nilai_harian(idsiswa,mapel,kelas,guru,ket,nilai,kd) VALUES ";
for( $i=0; $i < $count; $i++ )
{
$sql .= "('{$ids[$i]}','{$mapel[$i]}','{$kelas[$i]}','{$guru[$i]}','{$ket[$i]}','{$nilai[$i]}','{$kd[$i]}')";
$sql .= ",";
}
$sql = rtrim($sql,",");
$exec = $koneksi->query($sql);

echo $exec;
}
    