From 97d271bbee4b968827fa4845f7d78bc60680a7d4 Mon Sep 17 00:00:00 2001 From: OscarRui <79144467+OscarRui@users.noreply.github.com> Date: Tue, 8 Jun 2021 12:44:47 +0200 Subject: [PATCH] update --- panel_manager/includes/formHall.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/panel_manager/includes/formHall.php b/panel_manager/includes/formHall.php index 20baee4..293434f 100644 --- a/panel_manager/includes/formHall.php +++ b/panel_manager/includes/formHall.php @@ -18,9 +18,9 @@ class FormHall extends Form { $this->og_hall = $hall; if($option == "edit_hall") - $options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."&editing"); + $options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."&editing=true"); else - $options = array("action" => "./?state=".$option."&number=".$hall->getNumber().""); + $options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."&editing=false"); parent::__construct('formHall',$options); } @@ -183,25 +183,25 @@ class FormHall extends Form { if (empty($number) && isset($datos["sumbit"])) { $result['number'] = "
  • El numero de sala tiene que ser mayor que 0.

  • "; } - if(isset($datos["restart"])){ - return $result = "./?state=".$this->option."&number=".$this->og_hall->getNumber().""; - } - if (count($result) === 0 && isset($datos["sumbit"]) ) { + else if (count($result) === 0 && isset($datos["sumbit"]) ) { if($this->option == "new_hall"){ - $msg = Hall::create_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map); - return $result = './?state=success&msg='.$msg; + $_SESSION['msg'] = Hall::create_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map); + $result = './?state=success'; } - if($this->option == "edit_hall"){ - $msg = Hall::edit_hall($number,$this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber()); - return $result = './?state=success&msg='.$msg; + else if($this->option == "edit_hall"){ + $_SESSION['msg'] = Hall::edit_hall($number,$this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber()); + $result = './?state=success'; } } - if (!isset($result['number']) && isset($datos["delete"]) ) { + else if (!isset($result['number']) && isset($datos["delete"]) ) { if($this->option == "edit_hall"){ - $msg = Hall::delete_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber()); - return $result = './?state=success&msg='.$msg; + $_SESSION['msg'] = Hall::delete_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber()); + $result = './?state=success'; } } + else if(isset($datos["restart"])){ + $result = "./?state=".$this->option."&number=".$this->og_hall->getNumber().""; + } return $result;