<?php
session_start(); // start up your PHP session!
 if ($_SESSION['islogin']=='' ) { 
  echo "ΠΡΕΠΕΙ ΝΑ ΚΑΝΕΤΕ ΕΓΓΡΑΦΗ ΓΙΑ ΧΡΗΣΗΣ ΤΟΥ ΣΥΣΤΗΜΑΤΟΣ"."<BR>";
  sleep(3);
  header("Location: loginall.php"); /* Redirect browser */
  exit();
  }
$menu=$_SESSION['menu'];
include "logo.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" />
<title>Untitled Document</title>
</head>
<style type="text/css">
input.right{  text-align:right;  }
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:10pt; }
</style>
<body>

<?php
require "dbconnect.php";
$dt=date('Y-m-d');
  
$sql= mysqli_query($con,"SELECT semname,plithos from seminaria order by semcode");
$i=1;
while($row=mysqli_fetch_array($sql))
{
   $semname[$i]=$row['semname'];
   $semplithos[$i]=$row['plithos'];
   $i++;   
}

// display plithos by day and session

echo "<table style='width:600px' border-radius:5px class='myTable' >
<tr style='border:1px solid black;' bgcolor='#819FF7'  >
<th colspan='3'> ΠΡΩΤΗ ΗΜΕΡΑ 21-12-16 </th>
<tr>
<th>ΣΕΜΙΝΑΡΙΟ 1</th>
<th>ΣΕΜΙΝΑΡΙΟ 2</th>
<th>ΣΕΜΙΝΑΡΙΟ 3</th>
</tr>";
echo "<tr>";
echo "<td>". $semname[1]." ( ".$semplithos[1]. " )"."</td>";
echo "<td>". $semname[2]." ( ".$semplithos[2]. " )"."</td>";
echo "<td>". $semname[3]." ( ".$semplithos[3]. " )"."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>". $semname[4]." ( ".$semplithos[4]. " )"."</td>";
echo "<td>". $semname[5]." ( ".$semplithos[5]. " )"."</td>";
echo "<td>". $semname[6]." ( ".$semplithos[6]. " )"."</td>";
echo "</tr>";
echo "<table style='width:600px' class='myTable' >
<tr style='border:1px solid black' bgcolor='#819FF7'  >
<th colspan='3'> ΔΕΥΤΕΡΗ ΗΜΕΡΑ 22-12-16 </th>
<tr>
<th>ΣΕΜΙΝΑΡΙΟ1</th>
<th>ΣΕΜΙΝΑΡΙΟ2</th>
<th>ΣΕΜΙΝΑΡΙΟ3</th>
</tr>";
echo "<tr>";
echo "<td>". $semname[7]." ( ".$semplithos[7]. " )"."</td>";
echo "<td>". $semname[8]." ( ".$semplithos[8]. " )"."</td>";
echo "<td>". $semname[9]." ( ".$semplithos[9]. " )"."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>". $semname[10]." ( ".$semplithos[10]. " )"."</td>";
echo "<td>". $semname[11]." ( ".$semplithos[11]. " )"."</td>";
echo "<td>". $semname[12]." ( ".$semplithos[12]. " )"."</td>";
echo "</tr>";
echo "</table>";
//*************
echo "<br>";echo "<br>";
echo "ΔΕΝ ΔΗΛΩΣΑΝ "."<br>";
$result = mysqli_query($con,"SELECT  DISTINCT mitroo FROM dilosisem " );
$i=1;
while($row=mysqli_fetch_array($result)) {$d[$i]=$row['mitroo'];$i++;}

$result = mysqli_query($con,"SELECT  mitroo,onoma,eponimo,tmima FROM allstudentinfo where tmima like 'Α%' " );
$i=1;
while($row=mysqli_fetch_array($result)) 
{
	$dal[$i]=$row['mitroo'];
	$name[$dal[$i]]=$row['eponimo']." ".$row['onoma'];
	$tmima[$dal[$i]]=$row['tmima'];
	$i++;}

$dif=array_diff($dal,$d);
$n=count($dif);
$i=1;
foreach($dif as $x)
{  
	echo $i." . ".$name[$x]." (".$tmima[$x]." )"."<br>";$i++;
}
/*<br><br><br>
$k=1;
while ($rowcode = mysqli_fetch_array($sqlcode)) 
{
$cod=$rowcode['Code'];

$sql = mysqli_query($con,"SELECT d.*, al.mitroo,al.tmima,al.eponimo,al.onoma 
FROM allstudentinfo as al,dilosiomilos as d WHERE d.pmp=al.mitroo and d.code1='$cod'  ORDER BY al.tmima" ); 

if (mysqli_num_rows($sql)>0)
{
echo $cod." ".$rowcode['Name'];	
echo "<table class='myTable' >
<tr style='border:1px solid black' bgcolor='#d6ff73'  >
<th>No.</th>
<th>A/M</th>
<th>Τ/ΜΑ</th>
<th>ΜΑΘΗΤΗΣ/ΤΡΙΑ</th>
<th>ΟΜΙΛΟΣ2</th>";

$i=1;
while ($row = mysqli_fetch_array($sql)) 
{

$mitroo=$row['mitroo'];$id[$k]=$mitroo;
$tmima=$row['tmima'];
$omilos1=$row['code1'];
$omilos2=$row['code2'];
$name= $row['eponimo']." ".$row['onoma'];
echo "<tr>";
echo "<td>".$i."</td>";
echo "<td>".$mitroo."</td>";
echo "<td>".$tmima."</td>";
echo "<td>".$name."</td>";
echo "<td>".$omilos2."</td>";
echo "</tr>";
$i++; $k++;
}
$i--;
echo "</table>";echo "ΣΥΝΟΛΟ ΟΜΙΛΟΥ:".$i."<br>"."<br>";
}
}
//..............................
$sql = mysqli_query($con,"SELECT mitroo FROM allstudentinfo " ); 
$i=1;
while ($row = mysqli_fetch_array($sql)) 
{ 
$mitr[$i]=$row['mitroo'];
$i++; 
}

$celement = array_diff($mitr,$id);
$ll=count($celement);	 
echo $ll."<br>";

$i=1;
foreach($celement as $id) 
{
   $sql = mysqli_query($con,"SELECT tmima,eponimo,onoma FROM allstudentinfo WHERE mitroo='$id' " ); 
   $row = mysqli_fetch_array($sql);
   $name=$row['eponimo']." ".$row['onoma'];
   $tmima=$row['tmima'];
   echo "<br>".$i.". ".$name." ".$tmima;
   $i++;
}
*/
?>
<br><br>
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a>

</body>
</html>