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

if ($pg == 'editkuri') {
	$kuri = $_POST['kuri'];
	$model = $_POST['model'];
	$level = $_POST['level'];
$exec = mysqli_query($koneksi, "UPDATE kelas set kurikulum='$kuri', model_rapor='$model' WHERE level='$level'");
}	
if ($pg == 'model') {
    $kuri = $_POST['kuri'];
    $sql = mysqli_query($koneksi, "SELECT * FROM mode_rapor WHERE kurikulum='" . $kuri . "'");
   echo"<option value=''>Pilih Mode Rapor</option>";
    while ($data = mysqli_fetch_array($sql)) {
        echo "<option value='$data[model]'>$data[ket]</option>";
    }
}
if ($pg == 'rapor') {
	$tglrapor = $_POST['tanggal'];
	
$exec = mysqli_query($koneksi, "UPDATE aplikasi set tanggal_rapor='$tglrapor' WHERE id_aplikasi='1'");
}

if ($pg == 'naik') {
	$ids = $_POST['nis'];
	$level = $_POST['level'];
	$kelas= $_POST['kelas'];
$exec = mysqli_query($koneksi, "UPDATE siswa set level='$level',kelas='$kelas' WHERE nis='$ids'");
}
?>