diff --git a/assets/php/template.php b/assets/php/template.php index ea047ea..61c9ee1 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -376,14 +376,14 @@ $names = array(); $directions = array(); $phones = array(); - - foreach($cinemas as $key => $value){ - $ids[$key] = $value->getId(); - $names[$key] = $value->getName(); - $directions[$key] = $value->getDirection(); - $phones[$key] = $value->getPhone(); + if(is_array($cinemas)){ + foreach($cinemas as $key => $value){ + $ids[$key] = $value->getId(); + $names[$key] = $value->getName(); + $directions[$key] = $value->getDirection(); + $phones[$key] = $value->getPhone(); + } } - switch($this->page){ case "Panel de Administrador": echo "
@@ -400,6 +400,7 @@ "; + if(is_array($cinemas)){ for($i = 0; $i < count($cinemas); $i++){ echo ' '. $ids[$i] .' @@ -427,6 +428,7 @@ '; } + } echo'