2021-05-17 15:29:29 +02:00
|
|
|
<?php
|
|
|
|
//General Config File:
|
|
|
|
require_once('../assets/php/config.php');
|
|
|
|
|
|
|
|
//Controller file:
|
|
|
|
include_once('panelUser.php');
|
|
|
|
|
|
|
|
if($_SESSION["login"] && $_SESSION["rol"] === "user"){
|
|
|
|
if(!isset($_GET["option"])) $_GET["option"] = null;
|
|
|
|
switch($_GET["option"]){
|
2021-05-23 16:23:25 +02:00
|
|
|
case "change_profile_pic":
|
|
|
|
$reply = UserPanel::changeUserPic();
|
2021-05-17 15:29:29 +02:00
|
|
|
break;
|
|
|
|
case "purchases":
|
|
|
|
$reply = UserPanel::purchases();
|
|
|
|
break;
|
|
|
|
case "payment":
|
|
|
|
$reply = UserPanel::payment();
|
|
|
|
break;
|
|
|
|
case "delete_user";
|
|
|
|
$reply = UserPanel::delete();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$reply = UserPanel::panel();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$reply = '<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<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>
|
2021-05-18 09:20:24 +02:00
|
|
|
<form method="post" action="'.$prefix.'login/"><button name="register" id="_register">Registro</button></form>
|
2021-05-17 15:29:29 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Specific page content:
|
|
|
|
$section = '<!-- User Panel -->
|
|
|
|
<section id="user_panel">
|
|
|
|
<div class="row">
|
|
|
|
<!-- Contents -->
|
|
|
|
<div class="row">
|
|
|
|
'.$reply.'
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
';
|
|
|
|
|
|
|
|
//General page content:
|
|
|
|
require RAIZ_APP.'/HTMLtemplate.php';
|
|
|
|
|
|
|
|
?>
|
|
|
|
|