<?php
session_start();
ob_start();
$menu = $_SESSION['menu'];
include $menu;
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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>

<h3>ΚΑΤΑΣΤΑΣΗ ΔΙΑΓΩΝΙΣΜΑΤΩΝ </h3>
<?php
date_default_timezone_set("Europe/Athens");
require "dbconnect.php";
$usr=$_SESSION['usr'];
$teacher=$_SESSION['n'];

echo "<br>";
$dt=$_SESSION['dt'];
echo "Ημερομηνία : ".$dt;
echo "<br>";

$sql1 = "SELECT * FROM declarations WHERE teacher='$teacher'" ;
if (!mysqli_query($con,$sql1)) {die('Error: ' . mysqli_error($con));   }
$res=mysqli_query($con,$sql1);
$c=mysqli_num_rows($res);

if ($c==0){echo " ΔΕΝ ΥΠΑΡΧΟΥΝ ΔΗΛΩΜΕΝΑ ΔΙΑΓΩΝΙΣΜΑΤΑ";}
else
{


echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:9px'  >
<tr>
<th>Α/Α</th>
<th>ΗΜΕΡ. ΔΙΑΓΩΝ.</th>
<th>ΗΜΕΡ. ΔΗΛΩΣΗΣ</th>
<th>ΜΑΘΗΜΑ</th>
<th>ΤΜΗΜΑ/ΣΥΝΔ.</th>
<th>ΠΕΡΙΟΔ.</th>
<th>ΔΙΑΡΚ.</th>
<th>ΗΜΕΡΟΜ. ΕΠΙΣΤΡ.</th>
</tr>";	

while ($row = mysqli_fetch_array($res)) 
{
	$id=$row['id'];
	$testdate=$row['testdate'];
	$perapo=$row['perapo'];
	$permexri=$row['permexri'];
	$decladate=$row['decladate'];
	$subject=$row['subject'];
	$duration=$row['duration'];
	$class=$row['class'];
	$returndate=$row['returndate'];


echo "<tr>";
echo "<td>" .  "<a href=\"diagoedit.php?data=".$id."\">"."<b>".$id."</b>". "</a>". "</td>";
echo "<td>" . $testdate. "</td>";
echo "<td>" . $decladate. "</td>";
echo "<td>" . $subject. "</td>";
echo "<td>" . $class. "</td>";
echo "<td>" . $perapo.' - '.$permexri. "</td>";
echo "<td>" . $duration. "</td>";
echo "<td>" . $returndate. "</td>";
echo "</tr>"; 

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