<?php
require("../../../config/koneksi.php");
require("../../../config/function.php");
require("../../../config/crud.php");
(isset($_GET['pg'])) ? $pg = $_GET['pg'] : $pg = '';
if ($pg == 'tambah') {
$tanggal = $_POST['tanggal'];
$idj = $_POST['idj'];	
$ids = $_POST['ids'];
$kd = $_POST['kd'];		
$nilai = $_POST['nilai'];	
$kuri = $_POST['kuri'];
$kode = $_POST['kode'];
	
$count = count($_POST['tanggal']);
$sql   = "INSERT INTO nilai_harian(tanggal,idjadwal,idsiswa,nilai,kd,kurikulum,kode) VALUES ";
for( $i=0; $i < $count; $i++ )
{
$sql .= "('{$tanggal[$i]}','{$idj[$i]}','{$ids[$i]}','{$nilai[$i]}','{$kd[$i]}','{$kuri[$i]}','{$kode[$i]}')";
$sql .= ",";
}
$sql = rtrim($sql,",");
$exec = $koneksi->query($sql);

echo $exec;
}
  