From 74b79fbff176b9ba22b13b02d30e8f4a074f1a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Mon, 3 May 2021 15:11:59 +0200 Subject: [PATCH] Add files via upload --- assets/php/config.php | 5 ++ assets/php/template.php | 8 +- panel_user/includes/formChagePass.php | 3 + panel_user/includes/formChangeEmail.php | 3 + panel_user/includes/formChangeName.php | 3 + panel_user/index.php | 46 ++++++++--- panel_user/panelUser.php | 104 ++++++++++++++++++++++++ 7 files changed, 158 insertions(+), 14 deletions(-) create mode 100644 panel_user/includes/formChagePass.php create mode 100644 panel_user/includes/formChangeEmail.php create mode 100644 panel_user/includes/formChangeName.php create mode 100644 panel_user/panelUser.php diff --git a/assets/php/config.php b/assets/php/config.php index 5e945e6..fc77f87 100644 --- a/assets/php/config.php +++ b/assets/php/config.php @@ -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); ?> \ No newline at end of file diff --git a/assets/php/template.php b/assets/php/template.php index e2ed2b5..959fab5 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -195,10 +195,10 @@ "); break; - case "user": array_push($menus, "
  • Historial Compras
  • "); - array_push($menus, "
  • Datos Pago
  • "); - array_push($menus, "
  • Contraseña
  • "); - array_push($menus, "
  • Eliminar Usuario
  • "); + case "user": array_push($menus, "
  • Cuenta de usuario
  • "); + array_push($menus, "
  • Historial Compras
  • "); + array_push($menus, "
  • Datos Pago
  • "); + array_push($menus, "
  • Eliminar Usuario
  • "); break; default: $menus = array(); break; diff --git a/panel_user/includes/formChagePass.php b/panel_user/includes/formChagePass.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/panel_user/includes/formChagePass.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/panel_user/includes/formChangeEmail.php b/panel_user/includes/formChangeEmail.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/panel_user/includes/formChangeEmail.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/panel_user/includes/formChangeName.php b/panel_user/includes/formChangeName.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/panel_user/includes/formChangeName.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/panel_user/index.php b/panel_user/index.php index fb2b397..5d8af39 100644 --- a/panel_user/index.php +++ b/panel_user/index.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 = '
    +

    Bienvenido al Panel de Usuario.


    +
    '."\n"; + break; + } + } + else{ + $reply = '
    +

    Debes iniciar sesión para ver tu Panel de Usuario.


    +

    Inicia Sesión si estás registrado.

    + +

    Registrate si no lo habías hecho previamente.

    +
    +
    '."\n"; + } ?>
    -
    -
    -

    AQUÍ EL CONTENIDO DE CADA FUNCIONALIDAD.

    -

    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í).

    -

    Tendréis que rehacer todo el "PANEL" con PHP.

    -
    -
    -
    + diff --git a/panel_user/panelUser.php b/panel_user/panelUser.php new file mode 100644 index 0000000..0e78047 --- /dev/null +++ b/panel_user/panelUser.php @@ -0,0 +1,104 @@ + +

    Cambiar nombre de usuario

    +
    +
    +
    + Nuevo Nombre de usuario +
    + +
    +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    + +
    +

    Cambiar contraseña

    +
    +
    +
    + Contraseña Actual +
    + +
    +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +

    Cambiar email de usuario

    +
    +
    +
    + Nuevo email de usuario +
    + +
    +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    '."\n"; + } + + //User purchase history. + static function purchases(){ + return $reply = '
    +

    Aquí el historial de compras


    +
    '."\n"; + } + + //User payment details + static function payment(){ + return $reply = '
    +

    Aquí los datos de pago


    +
    '."\n"; + } + + //Delete user account. + static function delete(){ + return $reply = '
    +

    Aquí el formulario para eliminar cuenta


    +
    '."\n"; + } + } +?> \ No newline at end of file