update template

Comprobaciones por si la base de datos esta vacia
This commit is contained in:
marian1010 2021-05-27 10:00:13 +02:00
parent 77781827bc
commit 571d28fc19

View File

@ -276,7 +276,7 @@
$descriptions = array(); $descriptions = array();
$times = array(); $times = array();
$languages = array(); $languages = array();
if(is_array($films_array)){
foreach($films_array as $key => $value){ foreach($films_array as $key => $value){
$ids[$key] = $value->getId(); $ids[$key] = $value->getId();
$tittles[$key] = $value->getTittle(); $tittles[$key] = $value->getTittle();
@ -284,9 +284,10 @@
$times[$key] = $value->getDuration(); $times[$key] = $value->getDuration();
$languages[$key] = $value->getLanguage(); $languages[$key] = $value->getLanguage();
} }
}
switch($this->page){ switch($this->page){
case "Cartelera": case "Cartelera":
if(is_array($films_array)){
for($i = 0; $i < count($films_array); $i++){ for($i = 0; $i < count($films_array); $i++){
$tittle = str_replace('_', ' ', $tittles[$i]); $tittle = str_replace('_', ' ', $tittles[$i]);
if($i%2 === 0){ if($i%2 === 0){
@ -319,11 +320,13 @@
</section> </section>
"; ";
} }
}
$reply .= "</div>\n"; $reply .= "</div>\n";
break; break;
case "Panel de Administrador": case "Panel de Administrador":
$reply .= "<div class='column'>"; $reply .= "<div class='column'>";
if(is_array($films_array)){
for($i = 0; $i < count($films_array); $i++){ for($i = 0; $i < count($films_array); $i++){
$tittle = str_replace('_', ' ', $tittles[$i]); $tittle = str_replace('_', ' ', $tittles[$i]);
if($i%2 === 0){ if($i%2 === 0){
@ -365,11 +368,13 @@
</section> </section>
"; ";
} }
}
$reply .= "</div>\n"; $reply .= "</div>\n";
break; break;
case "Panel de Gerente": case "Panel de Gerente":
$reply .= "<div class='column'>"; $reply .= "<div class='column'>";
if(is_array($films_array)){
for($i = 0; $i < count($films_array); $i++){ for($i = 0; $i < count($films_array); $i++){
$tittle = str_replace('_', ' ', $tittles[$i]); $tittle = str_replace('_', ' ', $tittles[$i]);
if($i%2 === 0){ if($i%2 === 0){
@ -414,10 +419,12 @@
</section> </section>
"; ";
} }
}
$reply .= "</div>\n"; $reply .= "</div>\n";
break; break;
default: default:
if(is_array($films_array)){
$reply .='<div class="column left"> $reply .='<div class="column left">
<div class="galery"> <div class="galery">
<h1>Últimos Estrenos</h1><hr />'; <h1>Últimos Estrenos</h1><hr />';
@ -452,6 +459,7 @@
</div> </div>
</div> </div>
</div>\n"; </div>\n";
}
break; break;
} }
@ -473,7 +481,7 @@
$names = array(); $names = array();
$directions = array(); $directions = array();
$phones = array(); $phones = array();
if(is_array($cinemas)){ if(is_array($cinemas)){
foreach($cinemas as $key => $value){ foreach($cinemas as $key => $value){
$ids[$key] = $value->getId(); $ids[$key] = $value->getId();
@ -485,6 +493,7 @@
switch($this->page){ switch($this->page){
case "Nuestros Cines": case "Nuestros Cines":
if(is_array($cinemas)){
for($i = 0; $i < count($cinemas); $i++){ for($i = 0; $i < count($cinemas); $i++){
if($i%2 === 0){ if($i%2 === 0){
if($i != 0) $reply .= "</div> if($i != 0) $reply .= "</div>
@ -513,6 +522,7 @@
"; ";
} }
$reply .= "</div>\n"; $reply .= "</div>\n";
}
break; break;
case "Panel de Administrador": case "Panel de Administrador":
$reply .= "<div class='row'> $reply .= "<div class='row'>