diff --git a/panel_manager/includes/formHall.php b/panel_manager/includes/formHall.php index ee45443..8e6b0bb 100644 --- a/panel_manager/includes/formHall.php +++ b/panel_manager/includes/formHall.php @@ -1,6 +1,6 @@ reply = array(); } - protected function generaCamposFormulario($datos, $errores = array()){ - $this->option = $_SESSION['option']; - $_SESSION['option'] = ""; - $htmlform = ""; - - - - if($this->option == "new"){ + public static function generaCampoFormulario($datos, $errores = array(), $option){ + if($option == "new"){ $number = $datos['number'] ?? ''; $rows = $datos['rows'] ?? ''; $cols = $datos['cols'] ?? ''; @@ -31,13 +25,15 @@ class FormHall extends Form { $htmlform .= ' -
+ '; } @@ -74,45 +70,40 @@ class FormHall extends Form { } //Process form: - public function processesForm($datos){ - $this->correct = true; - $bd = new HallDAO('complucine'); - - - if($bd ){ - if($option == "list"){ - $this->halls = $bd->getAllHalls($cinema); - }else { - /* TODO - $start = date('H:i:s', strtotime( $start ) ); + public static function processesForm($data){ + if($data["option"] == "new"){ + Hall::create_hall($data); + $_SESSION['msg'] = "La sala se ha añadido correctamente"; + header( "Location: ../?state=success" ); + }else { + /* TODO + $start = date('H:i:s', strtotime( $start ) ); + + if($option == "new"){ - if($option == "new"){ - - $selectSession = $bd->selectSession($cinema, $hall, $start, $date); - if($selectSession && $selectSession->num_rows >= 1) { - $this->correct = false; - } else{ - $bd->createSession(null, $film, $hall,$cinema, $date, $start, $price, $format); - } - - mysqli_free_result($selectSession); - - } else if ($option == "del"){ - $bd->deleteSession($id); - - } else if ($option == "edit"){ - $bd->editSession($id, $film, $hall, $cinema, $date, $start, $price, $format); + $selectSession = $bd->selectSession($cinema, $hall, $start, $date); + if($selectSession && $selectSession->num_rows >= 1) { + $this->correct = false; + } else{ + $bd->createSession(null, $film, $hall,$cinema, $date, $start, $price, $format); } - if($repeat > "0"){ - $repeat--; - $date = date('Y-m-d', strtotime( $date. ' +1 day') ); - $this->processesForm($film, $hall, $cinema, $date, $start, $price, $format, $repeat); - } - */ - } + mysqli_free_result($selectSession); - } else {$this->correct = false;} + } else if ($option == "del"){ + $bd->deleteSession($id); + + } else if ($option == "edit"){ + $bd->editSession($id, $film, $hall, $cinema, $date, $start, $price, $format); + } + + if($repeat > "0"){ + $repeat--; + $date = date('Y-m-d', strtotime( $date. ' +1 day') ); + $this->processesForm($film, $hall, $cinema, $date, $start, $price, $format, $repeat); + } + */ + } } } diff --git a/panel_manager/index.php b/panel_manager/index.php index 1b705cf..49d2e4d 100644 --- a/panel_manager/index.php +++ b/panel_manager/index.php @@ -1,13 +1,56 @@ +Esta vista no esta implementada
"; break; - case 'us_r': echo "Esta vista no esta implementada
"; break; - case 'rooms': require_once('manage_halls.php'); break; - case 'sessions': require_once('manage_sessions.php'); break; - case 'edit_session': require_once('edit_sessions.php'); break; - case 'edit_hall': require_once('edit_halls.php'); break; - default: require('hello_panel.php'); break; - } - } - else{ - echo "Usuario: '.$name.'
+Espero que estes pasando un buen dia
+'.$_SESSION['msg'].'
+Usuario: '.$name.'
+Espero que estes pasando un buen dia
+