template;
}
static function panel(){
return $reply= '
Bienvenido al Panel de Administrador.
'."\n";
}
//Functions FILMS
static function addFilm(){
include_once('./includes/formAddFilm.php');
$formAF = new formAddFilm();
$htmlAForm = $formAF->gestiona();
return $reply= '
'.$htmlAForm.'
'."\n";
}
static function deleteFilm() {
include_once('./includes/formDeleteFilm.php');
$formDF = new formDeleteFilm();
$htmlDForm = $formDF->gestiona();
return $reply= '
'.$htmlDForm.'
'."\n";
}
static function editFilm() {
include_once('./includes/formEditFilm.php');
$formEF = new formEditFilm();
$htmlDForm = $formEF->gestiona();
return $reply= '
'.$htmlDForm.'
'."\n";
}
//Functions Cinemas
static function addCinema(){
include_once('./includes/formAddCinema.php');
$formAC = new formAddCinema();
$htmlAForm = $formAC->gestiona();
return $reply= '
'.$htmlAForm.'
'."\n";
}
static function deleteCinema() {
include_once('./includes/formDeleteCinema.php');
$formDC = new formDeleteCinema();
$htmlDForm = $formDC->gestiona();
return $reply= '
'.$htmlDForm.'
'."\n";
}
static function editCinema() {
include_once('./includes/formEditCinema.php');
$formEC = new formEditCinema();
$htmlDForm = $formEC->gestiona();
return $reply= '
'.$htmlDForm.'
'."\n";
}
//Functions MANAGERS
static function print_managers(){
include_once('../assets/php/common/manager_dao.php');
include_once('../assets/php/common/manager.php');
$manager = new Manager_DAO("complucine");
$managers = $manager->allManagersData();
$ids = array();
$idscinemas = array();
$usernames = array();
$email = array();
$rol = array();
if(is_array($managers)){
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();
}
}
$reply= "
Id |
IdCinema |
Nombre |
Email |
Rol |
";
if(is_array($managers)){
for($i = 0; $i < count($managers); $i++){
$reply.= '
'. $ids[$i] .' |
'. $idscinemas[$i] .' |
'. $usernames[$i] .' |
'. $email[$i] .' |
'. $rol[$i] .' |
|
|
';
}
}
$reply.='
';
return $reply;
}
static function showAddBotton() {
return $reply = '
';
}
static function addManager(){
include_once('./includes/formAddManager.php');
$formAM = new formAddManager();
$htmlAForm = $formAM->gestiona();
return $reply= '
AÑADIR GERENTE
'.$htmlAForm.'
'."\n";
}
static function editManager(){
include_once('./includes/formEditManager.php');
$formEM = new formEditManager();
$htmlEForm = $formEM->gestiona();
return $reply= '
EDITAR GERENTE
'.$htmlEForm.'
'."\n";
}
static function deleteManager(){
include_once('./includes/formDeleteManager.php');
$formDM = new formDeleteManager();
$htmlDForm = $formDM->gestiona();
return $reply= '
ELIMINAR GERENTE
'.$htmlDForm.'
'."\n";
}
//Functions PROMOTIONS
static function addPromotion(){
include_once('./includes/formAddPromotion.php');
$formAP = new formAddPromotion();
$htmlAForm = $formAP->gestiona();
return $reply= '
AÑADIR PROMOCIÓN
'.$htmlAForm.'
'."\n";
}
static function editPromotion(){
include_once('./includes/formEditPromotion.php');
$formEP = new formEditPromotion();
$htmlEForm = $formEP->gestiona();
return $reply= '
EDITAR PROMOCIÓN
'.$htmlEForm.'
'."\n";
}
static function deletePromotion(){
include_once('./includes/formDeletePromotion.php');
$formDP = new formDeletePromotion();
$htmlDForm = $formDP->gestiona();
return $reply= '
ELIMINAR PROMOCIÓN
'.$htmlDForm.'
'."\n";
}
static function print_promotions(){
$promo = new Promotion_DAO("complucine");
$promos = $promo->allPromotionData();
$ids = array();
$tittles = array();
$descriptions = array();
$codes = array();
$actives = array();
if(is_array($promos)){
foreach($promos as $key => $value){
$ids[$key] = $value->getId();
$tittles[$key] = $value->getTittle();
$descriptions[$key] = $value->getDescription();
$codes[$key] = $value->getCode();
$actives[$key] = $value->getActive();
}
}
$reply= "
Id |
Título |
Descripcion |
Código |
Activo |
";
if(is_array($promos)){
for($i = 0; $i < count($promos); $i++){
$reply.= '
'. $ids[$i] .' |
'. $tittles[$i] .' |
'. $descriptions[$i] .' |
'. $codes[$i] .' |
'. $actives[$i] .' |
|
|
';
}
}
$reply.='
';
return $reply ;
}
}
?>