<?php
include "scrinit.php";

?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>entopismos mathiti</title>
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">

function popupCenter(pageURL, title, w, h) {
    var left = (screen.width / 2)  - (w / 2);
    var top  = (screen.height / 2) - (h / 2);
    var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=900, height=300, top='+top+', left='+left);
}
</script>
<style type="text/css">
input.right{  text-align:right;  }
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:10pt; }
</style>
</head>

<body>

<br><h3> ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ  ΜΑΘΗΜΑΤΟΣ </h3><br />
<?php
require "dbconnect.php"; 

   $km=$_GET['kathmath'];
	$arr = explode("/", $km);
    $lesson = ltrim(rtrim($arr[1]));
	$usr = ltrim(rtrim($arr[0]));
	$sb=ltrim(rtrim($arr[2]));
	$sql=mysqli_query($con,"select * from syllabi where pmp='$usr' and mathima='$lesson' order by date,per");

echo "<br>"."<b>"."Προγραμμaτισμός για: ".$lesson." (".$sb." )". "</b>";	
echo "<table class='myTable' >
<tr style='border:1px solid black' bgcolor='#d6ff73'  >
<th>α/α</th>
<th>Ημερομηνία</th>
<th>Περ</th>
<th>Περιγραφή Αναλυτικού</th>
</tr>";
$i=1;
while($row=mysqli_fetch_array($sql))
{
  echo "<tr>";
  echo "<td>" .$i;
  echo "<td>". date('d-m-Y',strtotime($row['date']));$row['date'] . "</td>";
  echo "<td>". $row['per'] . "</td>";
  echo "<td>". $row['perigrafi'] . "</td>";
  echo "</tr>";
  $i++;
}
echo "</table>";	
?>
<br><br> 
<input type="button" name="epistrofi" value="Επιστροφή" onClick="self.close()">  
</body>
</html>