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



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

echo $exec;
}
  