<?php
session_start();
$menu=$_SESSION['menu'];
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'];

$sql = mysqli_query($con,"SELECT k.*,a.onoma,a.eponimo,a.tmima FROM kataggelia as k,allstudentinfo as a 
       WHERE  k.mitroo=a.mitroo order by k.bd ASC,a.tmima ASC, k.datekata DESC " );
$c=mysqli_num_rows($sql);

if ($c == 0 ){ 
      echo " ΔΕΝ ΥΠΑΡΧΟΥΝ ΠΕΙΘΑΡΧΙΚΑ";}
else
{
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:9px' bgcolor='#ffcc00'  >
<th>Α/A</th>
<th>Αρ.</th>
<th>Βοηθός</th>
<th>Τμήμα</th>
<th>Ημερομ.</th>
<th>Μαθητής/τρια</th>
<th>Περιγραφή Παραπτώματος</th>
<th>Καταγγελία από:</th>
<th>ΑΝΑΣΤΟΛΗ</th>
<th>ΑΛΛΗ</th>
<th>ΚΑΤΟΙΚΟΝ</th>
<th>ΑΠΟΒΟΛΗ</th>
</tr>";	

$i=1;	
while ($row=mysqli_fetch_array($sql))
{
$mitroo=$row['mitroo'];
$tmima=$row['tmima'];
$bd=$row['bd'];
$student=$row['eponimo']." ".$row['onoma'];
$anafora= $row['aranaforas'];	
$kataggelon= $row['kataggelon'];
$perigrafi=$row['perigrafi'];
$datekata = $row['datekata'];
$timo = $row['periodoi'];
$eidos=$row['eidostimo'];
$sql3 = mysqli_query($con,"SELECT Name FROM teachers  WHERE  PMP='$kataggelon'" );
$row3 = mysqli_fetch_array($sql3);
$kataapo = $row3['Name'];

echo "<tr>";
echo "<td>" .$i. "</td>";
echo "<td>" . "<a href=\"paraptoma2.php?data=".$anafora."\">"."<b>".$anafora."</b>". "</a>". "</td>";
echo "<td>". $bd. "</td>";
echo "<td>". $tmima . "</td>";
echo "<td>". $datekata . "</td>";
echo "<td>". $student . "</td>";
echo "<td>". $perigrafi . "</td>";
echo "<td>". $kataapo . "</td>";
if ($eidos==0 and $timo==0)
{
	echo "<td>". " ". "</td>";
	echo "<td>". "x" ."</td>";
	echo "<td>". " ". "</td>";
	echo "<td>". " ". "</td>";
}
elseif ($eidos==0 and $timo>0)
{
	echo "<td>". $timo. "</td>";
	echo "<td>". " ". "</td>";
	echo "<td>". " ". "</td>";
	echo "<td>". " ". "</td>";
	
}
elseif ($eidos==1)
{
	echo "<td>". " ". "</td>";
	echo "<td>". " ". "</td>";
	echo "<td>". $timo ."</td>";
	echo "<td>". " ". "</td>";
	
}
else
{
	echo "<td>". " ". "</td>";
	echo "<td>". " ". "</td>";
	echo "<td>". " ". "</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>