<?php
session_start();
if (!(isset($_SESSION['islogin']) && $_SESSION['islogin'] != '')) {

header ("Location: dilosilogin.php");

}
$menu = $_SESSION['menu'];
include "logo.php";
?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:2px solid black;border-radius:5px;padding:4px;font-size:12pt; }
<p style="font-size:11px;"></p>
</style>
<link href="style.css" rel="stylesheet">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/disable_radio.js"></script>
<script type="text/javascript">
</script>

<body>
<div class="container">
<div class="main">
<h2>ΕΠΙΛΟΓΗ ΣΕΜΙΝΑΡΙΩΝ ΓΙΑ ΔΙΗΜΕΡΟ ΕΝΗΜΕΡΩΣΗΣ ΕΠΑΓΓΕΛΜΑΤΩΝ</h2>
<?php
include "dbconnectdilosi.php";
$dt=$_SESSION['dt'];
if ($dt > '2017-11-08 11:59:00') { 
?>
<h2> ΤΟ ΣΥΣΤΗΜΑ ΕΠΙΛΟΓΗΣ ΔΡΑΣΤΗΡΙΟΤΗΤΑΣ ΕΧΕΙ ΑΠΕΝΕΡΓΟΠΟΙΗΘΕΙ </h2>
<?php

header ("Location: indexstudent.php");

}  
$usr=$_SESSION['usr'];
$taxi=$_SESSION['taxi'];
if ($taxi <> "Α")
{
	echo "ΟΙ ΔΗΛΩΣΕΙΣ ΣΕΜΙΝΑΡΙΟΥ ΙΣΧΥΟΥΝ ΜΟΝΟ ΓΙΑ ΤΗΝ Α ΤΑΞΗ";
}
ELSE
{
$sql=mysqli_query($con,"select * from seminaria");
$i=1;
while($row=mysqli_fetch_array($sql))
{
   $rd[$i]=$row['semname'];
   $rc[$i]=$row['semcode'];
   $rcn[$i]='';
   if ($row['plithos'] >= $row['maxnum'])
   {
      $rcn[$i]='disabled';
   }
   $i++;   
}

$sql=mysqli_query($con,"select d.*,a.eponimo,a.onoma,a.tmima from dilosisem as d, allstudentinfo as a
     where d.mitroo=a.mitroo and d.mitroo='$usr'" );
if (mysqli_num_rows($sql) > 0)
{
  $i=1;
  while($row=mysqli_fetch_array($sql))
  {
   $name=$row['eponimo']." ".$row['onoma'];
   $tmima=$row['tmima'];
   $mitroo=$row['mitroo'];
   $rs[$i]=$row['semcode'];
   $i++;   
  }	
}

?>
<form action="radio_value.php" method="post">
<?php
echo "<table style='width:600px' border-radius:5px class='myTable' >
<tr style='border:1px solid black;' bgcolor='#819FF7'  >
<th colspan='3'> ΠΡΩΤΗ ΗΜΕΡΑ 20-12-17 </th>
<tr>
<th>ΣΕΜΙΝΑΡΙΟ1</th>
<th>ΣΕΜΙΝΑΡΙΟ2</th>
<th>ΣΕΜΙΝΑΡΙΟ3</th>
</tr>";
?>	
<tr>
<td> <input name="radio1" type="radio" <?php echo $rcn[1]; ?> <?php if($rc[1]== $rs[1]) echo 'checked'; ?> value=<?php echo $rc[1];?>><?php echo $rd[1];?> </td>
<td> <input name="radio1" type="radio" <?php echo $rcn[2]; ?> <?php if($rc[2]== $rs[1]) echo 'checked'; ?> value=<?php echo $rc[2];?>><?php echo $rd[2];?> </td>
<td> <input name="radio1" type="radio" <?php echo $rcn[3]; ?> <?php if($rc[3]== $rs[1]) echo 'checked'; ?> value=<?php echo $rc[3];?>><?php echo $rd[3];?> </td>
</tr>
<tr>
<td> <input name="radio2" type="radio" <?php echo $rcn[4]; ?> <?php if($rc[4]== $rs[2]) echo 'checked'; ?> value=<?php echo $rc[4];?>><?php echo $rd[4];?> </td>
<td> <input name="radio2" type="radio" <?php echo $rcn[5]; ?> <?php if($rc[5]== $rs[2]) echo 'checked'; ?> value=<?php echo $rc[5];?>><?php echo $rd[5];?> </td>
<td> <input name="radio2" type="radio" <?php echo $rcn[6]; ?> <?php if($rc[6]== $rs[2]) echo 'checked'; ?> value=<?php echo $rc[6];?>><?php echo $rd[6];?> </td>
</tr>
</table> <br><br>
<?php
/*
echo "<table style='width:600px' class='myTable' >
<tr style='border:1px solid black' bgcolor='#819FF7'  >
<th colspan='3'> ΔΕΥΤΕΡΗ ΗΜΕΡΑ 22-12-16 </th>
<tr>
<th>ΣΕΜΙΝΑΡΙΟ1</th>
<th>ΣΕΜΙΝΑΡΙΟ2</th>
<th>ΣΕΜΙΝΑΡΙΟ3</th>
</tr>";
?>
<tr>
<td> <input name="radio3" type="radio" <?php echo $rcn[7]; ?> <?php if($rc[7]== $rs[3]) echo 'checked'; ?> value=<?php echo $rc[7];?>><?php echo $rd[7];?> </td>
<td> <input name="radio3" type="radio" <?php echo $rcn[8]; ?> <?php if($rc[8]== $rs[3]) echo 'checked'; ?> value=<?php echo $rc[8];?>><?php echo $rd[8];?> </td>
<td> <input name="radio3" type="radio" <?php echo $rcn[9]; ?> <?php if($rc[9]== $rs[3]) echo 'checked'; ?> value=<?php echo $rc[9];?>><?php echo $rd[9];?> </td>
</tr>
<tr>
<td> <input name="radio4" type="radio" <?php echo $rcn[10]; ?> <?php if($rc[10]== $rs[4]) echo 'checked'; ?> value=<?php echo $rc[10];?>><?php echo $rd[10];?> </td>
<td> <input name="radio4" type="radio" <?php echo $rcn[11]; ?> <?php if($rc[11]== $rs[4]) echo 'checked'; ?> value=<?php echo $rc[11];?>><?php echo $rd[11];?> </td>
<td> <input name="radio4" type="radio" <?php echo $rcn[12]; ?> <?php if($rc[12]== $rs[4]) echo 'checked'; ?> value=<?php echo $rc[12];?>><?php echo $rd[12];?> </td>
</tr>
</table>
<?php
*/
?>
<br><br><br>
<input type="hidden" name="mitroo" value=<?php echo $mitroo;?> />
<input name="submit" type="submit" value="ΑΠΟΘΗΚΕΥΣΗ ΕΠΙΛΟΓΩΝ">
</form>
</div>

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