From fdf0a17eddbbf12609a87287f18e1f8753a4d651 Mon Sep 17 00:00:00 2001
From: Markines16 <80280295+Markines16@users.noreply.github.com>
Date: Thu, 13 May 2021 23:58:18 +0200
Subject: [PATCH] Funcional y ademas sin notices
---
panel_manager/includes/formHall.php | 22 ++++++----
panel_manager/includes/formSession.php | 5 ++-
panel_manager/index.php | 58 +++++++++++++-------------
3 files changed, 47 insertions(+), 38 deletions(-)
diff --git a/panel_manager/includes/formHall.php b/panel_manager/includes/formHall.php
index 5100e1c..9b9f591 100644
--- a/panel_manager/includes/formHall.php
+++ b/panel_manager/includes/formHall.php
@@ -33,13 +33,21 @@ class FormHall extends Form {
//Seats_map
$seats = 0;
$seats_map = array();
-
+ for($i = 1;$i <= $rows; $i++){
+ for($j = 1; $j <= $cols; $j++){
+ $seats_map[$i][$j] = "-1";
+ }
+ }
+
//Show the original seats_map once u click restart or the first time u enter this form from manage_halls's form
- if($data["restart"] || $_POST["edit_hall"] ){
- foreach(Seat::getSeatsMap($og_number, $this->cinema) as $seat){
- $seats_map[$seat->getNumRows()][$seat->getNumCol()] = $seat->getState();
- if($seat->getState()>=0){
- $seats++;
+ if(isset($data["restart"]) || isset($_POST["edit_hall"]) ){
+ $seat_list = Seat::getSeatsMap($og_number, $this->cinema);
+ if($seat_list){
+ foreach($seat_list as $seat){
+ $seats_map[$seat->getNumRows()][$seat->getNumCol()] = $seat->getState();
+ if($seat->getState()>=0){
+ $seats++;
+ }
}
}
}//Show the checkbox seats_map updated and everything to selected if alltoone was pressed
@@ -64,7 +72,7 @@ class FormHall extends Form {
$errorSeats = self::createMensajeError($errores, 'seats', 'span', array('class' => 'error'));
$html = '
-
'.$htmlErroresGlobales.' '.$errorSeats.' '. $errorManager.'
+
'.$htmlErroresGlobales.' '.$errorSeats.'