Restructuracion de las salas
La lista de salas se obtiene de forma distinta, por eso editar/crear sessiones ha dejado de funcionar, pero bueno, estamos a la espera de ver como deberiamos estructurarlo y eso hay que cambiarlo asi que tampoco es problema. El html del formulario de crear salas esta guardado en formhalls, haciendo mas sencillo el codigo de la vista y la logica de edit_halls
This commit is contained in:
parent
02bb7938f0
commit
d370d281f1
16
panel_manager/edit_halls.php
Normal file
16
panel_manager/edit_halls.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
require_once('../assets/php/config.php');
|
||||
include_once('./includes/formHall.php');
|
||||
require_once('../assets/php/common/hall.php');
|
||||
|
||||
$form = new FormHall();
|
||||
|
||||
|
||||
if(isset($_POST['new'])) {
|
||||
$_SESSION["option"] = "new";
|
||||
echo "<h1> Crear una Sala </h1>";
|
||||
$form->gestiona();
|
||||
}
|
||||
|
||||
?>
|
@ -3,12 +3,12 @@
|
||||
require_once($prefix.'assets/php/config.php');
|
||||
|
||||
include_once('./includes/formHall.php');
|
||||
require_once($prefix.'assets/php/common/hall_dto.php');
|
||||
require_once($prefix.'assets/php/common/hall.php');
|
||||
|
||||
require_once($prefix.'assets/php/common/session_dto.php');
|
||||
require_once($prefix.'assets/php/common/session.php');
|
||||
include_once($prefix.'assets/php/common/session_dao.php');
|
||||
|
||||
require_once($prefix.'assets/php/common/film_dto.php');
|
||||
require_once($prefix.'assets/php/common/film.php');
|
||||
include_once($prefix.'assets/php/common/film_dao.php');
|
||||
|
||||
$formHall = new FormHall();
|
||||
|
@ -15,7 +15,35 @@ class FormHall extends Form {
|
||||
parent::__construct('formSession');
|
||||
$this->reply = array();
|
||||
}
|
||||
|
||||
|
||||
protected function generaCamposFormulario($datos, $errores = array()){
|
||||
$this->option = $_SESSION['option'];
|
||||
$_SESSION['option'] = "";
|
||||
$htmlform = "";
|
||||
|
||||
|
||||
|
||||
if($this->option == "new"){
|
||||
$number = $datos['number'] ?? '';
|
||||
$rows = $datos['rows'] ?? '';
|
||||
$cols = $datos['cols'] ?? '';
|
||||
$seats = $datos['seats'] ?? '';
|
||||
|
||||
|
||||
$htmlform .= '
|
||||
<fieldset>
|
||||
<label>Numero de sala:</label> <input type="text" name="number" value="'.$number.'"/> <br>
|
||||
<label>Filas:</label> <input type="text" name="rows" value= "'.$rows.'"/><br>
|
||||
<label>Columnas:</label> <input type="text" name="cols" value= "'.$cols.'"/><br>
|
||||
<label>Butacas totales:</label> <input type="text" name="seats" value= "'.$seats.'"/><br>
|
||||
<button type="submit" name="newHall">Crear</button></div><br>
|
||||
</fieldset>
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
return $htmlform;
|
||||
}
|
||||
//Methods:
|
||||
|
||||
//Returns validation response:
|
||||
@ -46,8 +74,7 @@ class FormHall extends Form {
|
||||
}
|
||||
|
||||
//Process form:
|
||||
public function processesForm($number, $cinema, $rows, $cols, $option) {
|
||||
$this->option = $option;
|
||||
public function processesForm($datos){
|
||||
$this->correct = true;
|
||||
$bd = new HallDAO('complucine');
|
||||
|
||||
|
@ -5,16 +5,9 @@
|
||||
|
||||
include_once('panel_manager.php');
|
||||
|
||||
$login = false;
|
||||
$login = (isset($_SESSION["login"]) && $_SESSION["rol"] == "manager") ? true : false;
|
||||
$panel = isset($_REQUEST['state']) ? new Panel($_REQUEST['state'],$login) : $panel = new Panel('',$login);
|
||||
|
||||
if(isset($_SESSION["login"]) && $_SESSION["rol"] == "manager") $login = true;
|
||||
|
||||
if(isset($_REQUEST['state'])) {
|
||||
$panel = new Panel($_REQUEST['state'],$login);
|
||||
}
|
||||
else {
|
||||
$panel = new Panel('',$login);
|
||||
}
|
||||
?>
|
||||
<!--
|
||||
Práctica 2 - Sistemas Web | Grupo D
|
||||
|
35
panel_manager/manage_halls.php
Normal file
35
panel_manager/manage_halls.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
require_once('../assets/php/common/hall.php');
|
||||
require_once('../assets/php/config.php');
|
||||
|
||||
$listhalls = '<form method="post" action="./?state=edit_hall">
|
||||
<table class="alt">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Numero</th>
|
||||
<th>Filas</th>
|
||||
<th>Columnas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
|
||||
foreach(Hall::getListHalls("1") as $hall){
|
||||
$listhalls .='
|
||||
<tr>
|
||||
<td> '. $hall->getNumber().'</td>
|
||||
<td> '. $hall->getNumRows().'</td>
|
||||
<td> '. $hall->getNumCol().'</td>
|
||||
<td> <input type="submit" name="edit" value="Editar" class="button" ></td>
|
||||
</tr>';
|
||||
}
|
||||
$listhalls.='
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="submit" name="new" value="Añadir" class="button large" >
|
||||
</form>';
|
||||
|
||||
echo $listhalls;
|
||||
?>
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
//General Config File:
|
||||
require_once('../assets/php/config.php');
|
||||
|
||||
include_once('../assets/php/common/hall_dto.php');
|
||||
include_once('../assets/php/common/hall.php');
|
||||
include_once('./includes/formHall.php');
|
||||
|
||||
include_once('../assets/php/common/session_dto.php');
|
||||
include_once('../assets/php/common/session.php');
|
||||
include_once('./includes/formSession.php');
|
||||
|
||||
include_once('../assets/php/common/film_dto.php');
|
||||
include_once('../assets/php/common/film.php');
|
||||
include_once('../assets/php/common/film_dao.php');
|
||||
|
||||
$formSession = new FormSession();
|
||||
@ -28,7 +28,7 @@
|
||||
$formSession->processesForm(null, $placeholder_hall, $_SESSION["cinema"], $placeholder_date, null, null, null, null, "list");
|
||||
|
||||
echo"
|
||||
<!--Session Filter -->
|
||||
<!--Session Filter by Hall -->
|
||||
<div class = \"column left\">
|
||||
<form method=\"post\" id=\"addfilter\">
|
||||
<input type=\"date\" name=\"date\" value=\"". $placeholder_date . "\" min=\"2021-01-01\" max=\"2031-12-31\">
|
||||
|
@ -14,9 +14,10 @@
|
||||
switch($this->state) {
|
||||
case 'us_u': echo "<p> Esta vista no esta implementada </p>"; break;
|
||||
case 'us_r': echo "<p> Esta vista no esta implementada </p>"; break;
|
||||
case 'rooms': require_once('manage_rooms.php'); 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user