
<?php
session_start();
include('dbconnect.php');
//collect the passed id
$id = $_GET['tmimaid'];
//run a query
$sql2 = mysqli_query($con,"SELECT mitroo,eponimo,onoma,kpatera,kmiteras,kinito FROM allstudentinfo 
WHERE tmima = '$id' ORDER BY eponimo,onoma");

while($row = mysqli_fetch_array($sql2) ) {
    $m=$row['mitroo'];
	$st=trim($row['eponimo']."  ".$row['onoma']);
	$stname=mb_substr($st,0,30);
	$l=45-strlen($stname);
	$kp=$row['kpatera'];
	$km=$row['kmiteras'];
	$dispitem=$m.str_repeat('&nbsp;',4).$stname."\t\t".str_repeat('&nbsp;',5)."[τηλ Π:".$kp.", Μ:".$km."]";
	
    echo "<option value='$m'>$dispitem</option>";

}