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"]){
|
|
|
|
case 'mc': if(isset($_POST['edit_cinema'])) {
|
|
|
|
$reply=AdminPanel::editCinema();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_cinema'])) {
|
|
|
|
$reply=AdminPanel::deleteCinema();
|
|
|
|
}
|
|
|
|
else {
|
2021-06-01 17:46:11 +02:00
|
|
|
if(isset($_GET["cinema"])){
|
|
|
|
// $reply = AdminPanel::showHalls($_GET["cinema"]);
|
|
|
|
/* if(isset($_GET["number"])) {
|
|
|
|
$reply = AdminPanel::showHalls($_GET["cinema"], $_GET["number"]);
|
|
|
|
}
|
|
|
|
else { */
|
|
|
|
$reply = AdminPanel::showHalls($_GET["cinema"]);
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$reply=AdminPanel::addCinema();
|
|
|
|
$reply.= ($template->print_cinemas());
|
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
};
|
|
|
|
break;
|
|
|
|
case 'mf': if(isset($_POST['edit_film'])) {
|
|
|
|
$reply=AdminPanel::editFilm();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_film'])) {
|
|
|
|
$reply=AdminPanel::deleteFilm();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$reply=AdminPanel::addFilm();
|
|
|
|
$reply.= $template->print_fimls();
|
|
|
|
};
|
|
|
|
break;
|
|
|
|
case 'mp':
|
|
|
|
if(isset($_POST['edit_promotion'])) {
|
|
|
|
$reply=AdminPanel::editPromotion();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_promotion'])) {
|
|
|
|
$reply=AdminPanel::deletePromotion();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$reply=AdminPanel::addPromotion();
|
|
|
|
$reply.=AdminPanel::print_promotions();
|
|
|
|
|
|
|
|
};
|
|
|
|
break;
|
|
|
|
case 'mg': if(isset($_POST['edit_manager'])) {
|
|
|
|
$reply=AdminPanel::editManager();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_manager'])) {
|
|
|
|
$reply=AdminPanel::deleteManager();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['add_manager'])) {
|
|
|
|
$reply=AdminPanel::addManager();
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
$reply=AdminPanel::showAddBotton();
|
|
|
|
$reply.=AdminPanel::print_managers();
|
|
|
|
};
|
|
|
|
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';
|
|
|
|
|
|
|
|
?>
|