<?php
include "scrinit.php";
include $menu;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:11px; }
<p style="font-size:09px;"></p>
</style>
<body>
<?php
require("dbconnect.php");

$tetramino=$_SESSION['tetramino'];
$gym=$_SESSION['gym'];
$usr=$_SESSION['pmp'];
$date=$_POST['date'];
$mitr = $_POST['mitr'];
$papo = $_POST['papo'];
$pm=$_POST['pm'];
$mathc="Δ";
$tmep="Δ.Δ.Κ";
$n=count($mitr);
/////////
include "aponekdromi.php";
$sqddk=$dbcon->prepare("INSERT INTO apousies (mitroo, apousia,dateout,period,teacher,mathima,mathc,tetramino) 
	VALUES (?,?,?,?,?,?,?,?) ");
if ( $n> 0) 
{
	foreach ($mitr as $a)
	{
		for ($per=$papo;$per<=$pm;$per++)
		{
			$sqddk->execute([$a,1,$date,$per,$usr,$tmep,$mathc,$tetramino]);
		}
	}
}
echo "Καταχωρήθηκαν : ".$n." απόντες";
?>
<br><br>
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a> 
</body>
</html>