<?php
include "scrinit.php";
require "functions.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("sxedtmima.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 diago(codex) 
	{
        window.open("diagotmima1.php?mathid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=400, width=600, height=800");
    } 
	function absent(codex) 
	{
        window.open("aptmimatosall.php?tmimaid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=400, width=1000, height=800");
    } 
	function argo(codex) 
	{
        window.open("tmkathisterisi.php?tmimaid="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=400, width=1000, height=800, leftmargin=20");
    } 
	function mark(codex) 
	{
        window.open("bathmoitmall.php?tmima="+codex, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes, top=100, left=400, width=1000, height=800, leftmargin=20");
    } 
</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'];
$usr=$_SESSION['usr'];
$access=$_SESSION['access'];

$tm=$yt=$rm=array();

$q=mysqli_query($con,"select v.*,t.Name from voithos as v, teachers as t where v.voi_id='$usr' and v.yt=t.PMP");
$n=mysqli_num_rows($q);
if ($n > 0)
{
$i=0;
while ($row=mysqli_fetch_array($q))
{ 		  
	$i++;
	$tm[$i]=$row['Class_id'];
	$yt[$i]=$row['Name'];
	$rm[$i]=$row['room'];
}
echo "<p class='p1'>". "ΤΑ ΤΜΗΜΑΤΑ ΜΟΥ". "</p>";
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>
	</tr>";
$i=1;
for ($i=1;$i<=$n;$i++)
{
	$tmr=$tm[$i]."/".$rm[$i];
	echo "<tr>";
	echo "<td>". $i."</td>";
	echo "<td>"."<a href=\"psynd.php?syndx=".$tm[$i]."\" onclick=\"pop_up(this.href);return false\">"."<b>".$tmr."</b>". "</a>". "</td>";
	echo "<td>". $yt[$i]."</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/test.png" onclick="diago(\''.$tm[$i].'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/absent.png" onclick="absent(\''.$tm[$i].'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/delay.png" onclick="argo(\''.$tm[$i].'\')" width="30" height="30" /></center></td>';
	echo "<td>". ""."</td>";
	echo '<td><center><img src="icons/test.png" onclick="mark(\''.$tm[$i].'\')" width="30" height="30" /></center></td>';
	echo '<td><center><img src="icons/sxed.png" onclick="sxed(\''.$tmr.'\')" width="30" height="30" /></center></td>';
	
}
}
else
{
	echo "ΔΕΝ ΕΧΕΤΕ ΥΠΕΥΘΥΝΟΤΗΤΑ ΤΜΗΜΑΤΟΣ";
}


?>
</body>
</html>