<?php
session_start();
$menu = $_SESSION['menu'];
?>

<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<head>
</script>
<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=800, top='+top+', left='+left);
}
</script>
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:14px; }
<p style="font-size:14px;"></p>
</style>
</head>
<body>
<h2>ΕΠΙΛΟΓΗ ΜΑΘΗΤΩΝ ΓΙΑ ΣΥΝΔΙΔΑΣΚΑΛΙΑ</h2>
<?php
require "dbconnect.php"; 

$result = mysqli_query($con,"SELECT * FROM syndcodes order by synd ASC" ); 
    
echo "<table class='myTable' >
<tr style='border:2px solid black' >
</tr>";
echo "<tr > 
<th>Α/Α</th>
<th>ΤΜΗΜΑ/ΣΥΝΔ.</th>
<th>ΚΑΘΗΓΗΤΗΣ/ΤΡΙΑ</th>
</tr>";

$i=1;
 while($row = mysqli_fetch_array($result))
     {
	  $syndn[$i]=$row['synd'];
	  $kath[$i]=$row['kathigitis'];
	  $syndid[$i]=$row['syndid'];
	  $i++;
	  }
 
 $i--;
 
 for ($k=1;$k<=$i;$k++){
      echo "<td>" . $k. "</td>";
	  $sx=$syndid[$k]."/".$syndn[$k];
	 ?>
     <td>
   <a href="#" onClick="popupCenter('allagisynd1.php?synx=<?php echo $sx; ?>')"><?php echo $syndn[$k]; ?></a>
    </td>
<?php
      echo "<td>" . $kath[$k]. "</td>";
      echo "</tr>";
     
     }
echo "</table>"; 
 

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

</body>
</html>