<?php
include "scrinit.php";
include "logo.php";
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">


</script>

<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:4px;font-size:13px; }
<p style="font-size:12px;"></p>
</style>


</head>

<body>

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

if (isset($_GET['data'])) 
{
$code=$_GET['data'];
$sql = mysqli_query($con,"SELECT * FROM sintonismos WHERE code='$code'" );
$row = mysqli_fetch_array($sql);
$eidikotita=$row['eidikotita'];
echo "<b>"."ΣΥΝΤΟΝΙΣΜΟΙ ΕΙΔΙΚΟΤΗΤΑΣ:".$row['eidikotita']."</b> ";
echo " [ ΑΡ. ΣΥΝΤΟΝΙΣΜΟΥ:"."<b>".$code." ]"."</b></td><br><br>";
echo "<table class='myTable' >
<tr style='border:1px solid black;padding:4px;font-size:13px;'  >
<tr>";
echo "<td colspan='2'>"."ΗΜΕΡΟΜΗΝΙΑ:".date('d-m-Y', strtotime($row['date']))."</td>";
echo "<td>"."ΠΕΡΙΟΔΟΣ:".$row['per']."</td>";
echo "<tr><td colspan='3'>"."<b>"."ΑΠΟΝΤΕΣ ΕΚΠΑΙΔΕΥΤΙΚΟΙ:"."</b>";
$aponx=unserialize($row['apon']); 
$n=count($aponx);$apond="";
for ($i=0;$i<$n;$i++)
	{
		    $r=mysqli_query($con,"select Name from teachers where PMP='$aponx[$i]'");
			$rowy=mysqli_fetch_array($r);
			$apond=$apond.$rowy['Name'].",  ";
	}
echo trim($apond,', ');
echo "</th></tr>
<th>Α/Α</th>
<th>ΘΕΜΑ</th>
<th>ΛΕΠΤΟΜΕΡΕΙΕΣ</th>";		
$k=0;
while(!empty($row))
{
	$k++;
	$lepto[$k]=$row['leptomeries'];
    echo "<tr>";
	echo "<td>".$k."</td>";
	echo "<td>".$row['thema']."</td>";
	echo "<td >".$row['leptomeries']."</td>";
	echo "</tr>";
	$row = mysqli_fetch_array($sql);
}
echo "</table>";


include "printd.php";	

}

?>
<br><br>
<button onClick="window.print()">Εκτύπωση Συντονισμού</button>
<input type="button" name="epistrofi" value="Επιστροφή" onClick="self.close()"> 
</body>
</html>