<?php
require("../../config/koneksi.php");
require("../../config/function.php");
require("../../config/crud.php");


	$tanggal=date('Y-m-d');
	$idjadwal = $_POST['id'];
	$absen = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM jadwal_mapel  WHERE id_jadwal='$idjadwal'"));
	$mapelQ = mysqli_query($koneksi, "SELECT * from absensi WHERE tanggal='$tanggal' AND kelas='$absen[kelas]'");
	while ($tarik = mysqli_fetch_array($mapelQ)) {
		
		$exec = mysqli_query($koneksi, "INSERT INTO absen_mapel (tanggal,idjadwal,ket,idsiswa,hapus,blth,tahun)VALUES('$tarik[tanggal]','$idjadwal','$tarik[ket]','$tarik[idsiswa]','$tarik[hapus]','$tarik[blth]','$tarik[tahun]')");
	}
	

?>
