2021-05-17 15:29:29 +02:00
|
|
|
<?php
|
2021-05-18 09:20:24 +02:00
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
class AdminPanel {
|
2021-05-17 15:29:29 +02:00
|
|
|
private $state;
|
|
|
|
private $login;
|
|
|
|
private $prefix;
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
function __construct(){}
|
2021-05-17 15:29:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
function getTemplate(){
|
|
|
|
return $this->template;
|
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function panel(){
|
2021-06-02 09:36:59 +02:00
|
|
|
include_once('../assets/php/includes/user.php');
|
|
|
|
|
|
|
|
$name = strtoupper(unserialize($_SESSION['user'])->getName());
|
|
|
|
$email = unserialize($_SESSION['user'])->getEmail();
|
|
|
|
$userPic = USER_PICS.strtolower($name).".jpg";
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<div class="code info">
|
|
|
|
<h1>Bienvenido al Panel de Administrador.</h1>
|
|
|
|
<hr />
|
2021-06-02 09:36:59 +02:00
|
|
|
<img src='.$userPic.' alt="user_profile_picture"/>
|
|
|
|
<h3>'.strftime("%A %e de %B de %Y | %H:%M").'</h3>
|
|
|
|
<p>Administrador: '.$name.'</p>
|
|
|
|
<p>Email empresarial: '.$email.'</p>
|
2021-05-20 10:45:10 +02:00
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
2021-05-17 15:29:29 +02:00
|
|
|
//Functions FILMS
|
2021-05-20 10:45:10 +02:00
|
|
|
static function addFilm(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formAddFilm.php');
|
|
|
|
$formAF = new formAddFilm();
|
|
|
|
$htmlAForm = $formAF->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- Add film -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
2021-05-21 09:27:06 +02:00
|
|
|
'.$htmlAForm."\n";
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function deleteFilm() {
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formDeleteFilm.php');
|
|
|
|
$formDF = new formDeleteFilm();
|
|
|
|
$htmlDForm = $formDF->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- Add film -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
'.$htmlDForm.'
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
|
|
|
|
static function editFilm() {
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formEditFilm.php');
|
|
|
|
$formEF = new formEditFilm();
|
|
|
|
$htmlDForm = $formEF->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- Add film -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
'.$htmlDForm.'
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
//Functions Cinemas
|
2021-05-20 10:45:10 +02:00
|
|
|
static function addCinema(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formAddCinema.php');
|
|
|
|
$formAC = new formAddCinema();
|
|
|
|
$htmlAForm = $formAC->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- Add cinema -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
'.$htmlAForm.'
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function deleteCinema() {
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formDeleteCinema.php');
|
|
|
|
$formDC = new formDeleteCinema();
|
|
|
|
$htmlDForm = $formDC->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- Delete cinema -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
'.$htmlDForm.'
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function editCinema() {
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formEditCinema.php');
|
|
|
|
$formEC = new formEditCinema();
|
|
|
|
$htmlDForm = $formEC->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- Edit cinema -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
'.$htmlDForm.'
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
2021-06-01 17:46:11 +02:00
|
|
|
static function showHalls($idCinema) {
|
|
|
|
include_once('../assets/php/includes/hall.php');
|
|
|
|
include_once('../assets/php/includes/hall_dao.php');
|
|
|
|
$panel = '<div class="column side"></div>
|
|
|
|
<div class="column middle">';
|
|
|
|
$listhall = Hall::getListHalls($idCinema);
|
|
|
|
if(!$listhall){
|
|
|
|
$panel .= "<h2> No hay ninguna sala en este cine";
|
|
|
|
}else{
|
|
|
|
$panel .= '
|
|
|
|
<div class="row">
|
|
|
|
<ul class="tablelist col3">
|
|
|
|
<li class="title"> Sala </li>
|
|
|
|
<li class="title"> Asientos </li>
|
|
|
|
<li class="title"> Sesión </li>
|
|
|
|
';
|
|
|
|
$parity = "odd";
|
|
|
|
foreach($listhall as $hall){
|
|
|
|
$panel .='<div class="'.$parity.'">
|
|
|
|
<li> '. $hall->getNumber().'</li>
|
|
|
|
<li> '.$hall->getTotalSeats().' </li>
|
|
|
|
</a>
|
2021-06-02 13:06:50 +02:00
|
|
|
<a href="?state=mc&cinema='.$idCinema.'&number=1">
|
2021-06-01 17:46:11 +02:00
|
|
|
<li> Sesiones </li>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
';
|
|
|
|
$parity = ($parity == "odd") ? "even" : "odd";
|
|
|
|
}
|
|
|
|
$panel.='
|
|
|
|
</ul>';
|
|
|
|
}
|
|
|
|
$panel.='
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>';
|
|
|
|
return $panel;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-06-02 13:06:50 +02:00
|
|
|
static function showSessions($idCinema){
|
|
|
|
include_once('../assets/php/includes/hall.php');
|
|
|
|
include_once('../assets/php/includes/hall_dao.php');
|
|
|
|
include_once('../assets/php/includes/session_dao.php');
|
|
|
|
include_once('../assets/php/includes/session.php');
|
|
|
|
//Base filtering values
|
|
|
|
$date = $_POST['date'] ?? $_GET['date'] ?? date("Y-m-d");
|
|
|
|
$hall = $_POST['hall'] ?? $_GET['hall'] ?? "1";
|
|
|
|
|
|
|
|
//Session filter
|
|
|
|
$panel='<div class = "column left">
|
|
|
|
<form method="post" id="filter" action="?state=mc&cinema=1&number=1">
|
|
|
|
<input type="date" name="date" value="'.$date.'" min="2021-01-01" max="2031-12-31">
|
|
|
|
<select name="hall" class="button large">';
|
|
|
|
|
|
|
|
foreach(Hall::getListHalls($idCinema) as $hll){
|
|
|
|
if($hll->getNumber() == $hall){
|
|
|
|
$panel.= '
|
|
|
|
<option value="'. $hll->getNumber() .'"selected> Sala '. $hll->getNumber() .'</option> ';
|
|
|
|
}else{
|
|
|
|
$panel.= '
|
|
|
|
<option value="'. $hll->getNumber() .'"> Sala '. $hll->getNumber() .'</option>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$panel.='
|
|
|
|
</select>
|
|
|
|
<input type="submit" name="filter" value="Filtrar" class="button large"/>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
';
|
2021-06-01 17:46:11 +02:00
|
|
|
//Session list
|
|
|
|
$panel .=' <div class = "column right">';
|
2021-06-02 13:06:50 +02:00
|
|
|
$sessions = Session::getListSessions($hall,$idCinema,$date);
|
2021-06-01 17:46:11 +02:00
|
|
|
|
|
|
|
if($sessions) {
|
|
|
|
$panel .='
|
|
|
|
<form method="post" action="./?state=edit_session">
|
|
|
|
<table class="alt">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Hora</th>
|
|
|
|
<th>Pelicula</th>
|
|
|
|
<th>Formato</th>
|
|
|
|
<th>Precio</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>';
|
|
|
|
|
|
|
|
|
|
|
|
foreach($sessions as $session){
|
|
|
|
$film = Session::getThisSessionFilm($session->getIdfilm());
|
|
|
|
$panel .='
|
|
|
|
<tr>
|
|
|
|
<td> '.date("H:i", strtotime( $session->getStartTime())).' </td>
|
|
|
|
<td> '. str_replace('_', ' ', $film["tittle"]) .' </td>
|
|
|
|
<td> '.$session->getFormat().' </td>
|
|
|
|
<td> '.$session->getSeatPrice().' </td>
|
|
|
|
</tr>';
|
|
|
|
}
|
|
|
|
$panel.='
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</form>';
|
|
|
|
} else {
|
|
|
|
$panel.=' <h3> No hay ninguna sesion </h3>';
|
|
|
|
}
|
2021-06-02 13:06:50 +02:00
|
|
|
$panel.='</div>';
|
2021-06-01 17:46:11 +02:00
|
|
|
|
|
|
|
return $panel;
|
2021-06-02 13:06:50 +02:00
|
|
|
}
|
2021-06-01 17:46:11 +02:00
|
|
|
|
2021-05-17 15:29:29 +02:00
|
|
|
|
|
|
|
//Functions MANAGERS
|
2021-05-20 10:45:10 +02:00
|
|
|
static function print_managers(){
|
2021-05-20 15:29:49 +02:00
|
|
|
include_once('../assets/php/includes/manager_dao.php');
|
|
|
|
include_once('../assets/php/includes/manager.php');
|
2021-05-17 15:29:29 +02:00
|
|
|
$manager = new Manager_DAO("complucine");
|
|
|
|
$managers = $manager->allManagersData();
|
|
|
|
$ids = array();
|
|
|
|
$idscinemas = array();
|
|
|
|
$usernames = array();
|
|
|
|
$email = array();
|
|
|
|
$rol = array();
|
2021-06-01 11:24:37 +02:00
|
|
|
if(!is_array($managers)){
|
|
|
|
$reply = "<h2> No hay ningun manager</h2>";
|
|
|
|
}
|
|
|
|
else{
|
2021-05-17 15:29:29 +02:00
|
|
|
foreach($managers as $key => $value){
|
|
|
|
$ids[$key] = $value->getId();
|
|
|
|
$idscinemas[$key] = $value->getIdcinema();
|
|
|
|
$usernames[$key] = $value->getUsername();
|
|
|
|
$email[$key] = $value->getEmail();
|
|
|
|
$rol[$key] = $value->getRoll();
|
|
|
|
}
|
2021-06-01 11:24:37 +02:00
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply= "<div class='row'>
|
2021-06-01 11:24:37 +02:00
|
|
|
<ul class ='tablelist col7'>
|
|
|
|
<li class='title'>Id</li>
|
|
|
|
<li class='title'>IdCinema</li>
|
|
|
|
<li class='title'>Nombre</li>
|
|
|
|
<li class='title'>Email</li>
|
|
|
|
<li class='title'>Rol</li>
|
|
|
|
<li class='title'>Editar</li>
|
|
|
|
<li class='title'>Eliminar</li>
|
2021-05-17 15:29:29 +02:00
|
|
|
";
|
2021-06-04 09:54:37 +02:00
|
|
|
$parity = "odd";
|
2021-05-17 15:29:29 +02:00
|
|
|
for($i = 0; $i < count($managers); $i++){
|
2021-06-01 11:24:37 +02:00
|
|
|
$reply.= '
|
2021-06-04 09:54:37 +02:00
|
|
|
<div class="'.$parity.'">
|
2021-06-01 11:24:37 +02:00
|
|
|
<li>'. $ids[$i] .'</li>
|
|
|
|
<li>'. $idscinemas[$i] .'</li>
|
|
|
|
<li>'. $usernames[$i] .'</li>
|
|
|
|
<li>'. $email[$i] .'</li>
|
|
|
|
<li>'. $rol[$i] .'</li>
|
|
|
|
<li>
|
2021-05-17 15:29:29 +02:00
|
|
|
<form method="post" action="index.php?state=mg">
|
|
|
|
<input name="id" type="hidden" value="'.$ids[$i].'">
|
|
|
|
<input name="idcinema" type="hidden" value="'.$idscinemas[$i].'">
|
|
|
|
<input type="submit" id="submit" value="Editar" name="edit_manager" class="primary" />
|
|
|
|
</form>
|
2021-06-01 11:24:37 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
2021-05-17 15:29:29 +02:00
|
|
|
<form method="post" action="index.php?state=mg">
|
|
|
|
<input name="id" type="hidden" value="'.$ids[$i].'">
|
|
|
|
<input name="idcinema" type="hidden" value="'.$idscinemas[$i].'">
|
|
|
|
<input name="username" type="hidden" value="'.$usernames[$i].'">
|
|
|
|
<input name="email" type="hidden" value="'.$email[$i].'">
|
|
|
|
<input name="rol" type="hidden" value="'.$rol[$i].'">
|
|
|
|
<input type="submit" id="submit" value="Eliminar" name="delete_manager" class="primary" />
|
|
|
|
</form>
|
2021-06-01 11:24:37 +02:00
|
|
|
</li>
|
2021-06-04 09:54:37 +02:00
|
|
|
</div>
|
2021-05-17 15:29:29 +02:00
|
|
|
';
|
2021-06-04 09:54:37 +02:00
|
|
|
$parity = ($parity == "odd") ? "even" : "odd";
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
2021-06-01 11:24:37 +02:00
|
|
|
|
|
|
|
$reply.='</ul>
|
2021-05-17 15:29:29 +02:00
|
|
|
</div>
|
|
|
|
';
|
2021-06-01 11:24:37 +02:00
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply;
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
static function showAddBotton() {
|
|
|
|
return $reply = '<div class="column side"></div>
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column middle">
|
|
|
|
<h2>Añadir gerente</h2>
|
|
|
|
<form method="post" action="index.php?state=mg">
|
|
|
|
<div class="actions">
|
|
|
|
<input type="submit" id="submit" value="Añadir gerente" name="add_manager" class="primary" />
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>
|
|
|
|
</div>
|
|
|
|
';
|
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
static function addManager(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formAddManager.php');
|
|
|
|
$formAM = new formAddManager();
|
|
|
|
$htmlAForm = $formAM->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- ADD MANAGER -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<h3>AÑADIR GERENTE</h3>
|
|
|
|
'.$htmlAForm.'
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
static function editManager(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formEditManager.php');
|
|
|
|
$formEM = new formEditManager();
|
|
|
|
$htmlEForm = $formEM->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- EDIT MANAGER -->
|
2021-06-02 13:06:50 +02:00
|
|
|
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
'.$htmlEForm.'
|
2021-06-02 13:06:50 +02:00
|
|
|
</div>';
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function deleteManager(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formDeleteManager.php');
|
|
|
|
$formDM = new formDeleteManager();
|
|
|
|
$htmlDForm = $formDM->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- DELETE MANAGER -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<h3>ELIMINAR GERENTE</h3>
|
|
|
|
'.$htmlDForm.'
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Functions PROMOTIONS
|
2021-05-20 10:45:10 +02:00
|
|
|
static function addPromotion(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formAddPromotion.php');
|
|
|
|
$formAP = new formAddPromotion();
|
|
|
|
$htmlAForm = $formAP->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- ADD PROMOTION -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<h3>AÑADIR PROMOCIÓN</h3>
|
|
|
|
'.$htmlAForm.'
|
2021-06-02 13:06:50 +02:00
|
|
|
</div>';
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
|
|
|
|
static function editPromotion(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formEditPromotion.php');
|
|
|
|
$formEP = new formEditPromotion();
|
|
|
|
$htmlEForm = $formEP->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- EDIT MANAGER -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<h3>EDITAR PROMOCIÓN</h3>
|
|
|
|
'.$htmlEForm.'
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function deletePromotion(){
|
2021-05-17 15:29:29 +02:00
|
|
|
include_once('./includes/formDeletePromotion.php');
|
|
|
|
$formDP = new formDeletePromotion();
|
|
|
|
$htmlDForm = $formDP->gestiona();
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply= '<!-- DELETE MANAGER -->
|
2021-05-17 15:29:29 +02:00
|
|
|
<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<h3>ELIMINAR PROMOCIÓN</h3>
|
|
|
|
'.$htmlDForm.'
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
static function print_promotions(){
|
2021-05-17 15:29:29 +02:00
|
|
|
$promo = new Promotion_DAO("complucine");
|
|
|
|
$promos = $promo->allPromotionData();
|
|
|
|
$ids = array();
|
|
|
|
$tittles = array();
|
|
|
|
$descriptions = array();
|
|
|
|
$codes = array();
|
|
|
|
$actives = array();
|
|
|
|
|
2021-06-01 11:24:37 +02:00
|
|
|
if(!is_array($promos)){
|
|
|
|
$reply = "<h2> No hay promociones </h2>";
|
|
|
|
}
|
|
|
|
else{
|
2021-05-17 15:29:29 +02:00
|
|
|
foreach($promos as $key => $value){
|
|
|
|
$ids[$key] = $value->getId();
|
|
|
|
$tittles[$key] = $value->getTittle();
|
|
|
|
$descriptions[$key] = $value->getDescription();
|
|
|
|
$codes[$key] = $value->getCode();
|
2021-06-04 09:13:27 +02:00
|
|
|
if ($value->getActive() == 0) {
|
|
|
|
$actives[$key] = "si";
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$actives[$key] = "no";
|
|
|
|
}
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
$reply= "<div class='row'>
|
2021-06-01 11:24:37 +02:00
|
|
|
<ul class='tablelist col7'>
|
|
|
|
<li class='title'>Id</li>
|
|
|
|
<li class='title'>Título</li>
|
|
|
|
<li class='title'>Descripcion</li>
|
|
|
|
<li class='title'>Código</li>
|
|
|
|
<li class='title'>Activo</li>
|
|
|
|
<li class='title'>Editar</li>
|
|
|
|
<li class='title'>Eliminar</li>
|
2021-05-20 10:45:10 +02:00
|
|
|
";
|
2021-06-04 09:54:37 +02:00
|
|
|
$parity ="odd";
|
2021-05-17 15:29:29 +02:00
|
|
|
for($i = 0; $i < count($promos); $i++){
|
2021-06-01 11:24:37 +02:00
|
|
|
$reply.= '
|
2021-06-04 15:00:49 +02:00
|
|
|
<div class="'.$parity.'">
|
2021-06-01 11:24:37 +02:00
|
|
|
<li>'. $ids[$i] .'</li>
|
|
|
|
<li>'. $tittles[$i] .'</li>
|
|
|
|
<li>'. $descriptions[$i] .'</li>
|
|
|
|
<li>'. $codes[$i] .'</li>
|
|
|
|
<li>'. $actives[$i] .'</li>
|
|
|
|
<li>
|
2021-05-20 10:45:10 +02:00
|
|
|
<form method="post" action="index.php?state=mp">
|
|
|
|
<input name="id" type="hidden" value="'.$ids[$i].'">
|
|
|
|
<input name="tittle" type="hidden" value="'.$tittles[$i].'">
|
|
|
|
<input name="description" type="hidden" value="'.$descriptions[$i].'">
|
|
|
|
<input name="code" type="hidden" value="'.$codes[$i].'">
|
|
|
|
<input name="active" type="hidden" value="'.$actives[$i].'">
|
|
|
|
<input type="submit" id="submit" value="Editar" name="edit_promotion" class="primary" />
|
|
|
|
</form>
|
2021-06-01 11:24:37 +02:00
|
|
|
|
|
|
|
<li>
|
2021-05-20 10:45:10 +02:00
|
|
|
<form method="post" action="index.php?state=mp">
|
|
|
|
<input name="id" type="hidden" value="'.$ids[$i].'">
|
|
|
|
<input name="tittle" type="hidden" value="'.$tittles[$i].'">
|
|
|
|
<input name="description" type="hidden" value="'.$descriptions[$i].'">
|
|
|
|
<input name="code" type="hidden" value="'.$codes[$i].'">
|
|
|
|
<input name="active" type="hidden" value="'.$actives[$i].'">
|
|
|
|
<input type="submit" id="submit" value="Eliminar" name="delete_promotion" class="primary" />
|
|
|
|
</form>
|
2021-06-01 11:24:37 +02:00
|
|
|
</li>
|
|
|
|
</li>
|
2021-06-04 09:54:37 +02:00
|
|
|
</div>
|
2021-05-17 15:29:29 +02:00
|
|
|
';
|
2021-06-04 09:54:37 +02:00
|
|
|
$parity = ($parity=="odd")? "even":"odd";
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
2021-06-01 11:24:37 +02:00
|
|
|
|
|
|
|
$reply.='</ul>
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
</div>
|
2021-05-17 15:29:29 +02:00
|
|
|
';
|
2021-06-01 11:24:37 +02:00
|
|
|
}
|
2021-05-20 10:45:10 +02:00
|
|
|
return $reply ;
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
2021-05-27 09:23:11 +02:00
|
|
|
|
|
|
|
static function see_like_user(){
|
|
|
|
$_SESSION["lastRol"] = $_SESSION["rol"];
|
|
|
|
//unset($_SESSION["rol"]);
|
|
|
|
$_SESSION["rol"] = null;
|
2021-06-02 12:17:18 +02:00
|
|
|
//header("Location: {$_SERVER['PHP_SELF']}");
|
|
|
|
return $reply = "<div class=''>
|
2021-05-27 09:23:11 +02:00
|
|
|
<div class='column side'></div>
|
|
|
|
<div class='column middle'>
|
|
|
|
<div class='code info'>
|
|
|
|
<h1> ¡ATENCIÓN! </h1><hr />
|
|
|
|
<p>Está viendo la web como un Usuario NO Registrado.</p>
|
2021-06-03 09:50:35 +02:00
|
|
|
<a href='../../'><button>Cerrar Mensaje</button></a>
|
2021-05-27 09:23:11 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='column side'></div>
|
|
|
|
</div>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
static function see_like_registed_user(){
|
|
|
|
$_SESSION["lastRol"] = $_SESSION["rol"];
|
|
|
|
$_SESSION["rol"] = "user";
|
2021-06-02 12:17:18 +02:00
|
|
|
//header("Location: {$_SERVER['PHP_SELF']}");
|
|
|
|
return $reply = "<div class='row'>
|
2021-05-27 09:23:11 +02:00
|
|
|
<div class='column side'></div>
|
|
|
|
<div class='column middle'>
|
|
|
|
<div class='code info'>
|
|
|
|
<h1> ¡ATENCIÓN! </h1><hr />
|
|
|
|
<p>Está viendo la web como un Usuario Registrado.</p>
|
2021-06-03 09:50:35 +02:00
|
|
|
<a href='../../panel_user'><button>Cerrar Mensaje</button></a>
|
2021-05-27 09:23:11 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='column side'></div>
|
|
|
|
</div>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
static function see_like_manager(){
|
|
|
|
$_SESSION["lastRol"] = $_SESSION["rol"];
|
|
|
|
$_SESSION["rol"] = "manager";
|
2021-06-02 12:17:18 +02:00
|
|
|
//header("Location: {$_SERVER['PHP_SELF']}");
|
|
|
|
return $reply = "<div class='row'>
|
2021-05-27 09:23:11 +02:00
|
|
|
<div class='column side'></div>
|
|
|
|
<div class='column middle'>
|
|
|
|
<div class='code info'>
|
|
|
|
<h1> ¡ATENCIÓN! </h1><hr />
|
|
|
|
<p>Está viendo la web como un Gerente.</p>
|
2021-06-03 09:50:35 +02:00
|
|
|
<a href='../../panel_manager'><button>Cerrar Mensaje</button></a>
|
2021-05-27 09:23:11 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='column side'></div>
|
|
|
|
</div>
|
|
|
|
";
|
|
|
|
}
|
2021-05-17 15:29:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
2021-05-20 10:45:10 +02:00
|
|
|
|
|
|
|
|