From 571d28fc19108017867ac79bb06459f7995dd9bb Mon Sep 17 00:00:00 2001 From: marian1010 <79144276+marian1010@users.noreply.github.com> Date: Thu, 27 May 2021 10:00:13 +0200 Subject: [PATCH] update template Comprobaciones por si la base de datos esta vacia --- assets/php/template.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/assets/php/template.php b/assets/php/template.php index 5bbb4c0..352c40a 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -276,7 +276,7 @@ $descriptions = array(); $times = array(); $languages = array(); - + if(is_array($films_array)){ foreach($films_array as $key => $value){ $ids[$key] = $value->getId(); $tittles[$key] = $value->getTittle(); @@ -284,9 +284,10 @@ $times[$key] = $value->getDuration(); $languages[$key] = $value->getLanguage(); } - + } switch($this->page){ case "Cartelera": + if(is_array($films_array)){ for($i = 0; $i < count($films_array); $i++){ $tittle = str_replace('_', ' ', $tittles[$i]); if($i%2 === 0){ @@ -319,11 +320,13 @@ "; } + } $reply .= "\n"; break; case "Panel de Administrador": $reply .= "
"; + if(is_array($films_array)){ for($i = 0; $i < count($films_array); $i++){ $tittle = str_replace('_', ' ', $tittles[$i]); if($i%2 === 0){ @@ -365,11 +368,13 @@ "; } + } $reply .= "
\n"; break; case "Panel de Gerente": $reply .= "
"; + if(is_array($films_array)){ for($i = 0; $i < count($films_array); $i++){ $tittle = str_replace('_', ' ', $tittles[$i]); if($i%2 === 0){ @@ -414,10 +419,12 @@ "; } + } $reply .= "
\n"; break; default: + if(is_array($films_array)){ $reply .='

Ăšltimos Estrenos


'; @@ -452,6 +459,7 @@
\n"; + } break; } @@ -473,7 +481,7 @@ $names = array(); $directions = array(); $phones = array(); - + if(is_array($cinemas)){ foreach($cinemas as $key => $value){ $ids[$key] = $value->getId(); @@ -485,6 +493,7 @@ switch($this->page){ case "Nuestros Cines": + if(is_array($cinemas)){ for($i = 0; $i < count($cinemas); $i++){ if($i%2 === 0){ if($i != 0) $reply .= " @@ -513,6 +522,7 @@ "; } $reply .= "\n"; + } break; case "Panel de Administrador": $reply .= "