I have a problem with the HTML and PHP listing because they do not show me the data properly
The goal is to show me this way
But I get it this way
<form action="ListadoCompletoBuscarSensor1.php" >
Nombre de la primera persona:
<select name="nombre1">
<?php
$listado1 = $dao->ListadoPorPersona();
foreach ($listado1 as $value) {
echo "<option>" . $value . "</option>";
}
?>
</select>
Nombre de la Segunda Persona
<select name="nombre2">
<?php
$listado2 = $dao->ListadoPorPersona();
foreach ($listado1 as $value) {
echo "<option>" . $value . "</option>";
}
?>
</select>
<input type="submit" value="Listar Por Sensor" name="btnListarPersona" />
</form>
<?php
$nombre1 = $_GET['nombre1'];
$nombre2 = $_GET['nombre2'];
$r = $dao->ListadoAgrupadoPorPersona($nombre1, $nombre2);
echo '<table class="table-fill">';
echo '<th class="text-left">' . $nombre1. '</th>' .
'<th class="text-left">' . $nombre2. '</th>' .
foreach ($r as $list) {
if ($list->getEquipo() == $nombre1) {
foreach ($r as $value) {
echo '<tbody class="table-hover">';
echo '<tr>';
echo '<td class="text-left">' . $value->getValor() . '</td>';
//echo '<td class="text-left">' . $value->getFecha(). '</td>';
}
}
if ($list->getEquipo()==$nombre2) {
foreach ($r as $value) {
echo '<td class="text-left">' . $value->getValor() . '</td>';
echo '</tr>';
echo '</tbody>';
}
}
echo '</table';
}