Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-12 15:54:13 +02:00 committed by GitHub
parent 1b64bce911
commit 4339a5db1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 33 additions and 45 deletions

View File

@ -6,7 +6,7 @@
/* Headers */
h1, h2, h3, h4 {
color: #363636;
color: #d3ebff;
text-transform: uppercase;
margin: 0;
padding: 0;
@ -328,13 +328,6 @@
text-align: center;
height: 250px;
}
.code.info #register{
border: 1px solid#d3ebff;
}
.code.info #register:hover {
color: #1f2c3d;
background-color: #d3ebff;
}
.code.showtimes{
height: 600px;
}

View File

@ -327,9 +327,6 @@ main img {
text-align: center;
height: 250px;
}
.code.info #register{
border: 1px solid#d3ebff;
}
.code.showtimes{
height: 600px;
}

View File

@ -93,7 +93,7 @@
public function selectUserName($username){
$username = $this->mysqli->real_escape_string($username);
$sql = sprintf( "SELECT * FROM users WHERE name = '%s'", $username );
$sql = sprintf( "SELECT * FROM users WHERE username = '%s'", $username );
$resul = mysqli_query($this->mysqli, $sql);
return $resul;

View File

@ -209,14 +209,14 @@
if($_SESSION["rol"] === $panel){
echo"<div class='header sub'>
<div class='menu'>
<nav>";
foreach($menus as $value){
echo $value;
}
echo"</nav>
</div>
</div>\n";
<div class='menu'>
<nav>";
foreach($menus as $value){
echo $value;
}
echo"</nav>
</div>
</div>\n";
}
}
}

View File

@ -1,8 +1,6 @@
<?php
//General Config File:
require_once(__DIR__.'/assets/php/config.php');
require_once(__DIR__.'/assets/php/config.php');
?>
<!--
Práctica - Sistemas Web | Grupo D

View File

@ -1,5 +1,4 @@
<?php
/**
* USUARIOS DE PRUEBAS:
* user | userpass
@ -15,6 +14,7 @@
require('login_register_view.php');
$view = new LoginRegisterView();
$isLogin = $view->getIsLogin();
//Forms:
require('includes/formLogin.php');
require($prefix.'register/includes/formRegister.php');
@ -57,7 +57,7 @@
<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>
<button type='submit' name='register' id='_register'>Registrate</button>
</form>
</div>
</div>
@ -78,7 +78,7 @@
<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>
<button type='submit' name='login' id='_login'>Inicia Sesión</button>
</form>
</div>
</div>"."\n";

View File

@ -78,7 +78,7 @@ class FormDeleteAccount extends Form {
$bd->deleteUserAccount($user->getId());
unset($_SESSION);
session_destroy();
$result = ROUTE_APP;
} else {
$result[] = "Los datos introducidos\nno son válidos.";

View File

@ -60,19 +60,21 @@
?>
<!-- Panel -->
<div class="row">
<!-- Panel Menu -->
<?php
$template->print_panelMenu($_SESSION["rol"]);
?>
<!-- Contents -->
<section id="user_panel">
<div class="row">
<!-- Panel Menu -->
<?php
$template->print_msg();
echo $reply;
$template->print_panelMenu($_SESSION["rol"]);
?>
<!-- Contents -->
<div class="row">
<?php
$template->print_msg();
echo $reply;
?>
</div>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();

View File

@ -18,17 +18,17 @@ class FormRegister extends Form {
//Methods:
protected function generaCamposFormulario($datos, $errores = array()){
$nombre = $datos['name'] ?? '';
//$nombre = $datos['name'] ?? '';
// Se generan los mensajes de error si existen.
$htmlErroresGlobales = self::generaListaErroresGlobales($errores);
$htmlErroresGlobales2 = 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>".$htmlErroresGlobales."</pre>
<fieldset id='datos_personales'><pre>".$htmlErroresGlobales2."</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>
@ -75,7 +75,10 @@ class FormRegister extends Form {
$bd = new UserDAO('complucine');
if($bd){
$this->user = $bd->selectUserName($nombre);
if (!$this->user) {
if ($this->user->data_seek(0)) {
$result[] = "El usuario ya existe.";
}
else{
$bd->createUser("", $nombre, $email, $password, "user");
$this->user = $bd->selectUser($nombre, $password);
if ($this->user) {
@ -87,9 +90,6 @@ class FormRegister extends Form {
$result = "../register/register.php";
}
}
else{
$result[] = "El usuario ya existe.";
}
} else {
$result[] = "Error al conectar con la BD.";
}

View File

@ -36,8 +36,6 @@
<div class="code info">
<?php
echo $reply;
//$formRegister = new FormRegister();
//echo $htmlFormRegister = $formRegister->gestiona();
?>
</div>
</div>