Funcional y ademas sin notices

This commit is contained in:
Markines16 2021-05-13 23:58:18 +02:00 committed by GitHub
parent a6636ca786
commit fdf0a17edd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 38 deletions

View File

@ -33,13 +33,21 @@ class FormHall extends Form {
//Seats_map //Seats_map
$seats = 0; $seats = 0;
$seats_map = array(); $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 //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"] ){ if(isset($data["restart"]) || isset($_POST["edit_hall"]) ){
foreach(Seat::getSeatsMap($og_number, $this->cinema) as $seat){ $seat_list = Seat::getSeatsMap($og_number, $this->cinema);
$seats_map[$seat->getNumRows()][$seat->getNumCol()] = $seat->getState(); if($seat_list){
if($seat->getState()>=0){ foreach($seat_list as $seat){
$seats++; $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 }//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')); $errorSeats = self::createMensajeError($errores, 'seats', 'span', array('class' => 'error'));
$html = ' $html = '
<div class="column left">'.$htmlErroresGlobales.' '.$errorSeats.' '. $errorManager.' <div class="column left">'.$htmlErroresGlobales.' '.$errorSeats.'
<fieldset> <fieldset>
<legend>Mapa de Asientos</legend> <legend>Mapa de Asientos</legend>
<label> Filas: </label> <input type="number" name="rows" min="1" id="rows" value="'.$rows.'" required/> <br> <label> Filas: </label> <input type="number" name="rows" min="1" id="rows" value="'.$rows.'" required/> <br>

View File

@ -46,8 +46,9 @@ class FormSession extends Form {
$htmlErroresGlobales = self::generaListaErroresGlobales($errores); $htmlErroresGlobales = self::generaListaErroresGlobales($errores);
$errorPrice = self::createMensajeError($errores, 'price', 'span', array('class' => 'error')); $errorPrice = self::createMensajeError($errores, 'price', 'span', array('class' => 'error'));
$errorFormat = self::createMensajeError($errores, 'format', 'span', array('class' => 'error'));
$html .= ' $html = '
<div class="column left">'.$htmlErroresGlobales.' '.$errorPrice.' <div class="column left">'.$htmlErroresGlobales.' '.$errorPrice.'
<fieldset> <fieldset>
<legend>Datos</legend> <legend>Datos</legend>

View File

@ -18,50 +18,50 @@
if($manager){ if($manager){
if($manager->num_rows == 1){ if($manager->num_rows == 1){
$fila = $manager->fetch_assoc(); $fila = $manager->fetch_assoc();
$manager = new Manager($fila["id"], $fila["idcinema"], $fila["username"], $fila["email"], $fila["rol"]); $manager = new Manager($fila["id"], $fila["idcinema"], null, null, null);
} }
} }
} }
$state = isset($_GET['state']) ? $_GET['state'] : '';
switch($_GET["state"]){ switch($state){
case "view_ruser": case "view_ruser":
case "view_user": case "view_user":
$panel = '<div class="column side"></div> $panel = '<div class="column side"></div>
<div class="column middle"> <div class="column middle">
<div class="code info"> <div class="code info">
<h1>Esta vista aun no esta implementada.</h1><hr /> <h1>Esta vista aun no esta implementada.</h1><hr />
</div> </div>
</div> </div>
<div class="column side"></div>'."\n"; <div class="column side"></div>'."\n";
break; break;
case "manage_halls": case "manage_halls":
$panel = Manager_panel::manage_halls($manager); $panel = Manager_panel::manage_halls($manager);
break; break;
case "new_hall": case "new_hall":
$panel = Manager_panel::new_hall($manager); $panel = Manager_panel::new_hall($manager);
break; break;
case "edit_hall": case "edit_hall":
$panel = Manager_panel::edit_hall($manager); $panel = Manager_panel::edit_hall($manager);
break; break;
case "manage_sessions": case "manage_sessions":
$panel = Manager_panel::manage_sessions($manager); $panel = Manager_panel::manage_sessions($manager);
break; break;
case "new_session": case "new_session":
$panel = Manager_panel::new_session($manager); $panel = Manager_panel::new_session($manager);
break; break;
case "edit_session": case "edit_session":
$panel = Manager_panel::edit_session($manager); $panel = Manager_panel::edit_session($manager);
break; break;
case "select_film": case "select_film":
$panel = Manager_panel::select_film($template,$manager); $panel = Manager_panel::select_film($template,$manager);
break; break;
case "success": case "success":
$panel = Manager_panel::success(); $panel = Manager_panel::success();
break; break;
default: default:
$panel = Manager_panel::welcome($manager); $panel = Manager_panel::welcome($manager);
break; break;
} }
} }
else{ else{
$panel = '<div class="column side"></div> $panel = '<div class="column side"></div>