<?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 src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head>
<style>
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:11px; }
.fieldset
{
    width:750px;
	background: #F5F9F0;
	border:2px solid green;
    -moz-border-radius:8px;
    -webkit-border-radius:8px;	
    border-radius:8px;	
}
.select {overflow-y: scroll;}
</style>
<body>
<?php
require("dbconnect.php");
	$grn=$_POST['grn'];
	$prg=$_POST['prg'];
	$cd=$_POST['cd']; 
	mysqli_query($con,"INSERT INTO groupd (groupcode,groupname,perigrafi) VALUES ('$cd','$grn','$prg')");
	
	?><h4>ΕΠΙΛΟΓΗ ΜΑΘΗΤΩΝ ΓΙΑ ΤΗΝ ΟΜΑΔΑ <?php echo $grn; ?> </h4><?php

    $sql = mysqli_query($con,"SELECT mitroo,tmima,eponimo,onoma  FROM allstudentinfo order by tmima,eponimo,onoma ASC ");

    ?>
	<form  method="post" name="epilogi" action="groupst1.php">
	<div style="overflow:scroll; border:1px solid black;background:#F5F9F0;width:520px; height: 650px">
	<?php
	echo "<table style='width:500px' class='myTable' >
	<tr style='border:1px solid black' bgcolor='#adcd82'  >
	<th>ΜΗΤΡΩΟ</th>
	<th>ΤΜΗΜΑ</th>
	<th>ΟΝΟΜΑΤΕΠΩΝΥΜΟ</th>
	<th></th>
	<th>ΕΠΙΛΟΓΗ</th>
	</tr>";
	$i=1;
	while ($row=mysqli_fetch_array($sql))
	{ 
		$am[$i]=$row['mitroo'];
		$tm1[$i]=$row['tmima'];
		$namet[$i]=$row['eponimo']." ".$row['onoma'];;
		echo "<tr>";
		echo "<td>".$am[$i]."</td>";
		echo "<td>".$tm1[$i]."</td>";
		echo "<td>".$namet[$i]."</td>";
		echo "<td>"." "."</td>";
		echo "<td ALIGN=center>"."<input type='checkbox' name='mitr[]' value='$am[$i]'  >"."</td>";
		echo "</tr>";
		$i++;
	}
	echo "</table>";
	echo "<input type='hidden' name='gc' value='$cd'  >";
	?>
	</div>
	<br>
	<input type="submit" name="gn3" value="Επιβεβαίωση Επιλογών" >
	</form> 
<?php



