<?php
include "scrinit.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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:1px solid green;padding:2px;font-size:10pt; }
<p style="font-size:10px;"></p>
</style>
</head>

<body>
<?php

echo "<br>"."ΚΑΤΑΛΟΓΟΣ ΜΑΘΗΤΩΝ ΓΙΑ ΤΗ ΔΡΑΣΤΗΡΙΟΤΗΤΑ:"."<b>". $ekd."</b>". "<br>"."<br>";
echo "<table class='myTable' >
<tr style='border:2px solid black;font-size:12px'  >
<tr>
<th>α/α</th>
<th>Μητρώο</th>
<th>Τμήμα</th>
<th>Επώνυμο</th>
<th>Όνομα</th>
<th>ΠΑΡΟΥΣΙΑ</th>";
for ($i=1;$i<=$gym;$i++)
{
	$titep="Περ".$i;
	echo "<th>".$titep."</th>";
}
echo "</tr>";
$i=1;
while($row = $result->fetch(PDO::FETCH_ASSOC))
{
	 $mt=$row['pmp'];
	 $tm=$row['tmima'];
	 $pr[1]=$row['p1'];$pr[2]=$row['p2'];$pr[3]=$row['p3'];$pr[4]=$row['p4'];$pr[5]=$row['p5'];
	 $pr[6]=$row['p6'];$pr[7]=$row['p7'];$pr[8]=$row['p8'];$pr[9]=$row['p9'];
	 $sql1 = "SELECT eponimo, onoma FROM allstudentinfo WHERE mitroo =?";
     $rt = $dbcon->prepare($sql1);
	 $rt->execute([$mt]);
	 $row1 = $rt->fetch(PDO::FETCH_ASSOC);
	 $epo=$row1['eponimo'];
	 $nm=$row1['onoma'];
	 echo "<tr>";
	 echo "<td>" .$i;
	 echo "<td>". "<input type='text' name='mt[]' value='$mt' size=12>" . "</td>";
	  echo "<td>". "<input type='text' name='tm[]' value='$tm' size=12 >" . "</td>";
	 echo "<td>". "<input type='text' name='epo[]' value='$epo' >" . "</td>";
     echo "<td>". "<input type='text' name='nm[]' value='$nm' >" . "</td>";
	 ?>
      <td>
     <input type='checkbox' name='ok[]' value='$ok' checked /> 
     </td>
     
   <?php
     for ($j=1;$j<=$gym;$j++)
	 {
	   ?>
       <td>
       <input type='checkbox' name='p[]' value='$pr[$j]'   <?php if($pr[$j]==1) {echo 'checked';} else echo 'unchecked'; ?> /> 
       </td>
	   <?php
	 }
	 echo "</tr>";
	 $i++;
}
echo "</table>";

?> 
  
</body>
</html>