From a53006592c65312cdce9f4a3463b6ec1588e3eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Tue, 8 Jun 2021 15:27:37 +0200 Subject: [PATCH] debug --- panel_admin/includes/formAddCinema.php | 33 ++++++++-------- panel_admin/includes/formAddFilm.php | 5 +-- panel_admin/includes/formAddManager.php | 8 ++-- panel_admin/includes/formAddPromotion.php | 5 +-- panel_admin/includes/formDeleteCinema.php | 6 ++- panel_admin/includes/formDeleteFilm.php | 8 ++-- panel_admin/includes/formDeleteManager.php | 8 ++-- panel_admin/includes/formDeletePromotion.php | 8 ++-- panel_admin/includes/formEditCinema.php | 41 +++++++++++--------- panel_admin/includes/formEditFilm.php | 9 +++-- panel_admin/includes/formEditManager.php | 9 +++-- panel_admin/includes/formEditPromotion.php | 8 ++-- panel_admin/panelAdmin.php | 8 +--- 13 files changed, 83 insertions(+), 73 deletions(-) diff --git a/panel_admin/includes/formAddCinema.php b/panel_admin/includes/formAddCinema.php index 65620aa..b539ab9 100644 --- a/panel_admin/includes/formAddCinema.php +++ b/panel_admin/includes/formAddCinema.php @@ -14,23 +14,24 @@ class formAddCinema extends Form{ protected function generaCamposFormulario($datos,$errores=array()){ - $htmlErroresGlobales = self::generaListaErroresGlobales($errores); - $errorName = self::createMensajeError($errores,'namecinema','span',array('class'=>'error')); - $errorDirection = self::createMensajeError($errores,'direction','span',array('class'=>'error')); - $errrorPhone = self ::createMensajeError($errores,'phone',array('class'=>'error')); + $htmlErroresGlobales = self::generaListaErroresGlobales($errores); + $errorName = self::createMensajeError($errores,'namecinema','span',array('class'=>'error')); + $errorDirection = self::createMensajeError($errores,'direction','span',array('class'=>'error')); + $errrorPhone = self ::createMensajeError($errores,'phone',array('class'=>'error')); - $html = '
-
'.$htmlErroresGlobales.' - Añadir cine -
'.$errorName.'
-
'.$errorDirection.'
-
'.$errrorPhone.'
-
-
- - -
- '; + $html = '
+
'.$htmlErroresGlobales.' + Añadir cine +
'.$errorName.'
+
'.$errorDirection.'
+
'.$errrorPhone.'
+
+
+ + +
+ '; + return $html; } diff --git a/panel_admin/includes/formAddFilm.php b/panel_admin/includes/formAddFilm.php index cc2ac35..0d01233 100644 --- a/panel_admin/includes/formAddFilm.php +++ b/panel_admin/includes/formAddFilm.php @@ -16,8 +16,7 @@ class formAddFilm extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - - + // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorTittle = self::createMensajeError($errores, 'tittle', 'span', array('class' => 'error')); @@ -41,7 +40,7 @@ class formAddFilm extends Form{ '; - + return $html; } diff --git a/panel_admin/includes/formAddManager.php b/panel_admin/includes/formAddManager.php index 10a942f..03ae6dd 100644 --- a/panel_admin/includes/formAddManager.php +++ b/panel_admin/includes/formAddManager.php @@ -17,14 +17,16 @@ class formAddManager extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - + $html = ""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error')); $errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error')); - $html = '
'.$htmlErroresGlobales.'
+ $html .= '

AÑADIR GERENTE

