SW/panel_user/index.php

58 lines
1.8 KiB
PHP
Raw Normal View History

2021-04-26 22:40:34 +02:00
<?php
//General Config File:
require_once('../assets/php/config.php');
2021-05-03 15:11:59 +02:00
//Controller file:
include_once('panelUser.php');
2021-05-03 16:51:08 +02:00
if($_SESSION["login"] && $_SESSION["rol"] === "user"){
2021-05-03 15:11:59 +02:00
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:
2021-05-03 15:18:17 +02:00
$reply = UserPanel::panel();
break;
2021-05-03 15:11:59 +02:00
}
}
else{
2021-05-03 15:18:17 +02:00
$reply = '<div class="column side"></div>
<div class="column middle">
<div class="code info">
2021-05-03 15:11:59 +02:00
<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>
2021-05-03 15:18:17 +02:00
</div>
</div>
<div class="column side"></div>'."\n";
2021-05-03 15:11:59 +02:00
}
2021-04-26 22:40:34 +02:00
2021-05-12 22:24:10 +02:00
//Specific page content:
$section = '<!-- User Panel -->
2021-05-12 15:54:13 +02:00
<section id="user_panel">
2021-04-26 22:40:34 +02:00
<div class="row">
2021-05-12 15:54:13 +02:00
<!-- Contents -->
<div class="row">
2021-05-12 22:24:10 +02:00
'.$reply.'
2021-05-12 15:54:13 +02:00
</div>
2021-04-26 22:40:34 +02:00
</div>
2021-05-12 22:24:10 +02:00
</section>';
//General page content:
require RAIZ_APP.'/HTMLtemplate.php';
?>
2021-04-26 22:40:34 +02:00