<?php
include "scrinit.php";
include $menu;
require "dbconnect.php";
?><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; }
.fieldset
{
    width:600px;
	background: #F5F9F0;
	border:2px solid green;
    -moz-border-radius:8px;
    -webkit-border-radius:8px;	
    border-radius:8px;	
}
<p style="font-size:09px;"></p>
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
function popupCenter(pageURL, title, w, h) {
    var left = (screen.width / 2)  - (w / 2);
    var top  = (screen.height / 2) - (h / 2);
    var targetWin = window.open(pageURL,title,w,h);
}
</script>
<body>

<?php

$dt=$_SESSION['dt'];
$tetramino=$_SESSION['tetramino'];

$sqt=mysqli_query($con,"select PMP,Name from teachers where access < 4 order by Name ASC");
$i=1;$pmp=$tname=array();
while($rowt=mysqli_fetch_array($sqt))
  {    
	$tname[$i]=rtrim(ltrim($rowt['Name']));
	$pmp[$i]=$rowt['PMP'];
	$tnamepmp[$pmp[$i]]=rtrim(ltrim($rowt['Name']));
	$i++;
  }

$sq=mysqli_query($con,"select distinct pmpteacher from aksinfo where tetramino='$tetramino' ");
$sqd=mysqli_query($con,"select distinct teacher from declarations where tetramino='$tetramino' ");

$i=1;$pmpt=array();$diagt=array();
while ($row=mysqli_fetch_array($sq))
{
	$pmpt[$i]=$row['pmpteacher'];
	$i++;
}

$i=1;
while ($row=mysqli_fetch_array($sqd))
{
	$diagt[$i]=rtrim(ltrim($row['teacher']));
	$i++;
}


$diff1 = array_diff($pmp,$diagt);
$diff2 = array_diff($pmp,$pmpt);

echo "ΔΕΝ ΔΗΛΩΣΑΝ ΔΙΑΓΩΝΙΣΜΑΤΑ";
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:12px'  >
<tr>
<th>Α/Α</th>
<th>ΟΝΟΜΑ</th>
</tr>";	
$i=1;
foreach ($diff1 as $d)
{
echo "<tr>";
echo "<td>" . $i. "</td>";
echo "<td>" . $tnamepmp[$d]. "</td>";
$i++;
echo "</tr>"; 
}
echo "</table>";
echo "<br>";

//**************************************
echo "ΔΕΝ ΚΑΤΑΧΩΡΗΣΑΝ ΒΑΘΜΟΥΣ";
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:12px'  >
<tr>
<th>Α/Α</th>
<th>ΟΝΟΜΑ</th>
</tr>";	
$i=1;
foreach ($diff2 as $d)
{
echo "<tr>";
echo "<td>" . $i. "</td>";
echo "<td>" . $tnamepmp[$d]. "</td>";
$i++;
echo "</tr>"; 
}
echo "</table>";
echo "<br>";


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

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