<?php
session_start();
$menu=$_SESSION['menu'];
ob_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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:2px;font-size:11px; }
<p style="font-size:09px;"></p>
</style>
<body>
<?php
require("dbconnect.php");

if (isset($_POST['Submit'])) 
{ 

$flg=$_SESSION['flg'];

$ekdilo = $_POST['prog'];
$timestart = $_POST['timestart'];
$timeend = $_POST['timeend'];
$datestart = $_POST['datestart'];
$dateend= $_POST['dateend'];
//*****************************************

if ($flg == 1) {

$sql="INSERT INTO limitsdb (code,programma,datestart,dateend,timestart,timeend) VALUES ('$code','$programma','$datestart','$dateend','$timestart','$timeend')";

    if (!mysqli_query($con,$sql)) {die('Error: ' . mysqli_error($con)); }        
	
     }
    else
    {

mysqli_query($con,"UPDATE limitsdb SET datestart='$datestart',dateend='$dateend',timestart='$timestart',timeend='$timeend' WHERE programma='$programma' ");
}



echo "Η εγγραφή έγινε με επιτυχϊα ";


}

//*****************************************


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