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


if ($pg == 'tambah') {
   $ids=$_POST['ids'];
   $kelas=$_POST['kelas'];
   $proyek=$_POST['proyek'];
   $ketproyek=$_POST['ketproyek'];
   $nilai=$_POST['nilai'];
   $smt=$_POST['smt'];
   $count = count($_POST['kelas']);
$sql   = "INSERT INTO nilai_proyek(idsiswa,kelas,idproyek,proyek,nilai,semester) VALUES ";
for( $i=0; $i < $count; $i++ )
{
$sql .= "('{$ids[$i]}','{$kelas[$i]}','{$proyek[$i]}','{$ketproyek[$i]}','{$nilai[$i]}','{$smt[$i]}')";
$sql .= ",";
}
$sql = rtrim($sql,",");
$exec = $koneksi->query($sql);

echo $exec;
}