+
'.$htmlErroresGlobales.'
Selecciona usuario.
'.$errorId.'
' .$this->showUsers(). '
@@ -38,7 +40,7 @@ class formAddManager extends Form{ '; - + } return $html; } diff --git a/panel_admin/includes/formAddPromotion.php b/panel_admin/includes/formAddPromotion.php index 97916b4..8afaf97 100644 --- a/panel_admin/includes/formAddPromotion.php +++ b/panel_admin/includes/formAddPromotion.php @@ -16,8 +16,6 @@ class formAddPromotion extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - - // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorTittle = self::createMensajeError($errores, 'tittle', 'span', array('class' => 'error')); @@ -27,6 +25,7 @@ class formAddPromotion extends Form{ //$errorImage = self::createMensajeError($errores, 'image', 'span', array('class' => 'error')); $html = '
+

AÑADIR PROMOCIÓN

'.$htmlErroresGlobales.'
AÑADIR PROMOCIÓN
'.$errorTittle.'
@@ -41,7 +40,7 @@ class formAddPromotion extends Form{
'; - + return $html; } diff --git a/panel_admin/includes/formDeleteCinema.php b/panel_admin/includes/formDeleteCinema.php index a861176..b046694 100644 --- a/panel_admin/includes/formDeleteCinema.php +++ b/panel_admin/includes/formDeleteCinema.php @@ -13,11 +13,12 @@ class formDeleteCinema extends Form{ } protected function generaCamposFormulario($datos,$errores=array()){ - + $html =""; + if (!isset($_SESSION['message'])) { $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error')); - $html = ' + $html .= '
'.$htmlErroresGlobales.'
¿Estás seguro de que quieres eliminar este cine?
'.$errorId.'
@@ -29,6 +30,7 @@ class formDeleteCinema extends Form{ '; + } return $html; } diff --git a/panel_admin/includes/formDeleteFilm.php b/panel_admin/includes/formDeleteFilm.php index 8bc90aa..f56d363 100644 --- a/panel_admin/includes/formDeleteFilm.php +++ b/panel_admin/includes/formDeleteFilm.php @@ -11,11 +11,13 @@ class formDeleteFilm extends Form{ public function __construct() { $options = array("action" => "./?state=mf"); + parent::__construct('formDeleteFilm', $options); } protected function generaCamposFormulario($datos, $errores = array()){ - + $html =""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); @@ -26,7 +28,7 @@ class formDeleteFilm extends Form{ //$errorDescription = self::createMensajeError($errores, 'description', 'span', array('class' => 'error')); //$errorImage = self::createMensajeError($errores, 'image', 'span', array('class' => 'error')); - $html = '
+ $html .= '
'.$htmlErroresGlobales.'
¿Estás seguro de que quieres eliminar esta pelicula?
'.$errorId.'
@@ -41,7 +43,7 @@ class formDeleteFilm extends Form{
'; - + } return $html; } diff --git a/panel_admin/includes/formDeleteManager.php b/panel_admin/includes/formDeleteManager.php index fd0e3a8..39c8621 100644 --- a/panel_admin/includes/formDeleteManager.php +++ b/panel_admin/includes/formDeleteManager.php @@ -15,14 +15,16 @@ class formDeleteManager extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - + $html =""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error')); //$errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error')); - $html = '
+ $html .= '
+

ELIMINAR GERENTE

