I need to set up a table of days and events. When one of the days of the event is the same as the table day, it has to appear on the screen in the correct place. I am already able to compare and show, however, because the table is all disassembled because of the algorithm that searches and runs, I can not make the table ever right!
Would anyone know a solution to get the table mounted by skipping these tags?
Follow the table code:
<table class="table table-bordered">
<thead>
<tr>
<th><center>Turno \ Dia</center></th>
<?php
include_once 'classes/semestresclass.php';
if(!isset($_SESSION)) {session_start();}
$idSemestre = $_SESSION['SemestreGeral'];
$oSemestre = new semestresclass();
$oSemestre -> listarEdicao($idSemestre);
$array = mysql_fetch_array($oSemestre->retorno());
$start_date = $array['DataDeInicio'];
$end_date = $array['DataDeTermino'];
$inicio = new DateTime($start_date);
$fim = new DateTime($end_date);
$fim->modify('+1 day');
$interval = new DateInterval('P1D');
$periodo = new DatePeriod($inicio, $interval ,$fim);
foreach($periodo as $data){
echo '<th><p><center>'.$data->format("d/m/Y").'</p><p>'.$data->format("l").'</p></center></th>';
include_once 'classes/bancasclass.php';
if(!isset($_SESSION)) {session_start();}
$idSemestre = $_SESSION['SemestreGeral'];
$oBanca = new bancasclass();
$oBanca -> listar ($idSemestre);
while ($arrayBancas = mysql_fetch_array($oBanca->retorno())){
if (date('Y-m-d', strtotime($arrayBancas['dataHora'])) == $data->format('Y-m-d')) {
echo '<td>teste</td>';
}
}
}
?>
</table>
In this scheme I also have schedules to organize in this table ... I'm trying to go in parts, first solve the day and then the schedule, but maybe I'm going the wrong way, maybe I have to do everything together .. In the case, the first column on the left will have the 'morning', 'late' and 'night' shifts and, depending on the time of the event, put it according to the two axes.
I'm trying with a table, but no table solutions are also welcome !!
Table: