SW/panel_user/index.php

84 lines
2.3 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-10 18:15:58 +02:00
<!DOCTYPE HTML>
2021-04-26 22:40:34 +02:00
<!--
2021-05-03 21:58:47 +02:00
Práctica - Sistemas Web | Grupo D
2021-04-26 22:40:34 +02:00
CompluCine - FDI-cines
-->
<html lang="es">
<!-- Head -->
<?php
$template->print_head();
?>
<body>
<!-- Header -->
<?php
$template->print_header();
?>
<!-- Main -->
<?php
$template->print_main();
?>
<!-- Panel -->
<div class="row">
2021-04-30 20:49:21 +02:00
<!-- Panel Menu -->
<?php
2021-05-03 16:51:08 +02:00
$template->print_panelMenu($_SESSION["rol"]);
2021-04-30 20:49:21 +02:00
?>
2021-04-26 22:40:34 +02:00
<!-- Contents -->
<div class="row">
2021-05-03 15:11:59 +02:00
<?php
2021-05-09 16:46:12 +02:00
$template->print_msg();
2021-05-03 15:11:59 +02:00
echo $reply;
?>
2021-04-26 22:40:34 +02:00
</div>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>