<?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:13px; }
<p style="font-size:09px;"></p>
</style>

<h4>ΑΝΑΦΟΡΑ ΠΑΡΑΠΤΩΜΑΤΩΝ/ΤΙΜΩΡΙΩΝ</h4>
<?php
require_once "functions1.php";
require "dbconnect.php";
$usr=$_SESSION['usr'];


$sql=mysqli_query($con,"SELECT k.*,a.*  FROM kataggelia as k,apobolientypo as a where k.eidostimo=1 and a.timocode=k.aranaforas and k.bd='$usr' and a.who='Α' ORDER BY k.tmima,k.mitroo,k.datetimo " );
echo "<table class='myTable' >
<tr style='border:1px solid black;font-size:13px' bgcolor='#ffcc00'  >
<th>Αρ.</th>
<th>Τμήμα</th>
<th>Μαθητής/τρια</th>
<th>Ημερομ. Διεκπ.</th>
<th>ΚΑΤΟΙΚΟΝ</th>
<th>ΗΜΕΡΟΜΗΝΙΕΣ</th>
</tr>";	
while ($row = mysqli_fetch_array($sql))
{
	$mitroo=$row['mitroo'];
	$tmima=$row['tmima'];
	$arn= $row['aranaforas'];	
	$datetimo = $row['datetimo'];
	$entipo=$row['entypoid'];
	$q=mysqli_query($con,"select distinct(date) from apoboli where entypoid='$entipo' group by date");
	$d='';
	while($rowa=mysqli_fetch_array($q))
	{
		$dd=date('d-m-Y',strtotime($rowa['date']));
		$d=$d.",".$dd;
	}
	$stn=stname($mitroo);
	$dx=trim($d,',');
	echo "<tr>";
	echo "<td>" . "<a href=\"timorapov.php?data=".$arn."\">"."<b>".$arn."</b>". "</a>". "</td>";	
	echo "<td>". $tmima . "</td>";
	echo "<td>". $stn . "</td>";
	echo "<td>". $datetimo . "</td>";
	echo "<td align='center'>". $row['periodoi']. "</td>";
	echo "<td>". $dx. "</td>";
	echo "</tr>"; 
}
echo "</table>";
//............
echo "<br>";

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