Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-12 22:24:10 +02:00 committed by GitHub
parent da7bdacbaa
commit 231e72f17a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 284 additions and 351 deletions

View File

@ -0,0 +1,33 @@
<!--
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 -->
<?php
$template->print_main();
?>
<!-- Section -->
<?php
$template->print_section($section);
?>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>

View File

@ -46,4 +46,9 @@
* @see http://php.net/manual/en/language.types.callable.php
*/
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

@ -5,13 +5,13 @@
//private const _NUMPAGES = 10; //Constant to page results.
//Attributes:
public $page; //Page Name.
public $prefix; //Page prefix.
private $page; //Page Name.
private $prefix; //Page prefix.
public $session; //"Iniciar Sesión" (if user isn´t logged in), "Cerrar Sesión" (otherwise).
public $session_route; //"login/" (if user isn´t logged in), "logout/" (otherwise).
public $panel; //Button to access the user's dashboard (only displayed if logged in).
public $user_route; //Route of the panel (depends on the type of user).
private $session; //"Iniciar Sesión" (if user isn´t logged in), "Cerrar Sesión" (otherwise).
private $session_route; //"login/" (if user isn´t logged in), "logout/" (otherwise).
private $panel; //Button to access the user's dashboard (only displayed if logged in).
private $user_route; //Route of the panel (depends on the type of user).
//Constructor:
function __construct(){
@ -216,11 +216,26 @@
}
echo"</nav>
</div>
</div>\n";
</div>
";
}
}
}
//Print specific page content:
function print_section($section){
/* Panel menu */
$sub_header = '';
if(strpos($_SERVER['PHP_SELF'], 'panel')){
echo "<!-- Panel Menu -->
";
$this->print_panelMenu($_SESSION["rol"]);
$this->print_msg();
}
echo $section;
}
//Print Films Cards:
function print_fimls(){
//List of the movies:
@ -472,7 +487,7 @@
<a href='{$prefix}fdicines/terms_conditions/'>Términos de uso</a> |
<a href='{$prefix}cinemas/'>Nuestros cines</a> |
<a href='{$prefix}contacto/'>Contacto</a> |
<button onclick=\"cambiarCSS('{$css}')\">$nameCSS</button>
<button onclick=\"cambiarCSS('$css');\">$nameCSS</button>
</footer>\n";
echo"

View File

@ -1,33 +1,10 @@
<?php
//General Config File:
require_once('../assets/php/config.php');
//Specific page content:
$section = '';
//General page content:
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();
?>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>

View File

@ -0,0 +1,88 @@
<?php
require_once($prefix.'assets/php/form.php');
class FormContact extends Form {
//Constants:
const HTML5_EMAIL_REGEXP = '^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$';
public function __construct() {
$options = array("action" => "");
parent::__construct('formContact', $options);
}
protected function generaCamposFormulario($datos, $errores = array()) {
// Se generan los mensajes de error si existen.
$htmlErroresGlobales = self::generaListaErroresGlobales($errores);
$errorNombre = self::createMensajeError($errores, 'name', 'span', array('class' => 'error'));
$errorEmail = self::createMensajeError($errores, 'email', 'span', array('class' => 'error'));
$errorMessage = self::createMensajeError($errores, 'message', 'span', array('class' => 'error'));
// Se genera el HTML asociado a los campos del formulario y los mensajes de error.
$html = "<div class='row'>
<fieldset id='datos_personales'>
<legend>Datos personales</legend><pre>".$htmlErroresGlobales."</pre>
<div class='_name'>
<input type='text' name='name' id='name' value='' placeholder='Nombre' required/><pre>".$errorNombre."</pre>
</div>
<div class='_email'>
<input type='email' name='email' id='email' value='' placeholder='Email' required/><pre>".$errorEmail."</pre>
</div>
</fieldset>
<fieldset id='motivo'>
<legend>Motivo de la consulta</legend>
<div class='reason'>
<input type='radio' id='radio' name='reason' value='evaluation' checked>
<label for='evaluation'>Evaluación</label>
</div>
<div class='reason'>
<input type='radio' id='radio' name='reason' value='sugestions'>
<label for='sugestions'>Sugerencias</label>
</div>
<div class='reason'>
<input type='radio' id='radio' name='reason' value='critics'>
<label for='critics'>Críticas</label>
</div>
</fieldset>
<div class='message'><pre>".$errorMessage."</pre>
<textarea name='message' id='message' placeholder='Escribe aquí tu mensaje...'></textarea>
</div>
<div class='verify'>
<input type='checkbox' id='checkbox' name='terms' required>
<label for='terms'>Marque esta casilla para verificar que ha leído nuestros términos y condiciones del servicio.</label>
</div>
<div class='actions'>
<input type='submit' id='submit' value='Enviar mensaje' class='primary' />
<input type='reset' id='reset' value='Borrar' />
</div>
</div>";
return $html;
}
protected function procesaFormulario($datos) {
$result = array();
$nombre = $this->test_input($datos['name']) ?? null;
if ( empty($nombre) || mb_strlen($nombre) < 3 || mb_strlen($nombre) > 8 ) {
$result['name'] = "El nombre tiene que tener\n una longitud de más de\n 3 caracteres\n y menos de 8 caracteres.";
}
$email = $this->test_input($datos['email']) ?? null;
if ( empty($email) || !mb_ereg_match(self::HTML5_EMAIL_REGEXP, $email) ) {
$result['email'] = "El email no es válido.";
}
$message = $this->test_input($datos['message']) ?? null;
if ( empty($message) || mb_strlen($message) < 1 || mb_strlen($message) > 250 ) {
$result['message'] = "El mensaje no puede estar vacío\ny no puede contener más de\n250 caracteres.";
}
if (count($result) === 0) {
$result = ROUTE_APP;
}
return $result;
}
}

View File

@ -1,77 +1,19 @@
<?php
//General Config File:
require_once('../assets/php/config.php');
//Contact form:
require_once('includes/formContact.php');
$form = new FormContact();
$htmlForm = $form->gestiona();
//Specific page content:
$section = '<!-- Contact Form -->
<section id="formulario">
<h4>Formulario (EN DESARROLLO)</h4>
'.$htmlForm.'
</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 -->
<?php
$template->print_main();
?>
<!-- Form -->
<section id="formulario">
<h4>Formulario</h4>
<form method="post" action="mailto:fernmend@ucm.es">
<div class="row">
<fieldset id="datos_personales">
<legend>Datos personales</legend>
<div class="_name">
<input type="text" name="name" id="name" value="" placeholder="Nombre" required/>
</div>
<div class="_email">
<input type="email" name="email" id="email" value="" placeholder="Email" required/>
</div>
</fieldset>
<fieldset id="motivo">
<legend>Motivo de la consulta</legend>
<div class="reason">
<input type="radio" id="radio" name="reason" value="evaluation" checked>
<label for="evaluation">Evaluación</label>
</div>
<div class="reason">
<input type="radio" id="radio" name="reason" value="sugestions">
<label for="sugestions">Sugerencias</label>
</div>
<div class="reason">
<input type="radio" id="radio" name="reason" value="critics">
<label for="critics">Críticas</label>
</div>
</fieldset>
<div class="message">
<textarea name="message" id="message" placeholder="Escribe aquí tu mensaje..."></textarea> <!-- rows="5" -->
</div>
<div class="verify">
<input type="checkbox" id="checkbox" name="terms" required>
<label for="terms">Marque esta casilla para verificar que ha leído nuestros términos y condiciones del servicio.</label>
</div>
<div class="actions">
<input type="submit" id="submit" value="Enviar mensaje" class="primary" />
<input type="reset" id="reset" value="Borrar" />
</div>
</div>
</form>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>

View File

@ -22,76 +22,51 @@
$htmlFormLogin = $formLogin->gestiona();
$formRegister = new FormRegister();
$htmlFormRegister = $formRegister->gestiona();
?>
<!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();
?>
<!-- Login / Register -->
<section id="login_register">
<div class ="row">
<?php
if($isLogin){
echo "<!-- Login -->
<div class='column left'>
<div class='code info'>
<h2>¿No tienes una cuenta?</h2>
<hr />
<p>Para crear una cuenta de usuario es necesario haber rellenado el formulario de registro previamente</p>
<p>Haz click en el botón para registrate.</p>
<form method='post'>
<button type='submit' name='register' id='_register'>Registrate</button>
</form>
</div>
</div>
<div class='column right'>
<h2>Iniciar Sesión</h2>
".$htmlFormLogin."
</div>"."\n";
} else {
echo "<!-- Register -->
<div class='column left'>
<h2>Registro</h2>
".$htmlFormRegister."
</div>
<div class='column right'>
<div class='code info'>
<h2>¿Ya estás registrado?</h2>
<hr />
<p>Si dispones de una cuenta de usuario, no es necesario que rellenes este formulario nuevamente</p>
<p>Haz click en el botón para iniciar sesión.</p>
<form method='post'>
<button type='submit' name='login' id='_login'>Inicia Sesión</button>
</form>
</div>
</div>"."\n";
}
?>
if($isLogin){
$form = "<!-- Login -->
<div class='column left'>
<div class='code info'>
<h2>¿No tienes una cuenta?</h2>
<hr />
<p>Para crear una cuenta de usuario es necesario haber rellenado el formulario de registro previamente</p>
<p>Haz click en el botón para registrate.</p>
<form method='post'>
<button type='submit' name='register' id='_register'>Registrate</button>
</form>
</div>
</section>
</div>
<div class='column right'>
<h2>Iniciar Sesión</h2>
".$htmlFormLogin."
</div>"."\n";
} else {
$form = "<!-- Register -->
<div class='column left'>
<h2>Registro</h2>
".$htmlFormRegister."
</div>
<div class='column right'>
<div class='code info'>
<h2>¿Ya estás registrado?</h2>
<hr />
<p>Si dispones de una cuenta de usuario, no es necesario que rellenes este formulario nuevamente</p>
<p>Haz click en el botón para iniciar sesión.</p>
<form method='post'>
<button type='submit' name='login' id='_login'>Inicia Sesión</button>
</form>
</div>
</div>"."\n";
}
<!-- Footer -->
<?php
$template->print_footer();
?>
//Specific page content:
$section = '<!-- Login / Register -->
<section id="login_register">
<div class ="row">
'.$form.'
</div>
</section>';
</body>
</html>
//General page content:
require RAIZ_APP.'/HTMLtemplate.php';
?>

View File

@ -6,48 +6,20 @@
require_once('./includes/formLogin.php');
$reply = FormLogin::getReply();
//Specific page content:
$section = '<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
'.$reply.'
</div>
</div>
<div class="column side"></div>
</div>';
//General page content:
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();
?>
<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
<?php
echo $reply;
?>
</div>
</div>
<div class="column side"></div>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>

View File

@ -19,49 +19,21 @@
Haz clic <a href='{$prefix}'>aquí</a> si tu navegador no te redirige automáticamente.</p>\n";
}
//Specific page content:
$section = '<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
'.$reply.'
</div>
</div>
<div class="column side"></div>
</div>
</section>';
//General page content:
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();
?>
<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
<?php
echo $reply;
?>
</div>
</div>
<div class="column side"></div>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>

