<?php
session_start();
ob_start();
$menu = $_SESSION['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:12px; }
<p style="font-size:11px;"></p>
</style>
<body>
<div id="wrap">
<div id="header">
     <h4><?php include 'logo.php'?> </h4>
</div>
<body>
<h3>ΔΙΑΓΡΑΦΗ ΔΙΑΓΩΝΙΣΜΑΤΟΣ </h3>
<?php
date_default_timezone_set("Europe/Athens");
require "dbconnect.php";
$usr=$_SESSION['usr'];
$name = $_SESSION['n'];

$dt=$_SESSION['dt'];
echo " ΔΗΛΩΜΕΝΑ ΔΙΑΓΩΝΙΣΜΑΤΑ "."<br>";	

$sql = $dbcon->prepare("SELECT * FROM declarations WHERE teacher=?");
$sql->execute([$usr]);
$c=$sql->rowCount();

if ($c==0){echo " ΔΕΝ ΥΠΑΡΧΟΥΝ ΔΗΛΩΜΕΝΑ ΔΙΑΓΩΝΙΣΜΑΤΑ";}
else
{
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:12px'  >
<tr>
<th>Α/Α</th>
<th>ΔΙΔΑΣΚΩΝ</th>
<th>ΗΜΕΡ. ΔΗΛΩΣΗΣ</th>
<th>ΗΜΕΡ. ΔΙΑΓΩΝ.</th>
<th>ΜΑΘΗΜΑ</th>
<th>ΤΜΗΜΑ/ΣΥΝΔ.</th>
<th>ΠΕΡΙΟΔ.</th>
<th>ΔΙΑΡΚ.</th>
</tr>";	

while ($row=$sql->fetch(PDO::FETCH_ASSOC)) 
{
	$id=$row['id'];
	$teacher=$row['teacher'];
	$perapo=$row['perapo'];
	$permexri=$row['permexri'];
	$testdate=$row['testdate'];
	$decladate=$row['decladate'];
	$subject=$row['subject'];
	$duration=$row['duration'];
	$class=$row['class'];


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


echo "<br>"."<br>";


?>
<br /> <br />
<input type='button' value='Επιστροφή ' onclick='javascript: window.close();' /> 
</body>
</html>
