<?php
include "scrinit.php";
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
require "dbconnect.php";
$usr=$_SESSION['usr'];

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

$sql1 = "SELECT d.*,t.Name FROM declarations as d, teachers as t WHERE d.karfi='K' and t.PMP=d.teacher order by testdate" ;
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'];
	$name=$row['Name'];
	$testdate=$row['testdate'];
	$perapo=$row['perapo'];
	$permexri=$row['permexri'];
	$decladate=$row['decladate'];
	$subject=$row['subject'];
	$duration=$row['duration'];
	$class=$row['class'];
	


echo "<tr>";
echo "<td>" . $id."</td>";
echo "<td>" . $name. "</td>";
echo "<td>" . date('d-m-Y', strtotime($testdate))."</td>";
echo "<td>" . date('d-m-Y', strtotime($decladate))."</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>";
}
 ?>
 <br /> <br />
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a> 
</body>
</html>