View File

@ -36,7 +36,6 @@ class FormChangeEmail extends Form {
return $html;
}
/* TODO */
protected function procesaFormulario($datos){
$result = array();

View File

@ -37,49 +37,21 @@
</div>
<div class="column side"></div>'."\n";
}
?>
<!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();
?>
<!-- Panel -->
//Specific page content:
$section = '<!-- User Panel -->
<section id="user_panel">
<div class="row">
<!-- Panel Menu -->
<?php
$template->print_panelMenu($_SESSION["rol"]);
?>
<!-- Contents -->
<div class="row">
<?php
$template->print_msg();
echo $reply;
?>
'.$reply.'
</div>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</section>';
</body>
//General page content:
require RAIZ_APP.'/HTMLtemplate.php';
?>
</html>

View File

@ -21,14 +21,14 @@ class FormRegister extends Form {
//$nombre = $datos['name'] ?? '';
// Se generan los mensajes de error si existen.
$htmlErroresGlobales2 = self::generaListaErroresGlobales($errores);
$htmlErroresGlobales = self::generaListaErroresGlobales($errores);
$errorNombre = self::createMensajeError($errores, 'name', 'span', array('class' => 'error'));
$errorEmail = self::createMensajeError($errores, 'email', 'span', array('class' => 'error'));
$errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error'));
$errorPassword2 = self::createMensajeError($errores, 'repass', 'span', array('class' => 'error'));
$html = "<div class='row'>
<fieldset id='datos_personales'><pre>".$htmlErroresGlobales2."</pre>
<fieldset id='datos_personales'><pre>".$htmlErroresGlobales."</pre>
<legend>Datos personales</legend>
<input type='text' name='name' id='name' value='' placeholder='Nombre' required/><pre>".$errorNombre."</pre>
<input type='email' name='email' id='email' value='' placeholder='Email' required/><pre>".$errorEmail."</pre>
@ -114,7 +114,7 @@ class FormRegister extends Form {
<p>Ha ocurrido un problema y no hemos podido completar el registro</p>
<p>Vuelve a intetarlo o inicia sesión si tienes una cuenta de usuario.</p>
<a href='../login/'><button>Iniciar Sesión</button></a>
<form method='post' action='../login/'><button name='register' id='register'>Registro</button></form>\n";
<form method='post' action='../login/'><button name='register' id='_register'>Registro</button></form>\n";
}
return $reply;

View File

@ -6,48 +6,18 @@
require_once('./includes/formRegister.php');
$reply = FormRegister::getReply();
?>
<!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();
?>
<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
<?php
echo $reply;
?>
</div>
$section = '<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
'.$reply.'
</div>
<div class="column side"></div>
</div>
</section>
<div class="column side"></div>
</div>
</section>';
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>
require RAIZ_APP.'/HTMLtemplate.php';
?>

View File

@ -1,6 +1,19 @@
<?php
//General Config File:
require_once('../assets/php/config.php');
/*
//Page-specific content:
$section = '<!-- Films -->
<section id="films_billboard">
<div class="row">
'.$template->print_fimls().'
</div>
</section>';
//General page content:
require RAIZ_APP.'/HTMLtemplate.php';
*/
?>
<!DOCTYPE HTML>
<!--