<?php
?>
<h4> ΔΙΑΓΩΝΙΣΜΑΤΑ ΜΑΘΗΤΗ ΓΙΑ ΤΙΣ ΕΠΟΜΕΝΕΣ 10 ΜΕΡΕΣ </h4>
<?php 
echo "<table class='myTable' >
<tr style='border:1px solid black' >
</tr>";
$x=date('Y-m-d',strtotime($dt));
for ($i=1;$i<=10;$i++)
{
	$in=0;
	
	$x = strtotime("+1 day", strtotime($x));
	$dt1=date('Y-m-d',$x);
	$dt2= date('d-m-Y', strtotime($dt1));
	echo "<tr>";
	echo "<td>".$dt2."</td>";
	$x=date('Y-m-d',strtotime($dt1));
	$tdia=mysqli_query($con,"SELECT * FROM declarations WHERE testdate='$dt1'");
	If (mysqli_num_rows($tdia) > 0)
	{
		$in=0;
		while ($trow=mysqli_fetch_array($tdia))
		{
			$class=$trow['class'];
			$fr=$trow['perapo'];
			$subj=$trow['subject'];
			$tdia1=mysqli_query($con,"SELECT s.mitroo FROM syndidaskalies as s, syndcodes as sc 
			WHERE sc.synd='$class' and sc.syndid=s.syndid and s.mitroo='$mitr'");
			If (mysqli_num_rows($tdia1) > 0)
			{
				$in=1;
				$subjf=$subj;$frf=$fr;
			}
			else
			{		
				$tdia2=mysqli_query($con,"SELECT mitroo FROM allstudentinfo WHERE tmima='$class' and mitroo='$mitr'");
				If (mysqli_num_rows($tdia2) > 0){$in=1;$subjf=$subj;$frf=$fr;} 
			}
		}
	}
	if ($in==1)	
	{
		echo "<td>";
		echo "<font face='arial' color='#ff0000'>  Ο μαθητής/τρια έχει διαγώνισμα ".$subjf." την ".$frf." περίοδο</font>";
		echo "</td>";
	}
	else
	{
		echo "<td>"." "."</td>";	
	}
	echo "</tr>";
}
echo "</table>";