<?php
session_start();
ob_start();
if ($_SESSION['islogin']=='' ) { 
  echo "ΠΡΕΠΕΙ ΝΑ ΕΓΓΡΑΦΕΙΤΕ ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΕΤΕ ΤΟ ΣΥΣΤΗΜΑ"."<BR>";
  sleep(3);
  header("Location: loginall.php"); /* Redirect browser */
  exit();
  }
$menu = $_SESSION['menu'];
include $menu;
date_default_timezone_set("Europe/Athens");
?>

<html>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<head>

<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>
<h3> ΒΑΘΜΟΛΟΓΙΕΣ ΤΜΗΜΑΤΩΝ </h3>
<?php
require "dbconnect.php"; 
$dt=$_SESSION['dt'];
$sq=mysqli_query($con,"select a.*,t.Name from aksinfo as a,teachers as t where a.pmpteacher=t.PMP order by pmpteacher asc");
$i=1;$subj=array();$math=array();
while ($row=mysqli_fetch_array($sq))
{
	$subj[$i]=rtrim(ltrim($row['subject']));
	$math[$i]=rtrim(ltrim($row['tmima']));
	$all[$i]=$math[$i]."/".$subj[$i];
	$name[$i]=rtrim(ltrim($row['Name']));
	$i++;
}
$k=$i-1;
$sq=mysqli_query($con,"select teacher,class,testdate,subject from declarations where  testdate < '$dt' order by class");

echo "<table class='myTable' >
<tr style='border:1px solid black' >
<tr>
<th>Α/Α</th>
<th>ΚΑΘΗΓΗΤΗΣ</th>
<th>ΤΜΗΜΑ</th>
<th>ΜΑΘΗΜΑ</th>
</tr>";
$j=1;$i=1;
while($j<=$k) 
{ 
    echo "<td>" .$i. "</td>";
	 echo "<td>" .$name[$j]. "</td>";
    echo "<td>" .$math[$j]."</td>";
	echo "<td>" .$subj[$j]."</td>";
	$j++;	 
	echo "</tr>";
 $i++; 
}
echo "</Table>";
?>	
<br /><br />
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού  </a>

</body>
</html>
