Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-13 00:10:19 +02:00 committed by GitHub
parent a6f37400e7
commit 4d59424d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 117 deletions

View File

@ -46,4 +46,9 @@
* @see http://php.net/manual/en/language.types.callable.php * @see http://php.net/manual/en/language.types.callable.php
*/ */
register_shutdown_function(array($app, 'shutdown')); register_shutdown_function(array($app, 'shutdown'));
//Depuración (BORRAR):
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?> ?>

View File

@ -152,10 +152,20 @@
} }
/* MAIN */ /* MAIN */
if($prefix === "./"){
if(isset($_SESSION["nombre"])){
$header = "<h1>Bienvenido {$_SESSION["nombre"]}</h1>\n";
} else {
$header = "<h1>Bienvenido a CompluCine</h1>\n";
}
} else {
$header = "<h1>{$page}</h1>\n";
}
echo"<main> echo"<main>
<div class='image'><a href='{$prefix}'><img src='{$prefix}img/logo_trasparente.png' alt='logo_FDI-Cines' /></a></div> <div class='image'><a href='{$prefix}'><img src='{$prefix}img/logo_trasparente.png' alt='logo_FDI-Cines' /></a></div>
{$sub_header} {$sub_header}
<h1>{$page}</h1> {$header}
<hr /> <hr />
</main>\n"; </main>\n";
} }
@ -238,6 +248,7 @@
//Print Films Cards: //Print Films Cards:
function print_fimls(){ function print_fimls(){
$reply = "";
//List of the movies: //List of the movies:
require_once(__DIR__.'/common/film_dao.php'); require_once(__DIR__.'/common/film_dao.php');
@ -264,18 +275,18 @@
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){
if($i != 0) echo "</div> if($i != 0) $reply .= "</div>
"; ";
echo "<div class='column side'> $reply .= "<div class='column side'>
"; ";
} }
else{ else{
if($i != 0) echo "</div> if($i != 0) $reply .= "</div>
"; ";
echo "<div class='column middle'> $reply .= "<div class='column middle'>
"; ";
} }
echo "<section id='".$tittles[$i]."'> $reply .= "<section id='".$tittles[$i]."'>
<div class='zoom'> <div class='zoom'>
<div class='code showtimes'> <div class='code showtimes'>
<div class='image'><img src='".$prefix."img/films/".$tittles[$i].".jpg' alt='".$tittles[$i]."' /></div> <div class='image'><img src='".$prefix."img/films/".$tittles[$i].".jpg' alt='".$tittles[$i]."' /></div>
@ -290,26 +301,26 @@
</section> </section>
"; ";
} }
echo "</div>\n"; $reply .= "</div>\n";
break; break;
case "Panel de Administrador": case "Panel de Administrador":
echo"<div class='column'>"; $reply .= "<div class='column'>";
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){
if($i != 0) echo "</div> if($i != 0) $reply .= "</div>
"; ";
echo "<div class='column side'> $reply .= "<div class='column side'>
"; ";
} }
else{ else{
if($i != 0) echo "</div> if($i != 0) $reply .= "</div>
"; ";
echo "<div class='column middle'> $reply .= "<div class='column middle'>
"; ";
} }
echo "<section id='".$tittles[$i]."'> $reply .= "<section id='".$tittles[$i]."'>
<div class='zoom'> <div class='zoom'>
<div class='code showtimes'> <div class='code showtimes'>
<div class='image'><img src='".$prefix."img/films/".$tittles[$i].".jpg' alt='".$tittles[$i]."' /></div> <div class='image'><img src='".$prefix."img/films/".$tittles[$i].".jpg' alt='".$tittles[$i]."' /></div>
@ -336,25 +347,25 @@
</section> </section>
"; ";
} }
echo "</div>\n"; $reply .= "</div>\n";
break; break;
case "Panel de Gerente": case "Panel de Gerente":
break; break;
default: default:
echo'<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 />';
$count = 0; $count = 0;
for($i = count($tittles)-4; $i < count($tittles); $i++){ for($i = count($tittles)-4; $i < count($tittles); $i++){
if($count%2===0){ if($count%2===0){
if($count != 0) echo " if($count != 0) $reply .= "
</div>"; </div>";
echo " $reply .= "
<div class='fila'>"; <div class='fila'>";
} }
echo " $reply .= "
<div class='zoom'> <div class='zoom'>
<div class='columna'> <div class='columna'>
<a href='".$prefix."showtimes/#".$tittles[$i]."'><div class='image'><img src='img/films/".$tittles[$i].".jpg' alt='".$tittles[$i]."' /></div></a> <a href='".$prefix."showtimes/#".$tittles[$i]."'><div class='image'><img src='img/films/".$tittles[$i].".jpg' alt='".$tittles[$i]."' /></div></a>
@ -362,7 +373,7 @@
</div>"; </div>";
$count++; $count++;
} }
echo " $reply .= "
</div> </div>
</div> </div>
</div> </div>
@ -370,7 +381,7 @@
<div class='galery'>"; <div class='galery'>";
$count = rand(0, count($tittles)-1); $count = rand(0, count($tittles)-1);
$title = str_replace('_', ' ', $tittles[$count]); $title = str_replace('_', ' ', $tittles[$count]);
echo " $reply .= "
<h1>{$title}</h1><hr /> <h1>{$title}</h1><hr />
<div class='zoom'> <div class='zoom'>
<a href='".$prefix."showtimes/#".$tittles[$count]."'><div class='image main'><img src='img/films/".$tittles[$count].".jpg' alt='".$tittles[$count]."' /></div></a> <a href='".$prefix."showtimes/#".$tittles[$count]."'><div class='image main'><img src='img/films/".$tittles[$count].".jpg' alt='".$tittles[$count]."' /></div></a>
@ -380,21 +391,23 @@
break; break;
} }
return $reply;
} }
//Print Cinemas info: //Print Cinemas info:
function print_cinemas(){ function print_cinemas(){
$reply = "";
//List of the cinemas: //List of the cinemas:
require_once(__DIR__.'/common/cinema_dao.php'); require_once(__DIR__.'/common/cinema_dao.php');
$prefix= $this->get_prefix();
$cine = new Cinema_DAO("complucine"); $cine = new Cinema_DAO("complucine");
$cinemas = $cine->allCinemaData(); $cinemas = $cine->allCinemaData();
$ids = array(); $ids = array();
$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();
@ -406,7 +419,7 @@
switch($this->page){ switch($this->page){
case "Panel de Administrador": case "Panel de Administrador":
echo "<div class='row'> $reply .= "<div class='row'>
<div class='column side'></div> <div class='column side'></div>
<div class='column middle'> <div class='column middle'>
<table class='alt'> <table class='alt'>
@ -422,7 +435,7 @@
"; ";
if(is_array($cinemas)){ if(is_array($cinemas)){
for($i = 0; $i < count($cinemas); $i++){ for($i = 0; $i < count($cinemas); $i++){
echo '<tr> $reply .= '<tr>
<td>'. $ids[$i] .'</td> <td>'. $ids[$i] .'</td>
<td>'. $names[$i] .'</td> <td>'. $names[$i] .'</td>
<td>'. $directions[$i] .'</td> <td>'. $directions[$i] .'</td>
@ -449,16 +462,19 @@
'; ';
} }
} }
echo'</tbody> $reply .='</tbody>
</table> </table>
</div> </div>
<div class="column side"></div> <div class="column side"></div>
'; ';
break; break;
default: break; default:
break;
} }
return $reply;
} }
//Print session MSG: //Print session MSG:

