<?php
session_start();
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; }
<p style="font-size:11px;"></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, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800, height=900, top='+top+', left='+left);
}
</script>
</head>
<body  style="width:995px; margin:0 auto; ">

<?php 

echo "<br>";

$kat=$_GET['kat'];
$taxi=$_SESSION['tax'];

$sql=  mysqli_query($con,"SELECT  e.mitroo as mitr,al.tmima,al.eponimo,al.onoma,e.omp FROM allstudentinfo as al,epiloges as e  WHERE al.mitroo=e.mitroo and e.kat='$kat' and e.class='$taxi' group by e.mitroo" );

echo " ΜΑΘΗΤΕΣ ΠΟΥ ΕΠΕΛΕΞΑΝ ΚΑΤΕΥΘΥΝΣΗ ".$kat ;
echo "<br>";
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:16px'  >
<tr>
<th>A/A</th>
<th>ΤΜΗΜΑ</th>
<th>ΜΗΤΡΩΟ</th>
<th>ΟΝΟΜΑ</th>
<th>OMP</th>
</tr>";	
$i=1;
while ($row=mysqli_fetch_array($sql))
{
   echo "<tr>";
   echo "<td>". $i. "</td>";
   echo "<td>". $row['tmima']. "</td>";
   $name=$row['eponimo']." ".$row['onoma'];
   $omp=$row['omp'];
   $mitroo=$row['mitr'];
   $mo=$mitroo."/".$omp."/".$name;
   if ($taxi=='Β')
   {
   ?>
     <td>
     <a href="#" onClick="popupCenter('diloAsimv.php?mo=<?php echo $mo; ?>')"><?php echo $mitroo; ?></a>
     </td>
   <?php
   }
   else
   {
   	?>
     <td>
     <a href="#" onClick="popupCenter('diloBsimv.php?mo=<?php echo $mo; ?>')"><?php echo $mitroo; ?></a>
     </td>
   <?php
   	}
   echo "<td>".$name. "</td>";
   echo "<td>".$omp. "</td>";
   echo "</tr>";
   $i++;
}
echo "</table>"; 



?>	
<br /><br />


</body>
</html>