<?php
$day = date('D', strtotime($dt));

$all="id,pmp,Teacher,";
for ($i=1;$i<=$gym;$i++){$t=$day.$i;$ta.=$t.',';}
$all=$all.$ta;
$all = rtrim($all, ',');

$kathida=$kath1a=$allclassa=$kt=$fp=$tp=$room1=$miso=$chwith=array();

$result = mysqli_query($con,"SELECT ".$all. " FROM timetable");
$a=1;
while($row = mysqli_fetch_array($result)) 
{
  $notallblank=0;
  $id=$row['id'];
  $teach[$id]=$row['Teacher'];
  $pmpt[$id]=$row['pmp'];
  for($i=1;$i<=$gym;$i++)
  {
	 $in=$day.$i;
	 $l1=$row["$in"];
	 if (!empty($l1)) 
	 {
	    $tprog[$id][$i]=$l1;
	    $notallblank=1;
	 }
	 else
	 {
		 $tprog[$id][$i]="";
	 }
   }
  if ($notallblank==1)
  {   
      if($id % 2 !=0)
	  {
		  $kathida[$a]=$row['id'];
		  $kath1a[$a]=$row['Teacher'];
		  $teachname[$row['id']]=$row['Teacher'];
		  $a++; 
	  }
	  
  }
}
$a=$a-1;
$nid=$id;

include "amivread.php";

include "katahorisi.php";
