<?php
include "scrinit.php";
include $menu;
?><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 black;padding:2px;font-size:11px; }
<p style="font-size:09px;"></p>
</style>

<h4>ΑΝΑΦΟΡΑ ΤΙΜΩΡΙΩΝ ΓΙΑ ΑΡΓΟΠΟΡΙΑ</h4>
<?php
require "dbconnect.php";
$usr=$_SESSION['usr'];
$access=$_SESSION['access'];
switch ($access) 
{
case 3:
case 4:
$sql = mysqli_query($con,"SELECT t.*,a.onoma,a.eponimo,a.tmima  FROM timoria as t,allstudentinfo as a
        WHERE t.stu_id=a.mitroo " );
$c1=mysqli_num_rows($sql);
break;
case 2:
$sql = mysqli_query($con,"SELECT t.*,a.onoma,a.eponimo,a.tmima  FROM timoria as t,allstudentinfo as a  
         WHERE t.stu_id=a.mitroo AND vd='$usr' " );
$c1=mysqli_num_rows($sql);
break;
}

if ($c1==0)
{ 
      echo " ΔΕΝ ΥΠΑΡΧΟΥΝ ΤΙΜΩΡΗΜΕΝΕΣ ΚΑΘΥΣΤΕΡΗΣΕΙΣ";}
else
{
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:9px' bgcolor='#ffcc00'  >
<th>Κωδικός</th>
<th>Τμήμα</th>
<th>Ημερομ.</th>
<th>Μαθητής/τρια</th>
<th>Ποινή</th>
</tr>";		
while ($row=mysqli_fetch_array($sql))
{
	$mitroo=$row['stu_id'];
	$tmima=$row['tmima'];
	$student=$row['eponimo']." ".$row['onoma'];
	$tcode= $row['timoriacode'];	
	$datetimo = $row['dateappl'];
	$timo = $row['peramount'];

	echo "<tr>";
	echo "<td>" . "<a href=\"timoria3.php?data=".$tcode."\">"."<b>".$tcode."</b>". "</a>". "</td>";
	echo "<td>". $tmima . "</td>";
	echo "<td>". $datetimo . "</td>";
	echo "<td>". $student . "</td>";
	echo "<td>". $timo ." "."περ.". "</td>";
	echo "</tr>"; 
	$i++;

}

echo "</table>";
}
//............
echo "<br>";


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