View File

@ -3,7 +3,7 @@
require_once('../assets/php/config.php'); require_once('../assets/php/config.php');
//Specific page content: //Specific page content:
$section = ''; $section = '';
//General page content: //General page content:
require RAIZ_APP.'/HTMLtemplate.php'; require RAIZ_APP.'/HTMLtemplate.php';

View File

@ -1,53 +1,17 @@
<?php <?php
//General Config File: //General Config File:
require_once(__DIR__.'/assets/php/config.php'); require_once(__DIR__.'/assets/php/config.php');
//Page-specific content:
$section = '<!-- Undercard -->
<section id="cartelera">
<div class="row">
<div class="code">
'.$template->print_fimls().'
</div>
</div>
</section>';
//General page content:
require RAIZ_APP.'/HTMLtemplate.php';
?> ?>
<!--
Práctica - Sistemas Web | Grupo D
CompluCine - FDI-cines
-->
<!DOCTYPE HTML>
<html lang="es">
<!-- Head -->
<?php
$template->print_head();
?>
<body>
<!-- Header -->
<?php
$template->print_header();
?>
<!-- Main -->
<main>
<div class="image"><a href='./'><img src="./img/logo_trasparente.png" alt="logo_FDI-Cines" /></a></div>
<?php
if(isset($_SESSION["nombre"])){
echo "<h1>Bienvenido {$_SESSION["nombre"]}</h1>\n";
}
else{
echo "<h1>Bienvenido a CompluCine</h1>\n";
}
?>
<hr />
</main>
<!-- Undercard -->
<section id="cartelera">
<div class="row">
<div class="code">
<?php
$template->print_fimls();
?>
</div>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>

View File

@ -2,7 +2,6 @@
//General Config File: //General Config File:
require_once('../assets/php/config.php'); require_once('../assets/php/config.php');
/*
//Page-specific content: //Page-specific content:
$section = '<!-- Films --> $section = '<!-- Films -->
<section id="films_billboard"> <section id="films_billboard">
@ -13,43 +12,4 @@
//General page content: //General page content:
require RAIZ_APP.'/HTMLtemplate.php'; require RAIZ_APP.'/HTMLtemplate.php';
*/
?> ?>
<!DOCTYPE HTML>
<!--
Práctica - 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
$template->print_fimls();
?>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>