diff --git a/panel_admin/includes/formEditFilm.php b/panel_admin/includes/formEditFilm.php
index 02ceb0e..47b5147 100644
--- a/panel_admin/includes/formEditFilm.php
+++ b/panel_admin/includes/formEditFilm.php
@@ -54,8 +54,8 @@ class formEditFilm extends Form{
protected function procesaFormulario($datos){
$result = array();
- $id = $this->test_input($_POST['id']) ?? null;
- if ( empty($id)) {
+ $id = $this->test_input($datos['id']) ?? null;
+ if (is_null($id)) {
$result[] = "La pelicula seleccionada no existe.";
}
diff --git a/panel_admin/includes/formEditPromotion.php b/panel_admin/includes/formEditPromotion.php
index f6d618d..4c0f498 100644
--- a/panel_admin/includes/formEditPromotion.php
+++ b/panel_admin/includes/formEditPromotion.php
@@ -19,6 +19,7 @@ class formEditPromotion extends Form{
// Se generan los mensajes de error si existen.
$htmlErroresGlobales = self::generaListaErroresGlobales($errores);
+ $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
$errorTittle = self::createMensajeError($errores, 'tittle', 'span', array('class' => 'error'));
$errorDescription = self::createMensajeError($errores, 'description', 'span', array('class' => 'error'));
$errorCode = self::createMensajeError($errores, 'code', 'span', array('class' => 'error'));
@@ -50,8 +51,8 @@ class formEditPromotion extends Form{
$result = array();
$id = $this->test_input($_POST['id']) ?? null;
- if ( is_null($id)) {
- $result[] = "La promoción seleccionada no existe.";
+ if (is_null($id)) {
+ $result['id'] = "La promoción seleccionada no existe.";
}
$tittle = $this->test_input($datos['tittle']) ?? null;
diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php
index 2f2e8c9..2f7f041 100644
--- a/panel_admin/panelAdmin.php
+++ b/panel_admin/panelAdmin.php
@@ -12,20 +12,16 @@
if($this->login){
switch($this->state) {
case 'mc': if(isset($_POST['edit_cinema'])) {
- $this->editCinema();
- }
- else if(isset($_POST['delete_cinema'])) {
- $this->deleteCinema();
- }
- else if(isset($_POST['add_cinema'])) {
- $this->addCinema();
- echo ($template->print_cinemas());
- }
- else {
- $this-> addCinema();
- echo ($template->print_cinemas());
-
- };
+ $this->editCinema();
+ }
+ else if(isset($_POST['delete_cinema'])) {
+ $this->deleteCinema();
+ }
+ else {
+ $this-> addCinema();
+ echo ($template->print_cinemas());
+
+ };
break;
case 'mf': if(isset($_POST['edit_film'])) {
$this->editFilm();
@@ -33,10 +29,6 @@
else if(isset($_POST['delete_film'])) {
$this->deleteFilm();
}
- else if(isset($_POST['add_film'])) {
- $this->addFilm();
- echo ( $template->print_fimls());
- }
else {
$this->addFilm();
echo( $template->print_fimls());
@@ -49,9 +41,6 @@
else if(isset($_POST['delete_promotion'])) {
$this->deletePromotion();
}
- else if(isset($_POST['add_promotion'])) {
- $this->addPromotion();
- }
else {
$this->addPromotion();
$this->print_promotions();
@@ -145,8 +134,8 @@
}
function editCinema() {
- include_once('./includes/formEditFilm.php');
- $formEF = new formEditCinema();
+ include_once('./includes/formEditCinema.php');
+ $formEC = new formEditCinema();
$htmlDForm = $formEC->gestiona();
echo '
@@ -186,7 +175,6 @@
IdCinema |
Nombre |
Email |
-
password |
Rol |
@@ -274,6 +262,8 @@
'."\n";
}
+
+ //Functions PROMOTIONS
function addPromotion(){
include_once('./includes/formAddPromotion.php');
$formAP = new formAddPromotion();