diff --git a/assets/css/main.css b/assets/css/main.css index 56faff1..15cf0f6 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -116,7 +116,7 @@ button:hover, .button:hover { } /* Responsive layout */ @media (max-width: 850px) { - .menu nav li:hover>ul{ + .header.sub .menu nav li:hover>ul{ display: block; position: relative; top: 5px; diff --git a/assets/php/template.php b/assets/php/template.php index da2a8ad..d102294 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -216,6 +216,149 @@ } } + //Print Films Cards: + function print_fimls(){ + //List of the tittles of the movies: + require_once(__DIR__.'/common/film_dao.php'); + + $prefix= $this->get_prefix(); + + $films = new Film_DAO("complucine"); + $films_array = $films->allFilmData(); + $ids = array(); + $tittles = array(); + $descriptions = array(); + $times = array(); + $languages = array(); + + foreach($films_array as $key => $value){ + $ids[$key] = $value->getId(); + $tittles[$key] = $value->getTittle(); + $descriptions[$key] = $value->getDescription(); + $times[$key] = $value->getDuration(); + $languages[$key] = $value->getLanguage(); + } + + switch($this->page){ + case "Cartelera": + for($i = 0; $i < count($films_array); $i++){ + $tittle = str_replace('_', ' ', $tittles[$i]); + if($i%2 === 0){ + if($i != 0) echo " + "; + echo "
+ "; + } + else{ + if($i != 0) echo "
+ "; + echo "
+ "; + } + echo "
+
+
+
".$tittles[$i]."
+

".$tittle."

+
+
+

".$descriptions[$i]."

+
+

Duración: ".$times[$i]." minutos

+
+
+
+ "; + } + echo "
\n"; + break; + + case "Panel de Administrador": + echo"
"; + for($i = 0; $i < count($films_array); $i++){ + $tittle = str_replace('_', ' ', $tittles[$i]); + if($i%2 === 0){ + if($i != 0) echo "
+ "; + echo "
+ "; + } + else{ + if($i != 0) echo "
+ "; + echo "
+ "; + } + echo "
+
+
+
".$tittles[$i]."
+

".$tittle."

+
+
+ + + + + + +
+
+ + + + + + +
+
+
+
+ "; + } + echo "
+ \n"; + break; + + default: + echo'
+
+

Últimos Estrenos


'; + $count = 0; + for($i = count($tittles)-4; $i < count($tittles); $i++){ + if($count%2===0){ + if($count != 0) echo " +
"; + echo " +
"; + } + echo " +
+
+
".$tittles[$i]."
+
+
"; + $count++; + } + echo " +
+
+ +
+
"; + $count = rand(0, count($tittles)-1); + $title = str_replace('_', ' ', $tittles[$count]); + echo " +

{$title}


+
+
".$tittles[$count]."
+
+
+
\n"; + break; + } + } + //Print session MSG: function print_msg() { if(isset($_SESSION['message'])){ diff --git a/index.php b/index.php index fa25c1f..bfd7b5c 100644 --- a/index.php +++ b/index.php @@ -3,14 +3,7 @@ //General Config File: require_once(__DIR__.'/assets/php/config.php'); - //List of the tittles of the movies: - require_once($prefix.'assets/php/common/film_dao.php'); - $films = new Film_DAO("complucine"); - $films_array = $films->allFilmData(); - $tittles = array(); - foreach($films_array as $key => $value){ - $tittles[$key] = $value->getTittle(); - } + ?>
- - "; - echo "
- "; - } - else{ - if($i != 0) echo "
- "; - echo "
- "; - } - echo "
-
-
-
".$titles[$i]."
-

".$title."

-
-
-

".$descriptions[$i]."

-
-

Duración: ".$times[$i]." minutos

-
-
-
- "; - } - echo "
\n"; - ?> + print_fimls(); + ?>