<?php
session_start();
ob_start();
if ($_SESSION['islogin']=='' ) { 
  echo "ΠΡΕΠΕΙ ΝΑ ΕΓΓΡΑΦΕΙΤΕ ΓΙΑ ΝΑ ΧΡΗΣΙΜΟΠΟΙΗΣΕΤΕ ΤΟ ΣΥΣΤΗΜΑ"."<BR>";
  sleep(3);
  header("Location: loginall.php"); /* Redirect browser */
  exit();
  }
include "logo.php";
$menu = $_SESSION['menu'];
$dt=$_SESSION['dt'];
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:6px;font-size:15px; }
<p style="font-size:12px;"></p>
</style>
<body>
<h3> ΚΑΤΑΣΤΑΣΗ ΑΝΑΠΛΗΡΩΣΕΩΝ ΜΕΧΡΙ <?php echo $dt;?> </h3>
<?php
require "dbconnect.php"; 
$pmp=mysqli_real_escape_string($con,$_GET['data']);

$result = mysqli_query($con,"SELECT id,date,period,pmpapon FROM anaplirosi where teacher='$pmp' order by date");

$dates=array();
// emfanise ton pinaka 
echo "<table class='myTable' >
<tr style='border:1px solid black'  >
<th>ID</th>
<th>ΗΜΕΡΟΜΗΝΙΑ</th>
<th>ΠΕΡΙΟΔΟΣ</th>
<th>ΑΠΩΝ/ΑΠΟΥΣΑ</th>
</tr>";
while ($row = mysqli_fetch_array($result))
{
  $id=$row['id'];
  $datean=$row['date'];
  $pmpapon = $row['pmpapon'];
  $per = $row['period'];
  echo "<tr>";
  echo "<td>";
  $idx=$id."/"."D";
  ?>
	<a href="#" onClick="window.open('adddelanapl.php?data=<?php echo $idx; ?>',' ','width=900,height=700')"><?php echo $id; ?></a>
  <?php
  echo "</td>";
  echo "<td>".$datean."</td>";
  echo "<td>".$per."</td>";
  echo "<td>".$pmpapon."</td>";
  echo "</tr>";
}
echo "<tr>";
echo "<td colspan='4'>";
$idx=$pmp."/"."A";
?>
<a href="#" onClick="window.open('adddelanapl.php?data=<?php echo $idx; ?>',' ','width=700,height=600')"><?php echo "<b>".'ΠΡΟΣΘΗΚΗ ΑΝΑΠΛΗΡΩΣΗΣ'."</b>"; ?></a>
<?php
echo "</td>"."</tr>"; 
echo "</table>";
echo "<br>"."<br>";

?>	
<br /><br /><br />
<input type="button" name="ep" value="ΕΠΙΣΤΡΟΦΗ" onClick="self.close()"> 
</body>
</html>
