<?php
include "scrinit.php";
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() {
 $("#tmimaid").bind("change", function() {
     $.ajax({
         url: "change.php",
         data: "tmimaid="+$("#tmimaid").val(),
         success: function(html) {
             $("#nameid").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=800, top='+top+', left='+left);
document.forms["carservice"].submit();	
}

function submitform()
{
    document.forms["carservice"].submit();
}

function pop_up(url){
window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=800,height=800,directories=no,location=no') 
}

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

<?php
date_default_timezone_set("Europe/Athens");
require "dbconnect.php";
$usr=$_SESSION['usr'];

$data=$_GET['data'];
$ar=explode("/",$data);
$code=$ar[0];

$sql1 = "SELECT e.*,a.*,es.pmp FROM ekdilosi as e,adeiain as a,ekdilosistu as es 
WHERE e.onoma='ΑΔΕΙΑ ΕΙΣΟΔΟΥ' AND e.code='$code' and e.code=es.code and es.pmp=a.mitroo" ;
if (!mysqli_query($con,$sql1)) {die('Error: ' . mysqli_error($con));   }
$res=mysqli_query($con,$sql1);
$c=mysqli_num_rows($res);
$row = mysqli_fetch_array($res);
$mitr=	$row['pmp'];
$voithos=$row['teacher'];
$date=$row['date'];
$perapo=$row['perapo'];
$tm=$row['time'];
$sql = $dbcon->prepare("SELECT eponimo,onoma,tmima FROM allstudentinfo WHERE mitroo=?  " );
$sql->execute([$mitr]);
$row2=$sql->fetch(PDO::FETCH_ASSOC);

$stname=$row2['eponimo']." ".$row2['onoma'];
$tmimaid=$row2['tmima'];
	  
$sqlx=mysqli_query($con,"SELECT Name  FROM teachers WHERE  PMP='$voithos' " );
$row1 = mysqli_fetch_array($sqlx);
$vdname=$row1['Name'];

?>
<h4> ΣΤΟΙΧΕΙΑ ΑΔΕΙΑΣ ΕΙΣΟΔΟΥ</h4>

<form name = "form1" action="editadeiain1.php" method="post"/>
<fieldset style="width: 800px; ">
ΣΤΟΙΧΕΙΑ ΑΔΕΙΑΣ:<br><br>
Βοηθός:<input type='text'  name='bd' value="<?php echo $vdname; ?>" /> 
&nbsp&nbsp&nbspΗμερομηνία :<input type='text'   name='dat' value="<?php echo $date; ?>" size='10'  />
&nbsp&nbsp&nbspΠερίοδος:<input type='text'   name='perapo' value="<?php echo $perapo; ?>" size='2'  />
&nbsp&nbsp&nbspΏρα:<input type='text'   name='tm' value="<?php echo $tm; ?>" size='10'  />
<br><br>
ΣΤΟΙΧΕΙΑ ΜΑΘΗΤΗ/ΤΡΙΑΣ:<br><br>
Αρ. Μητρώου:<input type='text'  name= 'mitroo' value="<?php echo $mitr; ?>" size='4' /> 
&nbsp&nbsp&nbspΤμήμα :<input type='text'  name='tmimaid' value="<?php echo $tmimaid; ?>" size='4'  />
&nbsp&nbsp&nbspΌνομα :<input type='text'  name='stname' value="<?php echo $stname; ?>" size='30'/><br /><br />

<br><br>
<input type='text'  name='code' HIDDEN value="<?php echo $code; ?>" />
<input type="submit" name="adeia2" value="Διαγραφή Άδειας" > 
<input type="submit" name="adeia3" value="Επανεκτύπωση Άδειας" > 
</fieldset>
</form>

<?php


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