<?php
session_start();
$menu=$_SESSION['menu'];
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>
<h2>ΑΠΟΥΣΙΕΣ ΥΠΕΥΘΥΝΟΥ ΤΜΗΜΑΤΟΣ ΚΑΙ ΕΚΔΗΛΩΣΕΩΝ</h2>
<?php
require "dbconnect.php"; 
require "dbconnect.php"; 
$dt=$_SESSION['dt'];
$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 
{ 
$result = mysqli_query($con,"SELECT DISTINCT synd FROM syndidaskalies order by synd ASC" );
$result1 = mysqli_query($con,"SELECT DISTINCT tmima FROM allstudentinfo order by tmima ASC" ); 


?>
<form  method='post'> 
<h4> ΕΠΙΛΟΓΗ ΠΕΡΙΟΔΟΥ ΤΗΣ ΕΚΔΗΛΩΣΗΣ ΚΑΙ ΤΜΗΜΑΤΟΣ</h4>

ΠΕΡΙΟΔΟΣ:<select name="per">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=7>8</option>
</select>

ΤΜΗΜΑ:<select name="tmima1">

<?php

$i=1;
while($row1 = mysqli_fetch_array($result1))
     {
	    $tmima[$i]=$row1['tmima'];
        $i++;
    	}
 while($row = mysqli_fetch_array($result))
     {
	    $tmima[$i]=$row['synd'];
     $i++;
}

$k=1;
while($k < $i) {
    echo "<option value ='".$tmima[$k]."'>".$tmima[$k]."</option>";
    $k++;
}

    ?>
    </select>
<input type="submit" name="submitddk" value="Επιλογή" >
<br>
</form>
<?php
if (isset ($_POST['submitddk'])) {
	$per=$_POST['per'];
	$lesn=$_POST['tmima1'];
	$ddk=1;
    include ('apoukatalogos.php');
}
}
?>
<br />
<a  href=<?php echo $menu; ?>  style="color:blue "  >  Επιστροφή στο Μενού  </a>

</body>
</html>