SW/login/index.php

98 lines
3.1 KiB
PHP
Raw Normal View History

2021-04-26 22:40:34 +02:00
<?php
2021-04-30 22:23:26 +02:00
/**
* USUARIOS DE PRUEBAS:
* user | userpass
* fernando | ferpass
* manager | managerpass
* admin | adminpass
*/
2021-04-26 22:40:34 +02:00
//General Config File:
require_once('../assets/php/config.php');
//Change the view of the "Login page" to "Registration page":
require('login_register_view.php');
$view = new LoginRegisterView();
$isLogin = $view->getIsLogin();
2021-05-12 15:54:13 +02:00
2021-05-11 23:07:30 +02:00
//Forms:
require('includes/formLogin.php');
2021-05-12 10:40:22 +02:00
require($prefix.'register/includes/formRegister.php');
2021-05-11 23:07:30 +02:00
$formLogin = new FormLogin();
$htmlFormLogin = $formLogin->gestiona();
$formRegister = new FormRegister();
$htmlFormRegister = $formRegister->gestiona();
2021-04-26 22:40:34 +02:00
?>
2021-05-10 18:15:58 +02:00
<!DOCTYPE HTML>
2021-04-26 22:40:34 +02:00
<!--
2021-05-03 21:58:47 +02:00
Práctica - Sistemas Web | Grupo D
2021-04-26 22:40:34 +02:00
CompluCine - FDI-cines
-->
<html lang="es">
<!-- Head -->
<?php
$template->print_head();
?>
<body>
<!-- Header -->
<?php
$template->print_header();
?>
<!-- Main -->
2021-04-30 22:23:26 +02:00
<?php
$template->print_main();
?>
2021-04-26 22:40:34 +02:00
<!-- Login / Register -->
<section id="login_register">
<div class ="row">
<?php
if($isLogin){
2021-05-11 23:07:30 +02:00
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'>
2021-05-12 15:54:13 +02:00
<button type='submit' name='register' id='_register'>Registrate</button>
2021-05-11 23:07:30 +02:00
</form>
</div>
</div>
<div class='column right'>
<h2>Iniciar Sesión</h2>
".$htmlFormLogin."
</div>"."\n";
2021-04-26 22:40:34 +02:00
} else {
2021-05-11 23:07:30 +02:00
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'>
2021-05-12 15:54:13 +02:00
<button type='submit' name='login' id='_login'>Inicia Sesión</button>
2021-05-11 23:07:30 +02:00
</form>
</div>
</div>"."\n";
2021-04-26 22:40:34 +02:00
}
?>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>