<?php
include "scrinit.php";
include "logo.php";
?>
<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; }
</style>
<body>
<?php
require("dbconnect.php");
	
	$mitr=$_POST['mitr'];
	$gc=$_POST['gc'];
	foreach ($mitr as $mt)
	{
		mysqli_query($con,"insert into groupdst (groupcode,mitroo) values ('$gc','$mt')");
	}
	
	echo "<p class='p1'>"."Η ΟΜΑΔΑ ΔΗΜΙΟΥΡΓΗΘΗΚΕ ΜΕ ΕΠΙΤΥΧΙΑ"."</p> ";
	$q=mysqli_query($con,"select st.mitroo,a.eponimo,a.onoma,a.tmima from groupdst as st,allstudentinfo as a
			where st.mitroo=a.mitroo and st.groupcode='$gc'");
	echo "<table style='width:700px' class='myTable' >
	<tr style='border:1px solid black' bgcolor='#adcd82'  >
	<th>A/A</th>
	<th>ΜΗΤΡΩΟ</th>
	<th>ΤΜΗΜΑ</th>
	<th>ΟΝΟΜΑΤΕΠΩΝΥΜΟ</th>";
	$i=1;
	while ($row=mysqli_fetch_array($q))
	{ 
		$am=$row['mitroo'];
		$tm=$row['tmima'];
		$namet=$row['eponimo']." ".$row['onoma'];
		echo "<tr>";
		echo "<td>".$i."</td>";
		echo "<td>".$am."</td>";
		echo "<td>".$tm."</td>";
		echo "<td>".$namet."</td>";
		echo "</tr>";
		$i++;
	}
	echo "</table>";
	
?>
<br><br><br><br>
<a  href=<?php echo $menu; ?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a> 
</body>
</html>