<?php
session_start();
ob_start();
$menu = $_SESSION['menu'];
include $menu;
?><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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>
<body>

<h3>ΕΠΙΣΚΟΠΗΣΗ ΕΚΔΗΛΩΣΕΩΝ </h3>
<?php
date_default_timezone_set("Europe/Athens");
require "dbconnect.php";
$usr=$_SESSION['usr'];
$date=$_SESSION['dt'];
//$date=date('Y-m-d');
echo "<br>";
/*
if (isset($_POST['dt'])) {
	$date=$_POST['dt'];	
}

// define the form into a variable
$fhtml = '<form action="" method="post">
Επέλεξε Ημερομηνία: <input type="date" name="dt" value="'. $date. '" />
<input type="submit" value="Επιλογή Ημερομηνίας" />
</form>';

echo $fhtml;         // output /display the form
echo "<br>"."<br>";

if (isset($_POST['dt'])) {
	$date=$_POST['dt'];
*/
echo " ΚΑΤΑΛΟΓΟΣ ΕΚΔΗΛΩΣΕΩΝ "."<b>".date('d-m-Y', strtotime($date))."</b>"."<br>"."<br>";	
$sql1 = "SELECT e.*,t.Name FROM ekdilosi as e,teachers as t WHERE e.teacher=t.PMP AND e.onoma<>'ΑΔΕΙΑ ΕΞΟΔΟΥ' ORDER BY e.date" ;
if (!mysqli_query($con,$sql1)) {die('Error: ' . mysqli_error($con));   }
$res=mysqli_query($con,$sql1);

echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:9px'  >
<tr>
<th>Κωδικός</th>
<th>Ημερομ.</th>
<th>Εκδήλωση</th>
<th>Υπεύθυνος</th>
<th>Περ. Από</th>
<th>Περ. Μέχρι</th>
</tr>";	

while ($row = mysqli_fetch_array($res)) 
{
	$code=$row['code'];
	$onoma=$row['onoma'];
	$perapo=$row['perapo'];
	$permexri=$row['permexri'];
	$tname=$row['Name'];
	$date=$row['date'];
echo "<tr>";
echo "<td>" .  "<a href=\"ekdin.php?data=".$code."\">"."<b>".$code."</b>". "</a>". "</td>";
echo "<td>" . $date. "</td>";
echo "<td>" . $onoma. "</td>";
echo "<td>" . $tname. "</td>";
echo "<td>" . $perapo. "</td>";
echo "<td>" . $permexri. "</td>";

echo "</tr>"; 
	
	//.............................................
}
echo "</table>";
echo "<br>"."<br>";

 ?>
 <br /> <br />
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a> 
</body>
</html>