<?php
include "scrinit.php";
include $menu;
?><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 sxed(codx) 
	{
        window.open("sxediagramma.php?mathid="+codx, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=200, width=1400, height=800");
    } 
	
	function pop_up(url){
		window.open(url,'win2','toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=200, width=600, height=800') 
	}
	
	function progr(codex) 
	{
        window.open("programatismos1.php?mathid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=100, width=1000, height=800");
    }
	
	function marks(codex) 
	{
        window.open("bathmotetr.php?mathid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=100, width=1000, height=800");
    }
    	function markstel(codex) 
	{
        window.open("bathmotel.php?mathid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=100, width=1000, height=800");
    }
	
		function dildiag(codex) 
	{
        window.open("diagpermonth.php?mathid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=100, width=1000, 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'];
$teacher=$_SESSION['usr'];
$usr=$_SESSION['usr'];
$access=$_SESSION['access'];
$math=$tm=array();
include "selectmath.php";
$i=1;
foreach ($mathsubj as $m)
{ 		  
	$math[$i]=$m;
	$t=mysqli_query($con,"select code from teams where pmp='$usr' and mathima='$m' ");
	$row=mysqli_fetch_array($t);
	$tm[$i]=$row['code'];
	$i++;
}

echo "<p class='p1'>". "ΤΑ ΜΑΘΗΜΑΤΑ ΜΟΥ". "</p>";

$ind=$ind-1;
echo "<table class='myTable3' id='tablex' >
	<tr> 
	<th>Α/Α</th>
	<th>ΤΜΗΜΑ/ΜΑΘΗΜΑ</th>
	<th>ΚΩΔΙΚΟΣ ΤΕΑΜΣ</th>
	<th>ΥΛΗ/ΔΕΙΧΤΕΣ</th>
	<th>ΔΗΛΩΣΗ ΔΙΑΓ.</th>
	<th>ΒΑΘΜΟΙ ΔΙΑΓ.</th>
	<th>ΒΑΘΜΟΙ ΑΠΡ. ΑΣΚ.</th>
	<th>ΒΑΘΜΟΣ ΕΞΕΤΑΣΗΣ</th>
	<th>ΤΕΛΙΚΟΣ ΤΕΤΡΑΜΗΝΟΥ</th>
	<th>ΣΧΕΔΙΑΓΡΑΜΜΑ ΤΑΞΗΣ</th>
	</tr>";
$i=1;
$n=count($math);
for ($i=1;$i<=$n;$i++)
{
	echo "<tr>";
	echo "<td>". $i."</td>";
	$mt=$math[$i]."/".$usr;
	$arr=explode("/",$mt);
	$mathima=trim($arr[0]);
	echo "<td>"."<a href=\"psyndtel.php?syndx=".$mathima."\" onclick=\"pop_up(this.href);return false\">"."<b>".$math[$i]."</b>". "</a>". "</td>";
	echo "<td><b>". $tm[$i]."</b></td>";
	echo "<td><center><a target='_blank' href=\"https://teams.microsoft.com\"><img src=icons/tm.png width='25' height='25'></a></center></td>";
	echo '<td><center><img src="icons/progr.png" onclick="progr(\''.$mt.'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/diagonisma.png" onclick="dildiag(\''.$mt.'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/test.png" onclick="marks(\''.$mt.'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/ptel.png" onclick="markstel(\''.$mt.'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/sxed.png" onclick="sxed(\''.$mt.'\')" width="30" height="30" /></center></td>';
	
}


?>
</body>
</html>