<?php
include "scrinit.php";
include $menu;
?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Απουσίες Μαθήματος</title>
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:10pt; }
<p style="font-size:10px;"></p>
</style>

</head>

<body>
<h4>ΚΑΤΑΧΩΡΗΣΗ ΑΠΟΥΣΙΩΝ ΕΦΗΜΕΡΕΥΣΗΣ</h4>
<?php
require "dbconnect.php"; 
$dt=$_SESSION['dt'];
$gym=$_SESSION['gym'];
$name = $_SESSION['n'];
$name = stripslashes($name);
$efim = 1;
echo "<br>"."ΗΜΕΡΟΜΗΝΙΑ:".$dt;
$day = date('D', strtotime($dt));
if ($day=="Sat" or $day=="Sun")
{
    echo "<br>"."ΔΕΝ ΥΠΑΡΧΟΥΝ ΜΑΘΗΜΑΤΑ ΣΗΜΕΡΑ"."<br>";
}
else 
{ 


?>
<form method="POST" >

<h4> ΕΠΙΛΟΓΗ ΠΕΡΙΟΔΟΥ ΚΑΙ ΤΜΗΜΑΤΟΣ/ΣΥΝΔΙΔΑΣΚΑΛΙΑΣ</h4>

ΠΕΡΙΟΔΟΣ:<select name="per">
<?php
$result = $dbcon->prepare("SELECT synd FROM syndcodes order by synd ASC" );
$result1 = $dbcon->prepare("SELECT DISTINCT tmima FROM allstudentinfo order by tmima ASC" ); 
$result->execute();
$result1->execute();
	   
for ($i=$gym;$i>=1;$i--)
{
  echo "<option value='$i'>$i</option>";
}
?>
</select>

ΤΜΗΜΑ:<select name="tmima1">
<?php
$i=1;
while($row1 = $result1->fetch(PDO::FETCH_ASSOC))
     {
	    $tmima[$i]=$row1['tmima'];
        $i++;
     }
while($row = $result->fetch(PDO::FETCH_ASSOC))
{
	    $tmima[$i]=$row['synd'];
        $i++;
}
$k=1;
echo "<option value =''>---------</option>";
while($k < $i) {
    echo "<option value ='".$tmima[$k]."'>".$tmima[$k]."</option>";
    $k++;
}

?>
</select>
<input type="submit" name="submitefim" value="Επιλογή" >
</form>
<?php
if (isset($_POST['submitefim']))
{
    $ora=$_POST['per'];
   	$lesn=$_POST['tmima1'];
	$efim=1;
	ob_end_clean();
	include $menu;
	include "newmath.php";
}
}
?>

<br />
<a  href=<?php echo $menu; ?>  style="color:blue "  > <button>  Επιστροφή στο Μενού  </a>


</body>
</html>