<?php
include "scrinit.php";
include "logo.php";
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style1.css" rel="stylesheet" type="text/css" />
<style type="text/css">
table.myTable { width="100%";border-collapse:collapse; }
table.myTable td, table.myTable th { border:3px solid black;padding:10px;font-size:16px; }
<p style="font-size:09px;"></p>
</style>

<?php
require "dbconnect.php"; 
$dt=$_SESSION['dt'];

$tmx=$_GET['mathid'];
$arr = explode("/", $tmx);
$tmima = trim($arr[0]);
$room = trim($arr[1]);

echo "<p class='p1'>". "ΣΧΕΔΙΑΓΡΑΜΜΑ ΤΜΗΜΑΤΟΣ: "."<b>".$math."</b></p>";
echo "<p class='p2'>". "ΑΙΘΟΥΣΑ: "."<b>".$room."</b></p>";
$q=mysqli_query($con,"select code from roomcode where room='$room' and tmima='$tmima' ");
$row=mysqli_fetch_array($q);
$n=mysqli_num_rows($q);
if (!empty($row)) 
{
	$code=$row[code];
	$qr=mysqli_query($con,"select * from roomsit where code='$code'");

	while($rowr=mysqli_fetch_array($qr))
	{
		$mn=$rowr['student'];
		$i=$rowr['posx'];
		$j=$rowr['posy'];
		$sxediagr[$i][$j]=$mn;
	}
}

	
$pl=5;
$lg=7;
?>

<table><tr><div>
<td>
<?php
echo "<table  class='myTable' >
<tr style='border:4px solid black;padding:10px;font-size:16px'  >
<tr>
<th colspan='3'><th> </th><th colspan='3'></th>
</tr>";	
for($i=1;$i<=$pl;$i++)
{
   echo "<tr>";
   for ($jk=1;$jk<=$lg;$jk++)
   {
        if($jk==4) 
		{
			echo "<td>"."   "."</td>";
		}
        else
        {
		  if($jk > 4)
		  {
			  $j=$jk-1;
		  }else {$j=$jk;}
          echo "<td><br>".$sxediagr[$i][$j]."<br><br></td>";
		}
   }
   echo "</tr>";
}
echo "</table>";
?>
<br>
<table align="left" border="5" cellpadding="10" cellspacing="2">
<tr><td><?php echo "ΕΔΡΑ"?></td></tr>
</table>
<br><br><br><br>
<input type="button" name="epistrofi" value="Επιστροφή" onClick="self.close()"> 
</body>
</html>