From 60170ca7312c16f4b38fa707717e3f61ae7831df Mon Sep 17 00:00:00 2001 From: Markines16 <80280295+Markines16@users.noreply.github.com> Date: Tue, 8 Jun 2021 14:46:12 +0200 Subject: [PATCH] Add files via upload --- panel_manager/includes/formHall.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/panel_manager/includes/formHall.php b/panel_manager/includes/formHall.php index e47d103..c0baea2 100644 --- a/panel_manager/includes/formHall.php +++ b/panel_manager/includes/formHall.php @@ -17,10 +17,10 @@ class FormHall extends Form { if($hall) $this->og_hall = $hall; - if($option == "edit_hall") + if($option == "edit_hall" && $hall) $options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."&editing=true"); else - $options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."&editing=false"); + $options = array("action" => "./?state=".$option."&editing=false"); parent::__construct('formHall',$options); } @@ -187,7 +187,11 @@ class FormHall extends Form { FormHall::prepare_message( $msg ); } else if($this->option == "edit_hall"){ - $msg = Hall::edit_hall($number,$this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber()); + if($this->og_hall) + $msg = Hall::edit_hall($number,$this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber()); + else + $msg = "La sala que intentas editar ya no existe"; + FormHall::prepare_message( $msg ); } }