2021-04-26 22:40:34 +02:00
|
|
|
<?php
|
|
|
|
class Panel {
|
2021-05-02 16:01:05 +02:00
|
|
|
private $state;
|
|
|
|
private $login;
|
|
|
|
|
2021-04-26 22:40:34 +02:00
|
|
|
function __construct($panel, $login){
|
|
|
|
$this->state = $panel;
|
|
|
|
$this->login= $login;
|
|
|
|
}
|
|
|
|
|
2021-05-02 16:01:05 +02:00
|
|
|
function showPanel($template) {
|
2021-04-26 22:40:34 +02:00
|
|
|
if($this->login){
|
|
|
|
switch($this->state) {
|
2021-05-02 17:25:58 +02:00
|
|
|
case 'mc': require_once('manage_cinemas.php');
|
|
|
|
if(isset($_POST['edit_cinema'])) {
|
|
|
|
editCinema();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_cinema'])) {
|
|
|
|
deleteCinema();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['add_cinema'])) {
|
|
|
|
confirmAdd();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['confirm_delete_cinema'])) {
|
|
|
|
confirmDelete();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['confirm_edit_cinema'])) {
|
|
|
|
confirmEdit();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
addCinema();
|
|
|
|
$template->print_cinemas();
|
|
|
|
|
|
|
|
};
|
|
|
|
break;
|
2021-05-02 16:01:05 +02:00
|
|
|
case 'mf': require_once('manage_films.php');
|
2021-05-05 11:57:13 +02:00
|
|
|
//echo $_SERVER['DOCUMENT_ROOT']."/../img";
|
|
|
|
echo TMP_DIR;
|
|
|
|
//echo $_SERVER['PHP_SELF'];
|
2021-05-02 17:25:58 +02:00
|
|
|
if(isset($_POST['edit_film'])) {
|
|
|
|
editFilm();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_film'])) {
|
|
|
|
deleteFilm();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['add_film'])) {
|
|
|
|
confirmAdd();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['confirm_delete_film'])) {
|
2021-05-02 17:57:23 +02:00
|
|
|
confirmDelete();
|
2021-05-02 17:25:58 +02:00
|
|
|
}
|
|
|
|
else if(isset($_POST['confirm_edit_film'])) {
|
|
|
|
confirmEdit();
|
|
|
|
}
|
|
|
|
else {
|
2021-05-02 16:01:05 +02:00
|
|
|
addFilm();
|
2021-05-02 17:25:58 +02:00
|
|
|
$template->print_fimls();
|
|
|
|
};
|
|
|
|
break;
|
2021-05-05 11:57:13 +02:00
|
|
|
case 'mp': require_once('manage_promotions.php');
|
|
|
|
if(isset($_POST['edit_promotion'])) {
|
|
|
|
editPromotion();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['delete_promotion'])) {
|
|
|
|
deletePromotion();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['add_promotion'])) {
|
|
|
|
confirmAdd();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['confirm_delete_promotion'])) {
|
|
|
|
confirmDelete();
|
|
|
|
}
|
|
|
|
else if(isset($_POST['confirm_edit_promotion'])) {
|
|
|
|
confirmEdit();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
addPromotion();
|
|
|
|
print_promotions();
|
|
|
|
|
|
|
|
};
|
|
|
|
break;
|
2021-04-26 22:40:34 +02:00
|
|
|
case 'mm': /*require_once('manage_managers.php')*/;echo"<h1>En construcción</h1>"; break;
|
|
|
|
case 'un': echo"<h1>En construcción</h1>"; break;
|
|
|
|
case 'ur': echo"<h1>En construcción</h1>";; break;
|
|
|
|
case 'ag': echo"<h1>En construcción</h1>";; break;
|
|
|
|
default: echo "<h1>BIENVENIDO AL PANEL DE ADMINISTRADOR</h1>"; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo "<h1>NO TIENES PERMISOS DE ADMINISTRADOR</h1>";
|
|
|
|
}
|
|
|
|
}
|
2021-05-02 16:01:05 +02:00
|
|
|
|
|
|
|
function getTemplate(){
|
|
|
|
return $this->template;
|
|
|
|
}
|
2021-04-26 22:40:34 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
|