2021-05-17 15:29:29 +02:00
|
|
|
<?php
|
|
|
|
//General Config File:
|
|
|
|
include_once('../assets/php/config.php');
|
|
|
|
|
|
|
|
require_once($prefix.'panel_admin/panelAdmin.php');
|
|
|
|
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
if(($_SESSION["login"]) && $_SESSION["rol"] == "admin"){
|
|
|
|
if(!isset($_GET["state"]))
|
|
|
|
$_GET["state"] =null;
|
|
|
|
switch($_GET["state"]){
|
2021-06-08 13:45:44 +02:00
|
|
|
case 'mc': if(isset($_POST['edit_cinema']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::editCinema();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(isset($_POST['delete_cinema']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::deleteCinema();
|
|
|
|
}
|
|
|
|
else {
|
2021-06-01 17:46:11 +02:00
|
|
|
if(isset($_GET["cinema"])){
|
2021-06-02 13:06:50 +02:00
|
|
|
if(isset($_GET["cinema"])){
|
|
|
|
if(isset($_GET["number"])) {
|
|
|
|
$reply = AdminPanel::showSessions($_GET["cinema"]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$reply = AdminPanel::showHalls($_GET["cinema"]);
|
|
|
|
}
|
|
|
|
}
|
2021-06-01 17:46:11 +02:00
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(!isset($_GET['option']) || ($_GET['option'] == 'a')) {
|
2021-06-01 17:46:11 +02:00
|
|
|
$reply=AdminPanel::addCinema();
|
|
|
|
$reply.= ($template->print_cinemas());
|
2021-06-08 13:45:44 +02:00
|
|
|
}}; break;
|
|
|
|
case 'mf': if(isset($_POST['edit_film']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::editFilm();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(isset($_POST['delete_film']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::deleteFilm();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(!isset($_GET['option']) || ($_GET['option'] == 'a')) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::addFilm();
|
|
|
|
$reply.= $template->print_fimls();
|
2021-06-08 13:45:44 +02:00
|
|
|
};
|
2021-05-20 10:45:10 +02:00
|
|
|
break;
|
|
|
|
case 'mp':
|
2021-06-08 13:45:44 +02:00
|
|
|
if(isset($_POST['edit_promotion']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::editPromotion();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(isset($_POST['delete_promotion']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::deletePromotion();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(!isset($_GET['option']) || ($_GET['option'] == 'a')) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::addPromotion();
|
|
|
|
$reply.=AdminPanel::print_promotions();
|
|
|
|
};
|
|
|
|
break;
|
2021-06-08 13:45:44 +02:00
|
|
|
case 'mg': if(isset($_POST['edit_manager']) || (isset($_GET['option']) && ($_GET['option'] == 'e'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::editManager();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(isset($_POST['delete_manager']) || (isset($_GET['option']) && ($_GET['option'] == 'd'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::deleteManager();
|
|
|
|
}
|
2021-06-08 13:45:44 +02:00
|
|
|
else if(isset($_POST['add_manager']) || (isset($_GET['option']) && ($_GET['option'] == 'a'))) {
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply=AdminPanel::addManager();
|
|
|
|
}
|
2021-06-02 13:06:50 +02:00
|
|
|
else {
|
|
|
|
$reply=AdminPanel::print_managers();
|
|
|
|
$reply.=AdminPanel::showAddBotton();
|
2021-05-20 10:45:10 +02:00
|
|
|
};
|
|
|
|
break;
|
|
|
|
case 'un':
|
2021-06-02 12:17:18 +02:00
|
|
|
$reply=AdminPanel::see_like_user();
|
2021-05-20 10:45:10 +02:00
|
|
|
break;
|
|
|
|
case 'ur':
|
2021-06-02 12:17:18 +02:00
|
|
|
$reply=AdminPanel::see_like_registed_user();
|
2021-05-20 10:45:10 +02:00
|
|
|
break;
|
|
|
|
case 'ag':
|
2021-06-02 12:17:18 +02:00
|
|
|
$reply=AdminPanel::see_like_manager();
|
2021-05-20 10:45:10 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$reply=AdminPanel:: panel();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$reply ='<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<div class="code info">
|
|
|
|
<h1>No tienes permiso de administrador.</h1><hr />
|
|
|
|
<p>Inicia Sesión con una cuenta de administtación.</p>
|
|
|
|
<a href="'.$prefix.'login/"><button>Iniciar Sesión</button></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$section = '<!-- Manager Admin -->
|
|
|
|
<section id="admin_panel">
|
|
|
|
<!-- Contents -->
|
|
|
|
<div class="row">
|
|
|
|
'.$reply.'
|
|
|
|
</div>
|
|
|
|
</section>';
|
2021-05-17 15:29:29 +02:00
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
require RAIZ_APP.'/HTMLtemplate.php';
|
|
|
|
|
|
|
|
?>
|