<?php
session_start();$menu = $_SESSION['menu'];
include "logo.php";
?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
table.myTable { border-collapse:collapse }
table.myTable td, table.myTable th { border:1px solid black;padding:3px;font-size:11pt; }
</style>


</head>
<body>

<h2>ΣΤΟΙΧΕΙΑ ΥΠΕΥΘΥΝΩΝ ΤΜΗΜΑΤΩΝ</h2>
<?php

require "dbconnect.php";

$sql = "SELECT t.Name,v.Class_id,v.voi_id FROM teachers as t,voithos as v WHERE v.yt=t.PMP ORDER BY v.Class_id ASC";
$result = mysqli_query($con,$sql);
$i=0;
while ($row = mysqli_fetch_array($result)) 
{
	$i++;
	$tmima[$i]=$row['Class_id'];
	$yt[$i]=$row['Name'];
	$vid=$row['voi_id'];
    $sql1 = "SELECT Name FROM teachers WHERE PMP='$vid'";
    $result1 = mysqli_query($con,$sql1);
    $row1 = mysqli_fetch_array($result1);
    $bd[$i]=$row1['Name'];
}
?>

<?php
echo "<table class='myTable' >
<tr style='border:1px solid black' bgcolor='#d6ff73'  >
<th>ΤΜΗΜΑ</th>
<th>ΥΠΕΥΘΥΝΟΣ ΚΑΘΗΓΗΤΗΣ</th>
<th>ΥΠΕΥΘΥΝΟΣ ΒΔ</th>
</tr>";
for ($k=1;$k<=$i;$k++)
{
	echo "<tr>";
	echo "<td>". $tmima[$k]. "</td>";
	echo "<td>". $yt[$k] . "</td>";
	echo "<td>". $bd[$k] . "</td>";
	echo "</tr>";
}
echo "</table>";
?>

	 

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