<?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" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	function pop_up(url)
	{
		window.open(url,'win2','toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=200, width=600, height=800') 
	}
	
</script>
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:11px; }
<p style="font-size:09px;"></p>
</style>

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

$tmima=trim($_GET['mathid']);
echo $tmima;
//find other info
$q=mysqli_query($con,"select * from roomcode where tmima='$tmima' ");
$n=mysqli_num_rows($q);
while( $row=mysqli_fetch_array($q))
{
	$subject=$row['subject'];
	$room=$row['room'];
	$code=$row['code'];
	$teacher=$row['teacher'];

	echo "<p class='p1'>". "ΣΧΕΔΙΑΓΡΑΜΜΑ ΤΜΗΜΑΤΟΣ: "."<b>".$tmima."</b></p>";
	echo "<p class='p2'>". "ΕΚΠΑΙΔΕΥΤΙΚΟΣ: ".$teacher." ΜΑΘΗΜΑ: ".$subject." ΑΙΘΟΥΣΑ: "."<b>".$room."</b></p>";

	$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;

echo "<table class='myTable3' >
<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><input type='text' name='sxed[$i][$j]' value='".$sxediagr[$i][$j]."' ><br><br></td>";
		}
   }
   echo "</tr>";
}
echo "</table>";
?>
<table align="left" border="5" cellpadding="10" cellspacing="2">
<tr><td><?php echo "ΕΔΡΑ"?></td>
</tr></table>
<?php
echo "<br><br>";
}
?>
<br><br>
<input type="button" name="epistrofi" value="Επιστροφή" onClick="self.close()"> 
</body>
</html>