Add files via upload
This commit is contained in:
parent
fb7f5cb42b
commit
74b79fbff1
@ -21,4 +21,9 @@
|
||||
require_once('template.php');
|
||||
$template = new Template();
|
||||
$prefix = $template->get_prefix();
|
||||
|
||||
//Depuración (BORRAR):
|
||||
//ini_set('display_errors', 1);
|
||||
//ini_set('display_startup_errors', 1);
|
||||
//error_reporting(E_ALL);
|
||||
?>
|
@ -195,10 +195,10 @@
|
||||
</li>");
|
||||
break;
|
||||
|
||||
case "user": array_push($menus, "<a href='{$prefix}'><li>Historial Compras</li></a>");
|
||||
array_push($menus, "<a href='{$prefix}'><li>Datos Pago</li></a>");
|
||||
array_push($menus, "<a href='{$prefix}'><li>Contraseña</li></a>");
|
||||
array_push($menus, "<a href='{$prefix}'><li>Eliminar Usuario</li></a>");
|
||||
case "user": array_push($menus, "<a href='./?option=manage_profile'><li>Cuenta de usuario</li></a>");
|
||||
array_push($menus, "<a href='./?option=purchases'><li>Historial Compras</li></a>");
|
||||
array_push($menus, "<a href='./?option=payment'><li>Datos Pago</li></a>");
|
||||
array_push($menus, "<a href='./?option=delete_user'><li>Eliminar Usuario</li></a>");
|
||||
break;
|
||||
|
||||
default: $menus = array(); break;
|
||||
|
3
panel_user/includes/formChagePass.php
Normal file
3
panel_user/includes/formChagePass.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
?>
|
3
panel_user/includes/formChangeEmail.php
Normal file
3
panel_user/includes/formChangeEmail.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
?>
|
3
panel_user/includes/formChangeName.php
Normal file
3
panel_user/includes/formChangeName.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
?>
|
@ -3,8 +3,39 @@
|
||||
//General Config File:
|
||||
require_once('../assets/php/config.php');
|
||||
|
||||
// IMPORTANTE:
|
||||
// VERIFICAR QUE EL USUARIO HA INICIADO SESIÓN, SI NO, MOSTRAR MENSAJE DE "ERROR"
|
||||
//Controller file:
|
||||
include_once('panelUser.php');
|
||||
|
||||
if($_SESSION["login"]){
|
||||
switch($_GET["option"]){
|
||||
case "manage_profile":
|
||||
$reply = UserPanel::manage();
|
||||
break;
|
||||
case "purchases":
|
||||
$reply = UserPanel::purchases();
|
||||
break;
|
||||
case "payment":
|
||||
$reply = UserPanel::payment();
|
||||
break;
|
||||
case "delete_user";
|
||||
$reply = UserPanel::delete();
|
||||
break;
|
||||
default:
|
||||
$reply = '<div class="code info">
|
||||
<h1>Bienvenido al Panel de Usuario.</h1><hr />
|
||||
</div>'."\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$reply = '<div class="code info">
|
||||
<h1>Debes iniciar sesión para ver tu Panel de Usuario.</h1><hr />
|
||||
<p>Inicia Sesión si estás registrado.</p>
|
||||
<a href="'.$prefix.'login/"><button>Iniciar Sesión</button></a>
|
||||
<p>Registrate si no lo habías hecho previamente.</p>
|
||||
<form method="post" action="'.$prefix.'login/"><button name="register" id="register">Registro</button></form>
|
||||
</div>'."\n";
|
||||
}
|
||||
?>
|
||||
<!--
|
||||
Práctica 2 - Sistemas Web | Grupo D
|
||||
@ -34,14 +65,9 @@
|
||||
?>
|
||||
<!-- Contents -->
|
||||
<div class="row">
|
||||
<div class="column side"></div>
|
||||
<div class="column middle">
|
||||
<h2>AQUÍ EL CONTENIDO DE CADA FUNCIONALIDAD.</h2>
|
||||
<p>Debe variar dinámicamente según el botón del panel izquierdo que se pulse (sin cargar una página diferente, aunque tendrá que recargar el contido, eso sí).</p>
|
||||
<p>Tendréis que rehacer todo el "PANEL" con PHP.</p>
|
||||
</div>
|
||||
<div class="column side"></div>
|
||||
</div>
|
||||
<?php
|
||||
echo $reply;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
|
104
panel_user/panelUser.php
Normal file
104
panel_user/panelUser.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
class UserPanel {
|
||||
//Atributes:
|
||||
|
||||
//Constructor:
|
||||
function __construct(){}
|
||||
|
||||
//Methods:
|
||||
|
||||
//Manage the user account.
|
||||
static function manage(){
|
||||
return $reply = '<div class="column side">
|
||||
<h2>Cambiar nombre de usuario</h2>
|
||||
<form method="post" action="./includes/formChangeName.php">
|
||||
<div class="row">
|
||||
<fieldset id="nombre_usuario">
|
||||
<legend>Nuevo Nombre de usuario</legend>
|
||||
<div class="_new_name">
|
||||
<input type="text" name="new_name" id="new_name" value="" placeholder="Nuevo Nombre" required/>
|
||||
</div>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="pass" id="pass" value="" placeholder="Contraseña" required/>
|
||||
</div>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="repass" id="repass" value="" placeholder="Repita la contraseña" required/>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="actions">
|
||||
<input type="submit" id="submit" value="Cambiar Nombre de Usuario" class="primary" />
|
||||
<input type="reset" id="reset" value="Borrar" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="column side">
|
||||
<h2>Cambiar contraseña</h2>
|
||||
<form method="post" action="./includes/formChangePass.php">
|
||||
<div class="row">
|
||||
<fieldset id="contraseña_usuario">
|
||||
<legend>Contraseña Actual</legend>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="old_pass" id="old_pass" value="" placeholder="Contraseña Actual" required/>
|
||||
</div>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="pass" id="pass" value="" placeholder="Nueva Contraseña" required/>
|
||||
</div>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="repass" id="repass" value="" placeholder="Repita la nueva contraseña" required/>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="actions">
|
||||
<input type="submit" id="submit" value="Cambiar Contraseña" class="primary" />
|
||||
<input type="reset" id="reset" value="Borrar" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="column side">
|
||||
<h2>Cambiar email de usuario</h2>
|
||||
<form method="post" action="./includes/formChangeEmail.php">
|
||||
<div class="row">
|
||||
<fieldset id="email_usuario">
|
||||
<legend>Nuevo email de usuario</legend>
|
||||
<div class="_new_email">
|
||||
<input type="text" name="new_email" id="new_email" value="" placeholder="Nuevo Email" required/>
|
||||
</div>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="pass" id="pass" value="" placeholder="Contraseña" required/>
|
||||
</div>
|
||||
<div class="_passwd">
|
||||
<input type="password" name="repass" id="repass" value="" placeholder="Repita la contraseña" required/>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="actions">
|
||||
<input type="submit" id="submit" value="Cambiar Nombre de Usuario" class="primary" />
|
||||
<input type="reset" id="reset" value="Borrar" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>'."\n";
|
||||
}
|
||||
|
||||
//User purchase history.
|
||||
static function purchases(){
|
||||
return $reply = '<div class="code info">
|
||||
<h2>Aquí el historial de compras</h2><hr />
|
||||
</div>'."\n";
|
||||
}
|
||||
|
||||
//User payment details
|
||||
static function payment(){
|
||||
return $reply = '<div class="code info">
|
||||
<h2>Aquí los datos de pago</h2><hr />
|
||||
</div>'."\n";
|
||||
}
|
||||
|
||||
//Delete user account.
|
||||
static function delete(){
|
||||
return $reply = '<div class="code info">
|
||||
<h2>Aquí el formulario para eliminar cuenta</h2><hr />
|
||||
</div>'."\n";
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in New Issue
Block a user