SW/showtimes/index.php

85 lines
2.4 KiB
PHP
Raw Normal View History

<!DOCTYPE HTML>
2021-04-16 12:57:37 +02:00
<?php
//General Config File:
require_once('../assets/php/config.php');
2021-04-13 17:22:00 +02:00
//List of the tittles and descriptions of the movies:
2021-04-16 12:57:37 +02:00
require_once($prefix.'panel_admin/includes/film_dao.php');
$loadFilms = new Film_DAO("complucine");
$films = $loadFilms->allFilmData();
$titles = array();
$descriptions = array();
$times = array();
foreach($films as $key => $value){
$titles[$key] = $value->getTittle();
$descriptions[$key] = $value->getDescription();
$times[$key] = $value->getDuration();
}
?>
<!--
Práctica 2 - Sistemas Web | Grupo D
CompluCine - FDI-cines
-->
<html lang="es">
<!-- Head -->
<?php
$template->print_head();
?>
<body>
<!-- Header -->
<?php
$template->print_header();
?>
<!-- Main -->
<?php
$template->print_main();
?>
<!-- Films -->
<section id="films_billboard">
<div class='row'>
<?php
for($i = 0; $i < count($films); $i++){
2021-04-16 12:57:37 +02:00
$title = str_replace('_', ' ', $titles[$i]);
if($i%2 === 0){
if($i != 0) echo "</div>
";
echo "<div class='column side'>
";
}
else{
if($i != 0) echo "</div>
";
echo "<div class='column middle'>
";
}
2021-04-16 12:57:37 +02:00
echo "<section id='".$titles[$i]."'>
<div class='zoom'>
2021-04-13 17:22:00 +02:00
<div class='code showtimes'>
2021-04-16 12:57:37 +02:00
<div class='image'><img src='".$prefix."img/".$titles[$i].".jpg' alt='".$titles[$i]."' /></div>
<h2>".$title."</h2>
2021-04-13 17:22:00 +02:00
<hr />
<div class='blockquote'>
2021-04-16 12:57:37 +02:00
<p>".$descriptions[$i]."</p>
2021-04-13 17:22:00 +02:00
</div>
2021-04-16 12:57:37 +02:00
<p>Duración: ".$times[$i]." minutos</p>
</div>
</div>
</section>
";
}
echo "</div>\n";
?>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>