Update template

Comprobación antes de imprimir cines, al no haber cines da error en el xamp
This commit is contained in:
marian1010 2021-05-06 07:44:01 +02:00
parent 8614c4b0ef
commit 8408636fa5

View File

@ -376,14 +376,14 @@
$names = array(); $names = array();
$directions = array(); $directions = array();
$phones = array(); $phones = array();
if(is_array($cinemas)){
foreach($cinemas as $key => $value){ foreach($cinemas as $key => $value){
$ids[$key] = $value->getId(); $ids[$key] = $value->getId();
$names[$key] = $value->getName(); $names[$key] = $value->getName();
$directions[$key] = $value->getDirection(); $directions[$key] = $value->getDirection();
$phones[$key] = $value->getPhone(); $phones[$key] = $value->getPhone();
} }
}
switch($this->page){ switch($this->page){
case "Panel de Administrador": case "Panel de Administrador":
echo "<div class='row'> echo "<div class='row'>
@ -400,6 +400,7 @@
</thead> </thead>
<tbody> <tbody>
"; ";
if(is_array($cinemas)){
for($i = 0; $i < count($cinemas); $i++){ for($i = 0; $i < count($cinemas); $i++){
echo '<tr> echo '<tr>
<td>'. $ids[$i] .'</td> <td>'. $ids[$i] .'</td>
@ -427,6 +428,7 @@
</tr> </tr>
'; ';
} }
}
echo'</tbody> echo'</tbody>
</table> </table>
</div> </div>