From 4dad0c48ee539cc6195d1580f6e8ca4167d3de98 Mon Sep 17 00:00:00 2001 From: marian1010 <79144276+marian1010@users.noreply.github.com> Date: Thu, 13 May 2021 11:39:54 +0200 Subject: [PATCH] resubido panel admin pisado --- panel_admin/includes/formAddCinema.php | 6 ++--- panel_admin/includes/formDeleteCinema.php | 4 +-- panel_admin/includes/formEditCinema.php | 4 +-- panel_admin/panelAdmin.php | 33 ++++++++++++----------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/panel_admin/includes/formAddCinema.php b/panel_admin/includes/formAddCinema.php index 67d4588..e1ad5f3 100644 --- a/panel_admin/includes/formAddCinema.php +++ b/panel_admin/includes/formAddCinema.php @@ -8,8 +8,8 @@ include_once('../assets/php/form.php'); class formAddCinema extends Form{ public function __construct(){ - $op = array("action"= ."./?state=mc">); - parent::__construct('formAddCinema',$op) + $op = array("action"=>"./?state=mc">); + parent::__construct('formAddCinema',$op); } protected function generaCamposFormulario($datos,$errores=array()){ @@ -19,7 +19,7 @@ class formAddCinema extends Form{ $errorDirection = self::createMensajeError($errores,'direction','span',array('class'=>'error')); $errrorPhone = self ::createMensajeError($errores,'phone',array('class'=>'error')); - $html = '
+ $html = '
'.$htmlErroresGlobales.' Añadir cine
'.$errorName.'
diff --git a/panel_admin/includes/formDeleteCinema.php b/panel_admin/includes/formDeleteCinema.php index 845a851..5454c42 100644 --- a/panel_admin/includes/formDeleteCinema.php +++ b/panel_admin/includes/formDeleteCinema.php @@ -8,8 +8,8 @@ include_once('../assets/php/form.php'); class formDeleteCinema extends Form{ public function __construct(){ - $op = array("action"= ."./?state=mc">); - parent::__construct('formDeleteCinema',$op) + $op = array("action"=>"./?state=mc">); + parent::__construct('formAddCinema',$op); } protected function generaCamposFormulario($datos,$errores=array()){ diff --git a/panel_admin/includes/formEditCinema.php b/panel_admin/includes/formEditCinema.php index 644a789..f85241a 100644 --- a/panel_admin/includes/formEditCinema.php +++ b/panel_admin/includes/formEditCinema.php @@ -8,8 +8,8 @@ include_once('../assets/php/form.php'); class formEditCinema extends Form{ public function __construct(){ - $op = array("action"= ."./?state=mc">); - parent::__construct('formEditCinema',$op) + $op = array("action"=>"./?state=mc">); + parent::__construct('formAddCinema',$op); } protected function generaCamposFormulario($datos,$errores=array()){ diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php index ce2d6af..f05779b 100644 --- a/panel_admin/panelAdmin.php +++ b/panel_admin/panelAdmin.php @@ -12,23 +12,24 @@ if($this->login){ switch($this->state) { case 'mc': if(isset($_POST['edit_cinema'])) { - editCinema(); - } - else if(isset($_POST['delete_cinema'])) { - deleteCinema(); - } - else if(isset($_POST['add_cinema'])) { - addCinema(); - $template->print_cinemas(); - } - else { - addCinema(); - $template->print_cinemas(); - - }; + $this->editCinema(); + } + else if(isset($_POST['delete_cinema'])) { + $this->deleteCinema(); + } + else if(isset($_POST['add_cinema'])) { + $this->addCinema(); + $template->print_cinemas(); + } + else { + $this-> addCinema(); + $template->print_cinemas(); + + }; break; case 'mf': if(isset($_POST['edit_film'])) { $this->editFilm(); + } else if(isset($_POST['delete_film'])) { $this->deleteFilm(); } @@ -97,6 +98,8 @@ case 'ag': echo"

En construcción

";; break; default: echo "

BIENVENIDO AL PANEL DE ADMINISTRADOR

"; break; } + } + } function getTemplate(){ return $this->template; } @@ -168,4 +171,4 @@ } } - ?> +?>