<?php
session_start(); // start up your PHP session! 
$menu = $_SESSION['menu'];
include $menu;
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function() {
 $("#arsimperiforas").bind("changepara", function() {
     $.ajax({
         url: "changepara.php",
         data: "arsimperiforas="+$("#arsimperiforas").val(),
         success: function(html) {
             $("#eidostimo").html(html);
         }
     });
 }); 
});
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=800, height=200, top='+top+', left='+left);
}
</script>

<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>


</head>

<body>
<h2> ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ/ΟΡΓΑΝΩΣΗ ΕΓΚΥΚΛΙΩΝ </h2>
<?php
require "dbconnect.php";

$usr=$_SESSION['usr'];
$name=$_SESSION['n'];
$dt=$_SESSION['dt'];

$res =mysqli_query($con, "SELECT  MAX(id) as mid FROM egkiklioi ");
$row=mysqli_fetch_array($res);
$aranaf=$row['mid']+1;
$datedue=$dt;
$res1 =mysqli_query($con, "SELECT  *  FROM vd ");
$res2 =mysqli_query($con, "SELECT  *  FROM teachers where access <= 5 ");
?>


<form method="post" name = "form1" action='addegkiklios.php' >
<fieldset style="width: 1000px; ">
ΑΡIΘΜΟΣ:<input type='text'  name= 'arnum' value="<?php echo $aranaf; ?>" size=6  /><br /><br />
ΗΜΕΡΟΜΗΝΙΑ:<input type='text'  name='datein' value="<?php echo $dt; ?>" />  
  &nbsp&nbspΤΥΠΟΣ :<select name='type'>
  <option value="1">1 - ΕΓΚΥΚΛΙΟΣ</option>
  <option value="2">2 - ΔΙΑΓΩΝΙΣΜΟΣ</option>
  <option value="3">3 - ΣΕΜΙΝΑΡΙΟ</option>
  <option value="4">4 - ΥΠΟΒΟΛΗ ΣΤΟΙΧΕΙΩΝ</option>
  <option value="5">5 - ΕΝΕΡΓΕΙΑ</option>
   </select>

  &nbsp ΧΡΗΣΤΗΣ:<input type='text'  value="<?php echo $name; ?>" size=9 /> 
<br/ ><br />  
  ΠΕΡΙΓΡΑΦΗ:<br />
<textarea name='perigrafi' cols='80' rows='5'> <?php echo $perigrafi;?> </textarea ><br/ ><br />

ΔΙΕΥΘΥΝΣΗ ΑΝΑΦΟΡΑΣ:<input type="text"  name = 'url1' value ="<?php echo $url1; ?>"  size=50 >
&nbsp&nbsp&nbspΗΜΕΡΟΜΗΝΙΑ ΑΝΤΑΠΟΚΡΙΣΗΣ:<input type="date"  name = 'datedue' value =<?php echo $datedue; ?>  ><br /><br />

ΥΠΕΥΘΥΝΟΣ ΒΔ/ΒΔΑ:<select name='bdres' >
<?php
echo "<option value='1111'>ΟΛΟΙ</option>";
while ($row1 = mysqli_fetch_array($res1)) 
{
	$vdpmp=$row1['voi_id'];
	$vdname=$row1['voi_name'];
   	echo "<option value ='".$vdpmp."'>".$vdname."</option>";
}
echo "</select>";
?>
 &nbsp&nbspΥΠΕΥΘΥΝΟΣ ΚΑΘΗΓΗΤΗΣ:<select name='tres' >
<?php
echo "<option value='0'>ΔΕΝ ΙΣΧΥΕΙ</option>";
echo "<option value='1111'>ΟΛΟΙ</option>";
while ($row2 = mysqli_fetch_array($res2)) 
{
	$tpmp=$row2['PMP'];
	$tname=$row2['Name'];
   	echo "<option value ='".$tpmp."'>".$tname."</option>";
}
echo "</select>";
?>
&nbsp&nbspΕΝΕΡΓΕΙΕΣ :<select name='status'>
  <option value="1">1 - ΝΑΙ</option>
  <option value="2">2 - ΓΙΑ ΕΝΗΜΕΡΩΣΗ</option>
  <option value="3">3 - ΣΕ ΔΙΑΔΙΚΑΣΙΑ</option>
  <option value="4">4 - ΟΛΟΚΛΗΡΩΘΗΚΕ</option>
  <option value="5">5 - ΕΠΕΙΓΟΝ</option>
</select>
<p>
ΣΧΟΛΙΑ:<br />
<textarea name='sxolia' cols='80' rows='5'> <?php echo $sxolia;?> </textarea ><br/ ><br />
</p> 
<input type='Submit' name='Submit' value='ΚΑΤΑΧΩΡΗΣΗ ' >
</fieldset>
</form>	

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