<?php
$day = date('D', strtotime($dt));
$dayper=$day."0";
$sqlv=mysqli_query($con, "SELECT e.pmp,t.Name  FROM efimeries as e,teachers as t  WHERE e.pmp=t.PMP and dayper='$dayper' ");
$rowv=mysqli_fetch_array($sqlv);
$vdname=$rowv['Name'];
echo "<table  style='width:300px'class='myTable' >
<tr style='border:1px solid black' bgcolor='#66CC99' >
<th>ΕΦΗΜΕΡΕΥΩΝ ΒΟΗΘΟΣ</th> </tr>";
echo "<tr>";
echo "<td>"."<b>"."<p style='font-size:16px;'>".$vdname."</p>";"</b>"."</td>";
echo "</tr>"."</table>";
//**************************************
echo "<br>"."<b>"."ΕΦΗΜΕΡΕΥΟΝΤΕΣ/ΟΥΣΕΣ ΠΕΡΙΟΔΟΥ"."</b>"."<br>";

$sqlv=$dbcon->prepare("SELECT e.*,t.Name  FROM efimeries as e,teachers as t  WHERE dayper LIKE ?  and e.pmp=t.PMP  order by e.dayper ASC");
$dp=$day.'%';
$sqlv->execute([$dp]);
while($rowv=$sqlv->fetch(PDO::FETCH_ASSOC))
{
	$dx=$rowv['dayper'];
	$per=substr($dx, -1);
	$vdname=$rowv['Name'];
	$ef[$per]=$vdname;
}

echo "<table class='myTable' >
<tr style='border:1px solid black' bgcolor='#d6ff73'>";
for ($i=1;$i<=$gym;$i++)
{
	$titep="Περ".$i;
	echo "<th>".$titep."</th>";
}
echo "<tr>";
for ($k=1;$k<=$gym;$k++)
{
   echo "<td>".$ef[$k]."</td>";
   }
echo "</table>";