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

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style1.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(function() {
 $("#mathsubid").bind("change", function() {
     $.ajax({
         url: "change1.php",
         data: "mathsubid="+$("#mathsubid").val(),
         success: function(html) {
             $("#codeid").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>

<?php
require "dbconnect.php"; 
$dt=$_SESSION['dt'];
$name = $_SESSION['n'];
$usr=$_SESSION['usr'];
$access=$_SESSION['access'];
$tetramino=$_SESSION['tetramino'];

echo "<b>"." ΗΜΕΡΟΜΗΝΙΑ : "."</b>".$dt."<br>";
echo "<p class='p1'>". "ΕΠΙΛΟΓΗ  ΜΑΘΗΜΑΤΟΣ ". "</p>";

require "selectmath.php";
$ind=$ind-1;

?>

<form method='post'> 

    <label><b>Τμήμα/Μάθημα: </b></label><select name='mathsubid'  >
     
      <?php
	echo "<option value=' '>Επέλεξε Τμήμα και Μάθημα</option>";
    foreach ($mathsubj as $m){ 		  
          echo "<option value='$m'>$m</option>";
      }
      ?>
     </select>

<input type="submit" name="submitb" value="Επιβεβαίωση Επιλογής" >
</form>
<?php
if (isset($_POST['submitb']))
{
  $usr=$_SESSION['usr'];
  $tetramino=$_SESSION['tetramino'];
  $tmimax=$_POST['mathsubid'];
  $arr = explode("/", $tmimax);
  $lesson = rtrim(ltrim($arr[0]));
  $sb = rtrim(ltrim($arr[1]));
  echo $tmima.$subject;
  $fromx=1;
  include "profsynoptiko.php";
}
?>
</body>
</html>