'.$htmlErroresGlobales.'
¿Estás seguro de que quieres eliminar este gerente?
'.$errorId.'
@@ -37,7 +39,7 @@ class formDeleteManager extends Form{
'; - + } return $html; } diff --git a/panel_admin/includes/formDeletePromotion.php b/panel_admin/includes/formDeletePromotion.php index 3e07dda..d3438fd 100644 --- a/panel_admin/includes/formDeletePromotion.php +++ b/panel_admin/includes/formDeletePromotion.php @@ -15,7 +15,8 @@ class formDeletePromotion extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - + $html =""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); @@ -26,7 +27,8 @@ class formDeletePromotion extends Form{ //$errorActive = self::createMensajeError($errores, 'active', 'span', array('class' => 'error')); //$errorImage = self::createMensajeError($errores, 'image', 'span', array('class' => 'error')); - $html = '
+ $html .= '
+

ELIMINAR PROMOCIÓN

'.$htmlErroresGlobales.'
¿Estás seguro de que quieres eliminar esta promocion?
'.$errorId.'
@@ -42,7 +44,7 @@ class formDeletePromotion extends Form{
'; - + } return $html; } diff --git a/panel_admin/includes/formEditCinema.php b/panel_admin/includes/formEditCinema.php index 8e66d8a..2d17339 100644 --- a/panel_admin/includes/formEditCinema.php +++ b/panel_admin/includes/formEditCinema.php @@ -13,28 +13,31 @@ class formEditCinema extends Form{ } protected function generaCamposFormulario($datos,$errores=array()){ + $html =""; + if(!isset($_SESSION['message'])) { + $htmlErroresGlobales = self::generaListaErroresGlobales($errores); + $errorId= self::createMensajeError($errores,'id','span',array('class'=>'error')); + $errorName = self::createMensajeError($errores,'name','span',array('class'=>'error')); + $errorDirection = self::createMensajeError($errores,'direction','span',array('class'=>'error')); + $errrorPhone = self ::createMensajeError($errores,'phone',array('class'=>'error')); - $htmlErroresGlobales = self::generaListaErroresGlobales($errores); - $errorId= self::createMensajeError($errores,'id','span',array('class'=>'error')); - $errorName = self::createMensajeError($errores,'name','span',array('class'=>'error')); - $errorDirection = self::createMensajeError($errores,'direction','span',array('class'=>'error')); - $errrorPhone = self ::createMensajeError($errores,'phone',array('class'=>'error')); - - $html = '
-
'.$htmlErroresGlobales.'
- Datos de cine - -
'.$errorName.'
-
'.$errorDirection.'
-
'.$errrorPhone.'
-
-
- - + $html .= '
+
'.$htmlErroresGlobales.'
+ Datos de cine + +
'.$errorName.'
+
'.$errorDirection.'
+
'.$errrorPhone.'
+
+
+ + +
-
- '; + '; + } + return $html; } diff --git a/panel_admin/includes/formEditFilm.php b/panel_admin/includes/formEditFilm.php index b9ba5e2..42acc29 100644 --- a/panel_admin/includes/formEditFilm.php +++ b/panel_admin/includes/formEditFilm.php @@ -17,7 +17,8 @@ class formEditFilm extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - + $html =""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); @@ -28,7 +29,7 @@ class formEditFilm extends Form{ $errorDescription = self::createMensajeError($errores, 'description', 'span', array('class' => 'error')); $errorImage = self::createMensajeError($errores, 'img', 'span', array('class' => 'error')); - $html = ' + $html .= '
'.$htmlErroresGlobales.'
Datos de pelicula @@ -48,7 +49,7 @@ class formEditFilm extends Form{
'; - + } return $html; } @@ -137,7 +138,7 @@ class formEditFilm extends Form{
"; - //$result = './?state=mf'; + //$result = './?state=mf'; }else { $result['img'] = 'El archivo tiene un nombre o tipo no soportado'; diff --git a/panel_admin/includes/formEditManager.php b/panel_admin/includes/formEditManager.php index 8e76a38..0ce7477 100644 --- a/panel_admin/includes/formEditManager.php +++ b/panel_admin/includes/formEditManager.php @@ -17,13 +17,14 @@ class formEditManager extends Form{ protected function generaCamposFormulario($datos, $errores = array()){ - + $html =""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error')); $errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error')); - $html = ' + $html .= '

EDITAR GERENTE ID:'.$_POST['id'].'

'.$htmlErroresGlobales.'
Selecciona cine.
'.$errorIdCinema.'
@@ -35,7 +36,7 @@ class formEditManager extends Form{ '; - + } return $html; } @@ -69,7 +70,7 @@ class formEditManager extends Form{
"; - // $result = './?state=mg'; + //$result = './?state=mg'; } else{ diff --git a/panel_admin/includes/formEditPromotion.php b/panel_admin/includes/formEditPromotion.php index ad99dee..8b2edcb 100644 --- a/panel_admin/includes/formEditPromotion.php +++ b/panel_admin/includes/formEditPromotion.php @@ -17,7 +17,8 @@ class formEditPromotion extends Form{ } protected function generaCamposFormulario($datos, $errores = array()){ - + $html =""; + if (!isset($_SESSION['message'])) { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); @@ -28,7 +29,8 @@ class formEditPromotion extends Form{ $errorActive = self::createMensajeError($errores, 'active', 'span', array('class' => 'error')); $errorImg = self::createMensajeError($errores, 'img', 'span', array('class' => 'error')); - $html = '
+ $html .= '
+

EDITAR PROMOCIÓN

'.$htmlErroresGlobales.'
Datos de promocion @@ -44,7 +46,7 @@ class formEditPromotion extends Form{
'; - + } return $html; } diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php index bdbc064..aef95a4 100644 --- a/panel_admin/panelAdmin.php +++ b/panel_admin/panelAdmin.php @@ -297,8 +297,7 @@ $htmlAForm = $formAM->gestiona(); return $reply= '
-
-

AÑADIR GERENTE

+
'.$htmlAForm.'
'."\n"; @@ -308,7 +307,6 @@ $formEM = new formEditManager(); $htmlEForm = $formEM->gestiona(); return $reply= ' -
'.$htmlEForm.' @@ -322,7 +320,6 @@ return $reply= '
-

ELIMINAR GERENTE

'.$htmlDForm.'
'."\n"; @@ -337,7 +334,6 @@ return $reply= '
-

AÑADIR PROMOCIÓN

'.$htmlAForm.'
'; } @@ -349,7 +345,6 @@ return $reply= '
-

EDITAR PROMOCIÓN

'.$htmlEForm.'
'."\n"; @@ -362,7 +357,6 @@ return $reply= '
-

ELIMINAR PROMOCIÓN

'.$htmlDForm.'
'."\n"; }