From 13b14d775814aa43d7312efa6c69c26867ac8e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Sun, 2 May 2021 17:27:20 +0200 Subject: [PATCH] add function print_cinemas --- assets/php/template.php | 74 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/assets/php/template.php b/assets/php/template.php index d102294..0c9c06c 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -295,7 +295,7 @@
".$tittles[$i]."

".$tittle."


-
+ @@ -303,7 +303,7 @@
-
+ @@ -359,6 +359,76 @@ } } + function print_cinemas(){ + //List of the tittles of the movies: + require_once(__DIR__.'/common/cinema_dao.php'); + + $prefix= $this->get_prefix(); + + $cine = new Cinema_DAO("complucine"); + $cinemas = $cine->allCinemaData(); + $ids = array(); + $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(); + } + + switch($this->page){ + case "Panel de Administrador": + echo "
+ + + + + + + + + + "; + for($i = 0; $i < count($cinemas); $i++){ + echo ' + + + + + + + + '; + } + echo' +
IdNombreDireccionTelefono
'. $ids[$i] .''. $names[$i] .''. $directions[$i] .''. $phones[$i] .' + + + + + + + + +
+ + + + + +
+
+
'; + echo "\n"; + break; + + } + } + + //Print session MSG: function print_msg() { if(isset($_SESSION['message'])){