<?php
include "scrinit.php";
include $menu;
?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>entopismos mathiti</title>
</script>
<script type="text/javascript" src="https://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=900, height=300, top='+top+', left='+left);
}
</script>
</head>
<body>
<h4> ΔΙΔΑΣΚΟΝΤΕΣ ΜΑΘΗΤΗ/ΤΡΙΑΣ</h4><br />
<?php
$name=$_SESSION['n'];
$usr=$_SESSION['usr'];
$dt=$_SESSION['dt'];
require "dbconnect.php";

$sql2 = mysqli_query($con,"SELECT DISTINCT tmima FROM allstudentinfo ORDER BY tmima ");
   
?>
<form action='pedomada.php' method='post'> 

<h4> ΕΠΙΛΟΓΗ  ΜΑΘΗΤΗ/ΤΡΙΑΣ</h4>

    <label>Τμήμα:</label><select name='tmimaid' id='tmimaid'>
     
      <?php
	echo "<option value='---'>select</option>";
    while($row2 = mysqli_fetch_array($sql2) ) {
          echo "<option value='$row2[tmima]'>$row2[tmima]</option>";
      }
      ?>
     </select>
  

<label> Μαθητής/τρια:</label>

      <select name='nameid' id='nameid' value= ></select>

<input type="submit" name="submit1" value="Επιβεβαίωση Επιλογής" >
    </form>

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