<?php
include "scrinit.php";
include "logo.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style type="text/css">
input.right{  text-align:right;  }
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:10pt; }
</style>
<body>

<?php
require "dbconnect.php";
$dt=date('Y-m-d');
$oml=array();  
echo "<b>"." ΚΑΤΑΛΟΓΟΣ ΥΠΕΥΘΥΝΟΤΗΤΩΝ ΟΜΙΛΩΝ ΑΝΑ ΚΑΘΗΓΗΤΗ"."</b>"."<br>";
$sql= mysqli_query($con,"SELECT code,omilos,perigrafi from omiloi order by code");
while ($row = mysqli_fetch_array($sql)) 
{
	$oml[$row['code']]=$row['omilos'];
}
$sql= mysqli_query($con,"SELECT PMP,Name from teachers where access=1 order by Name");
// Start while loop to get data
echo "<table class='myTable' >
<tr style='border:1px solid black' bgcolor='#d6ff73'  >
<th>Α-Α</th>
<th>ΠΜΠ</th>
<th>ΟΝΟΜΑ</th>
<th>ΟΜΙΛΟΣ1</th>
<th>ΟΜΙΛΟΣ2</th>";

$k=1;
while ($row = mysqli_fetch_array($sql)) 
{
	$pmp=$row['PMP'];
	$teach=$row['Name'];
	echo "<tr>";
	echo "<td>".$k."</td>";
	echo "<td>".$pmp."</td>";
	echo "<td>".$teach."</td>";
	$sql1 = mysqli_query($con,"SELECT code1,code2 FROM dilosiomilos where pmp='$pmp' " ); 
	$row1=mysqli_fetch_array($sql1);
	echo "<td>".$row1['code1']." - ".$oml[$row1['code1']];
	echo "<td>".$row1['code2']." - ".$oml[$row1['code2']];
	echo "</tr>";
	$k++;
}
echo "</table>";

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

</body>
</html>