Add files via upload
This commit is contained in:
parent
c90c450f1c
commit
d108b66468
@ -8,7 +8,6 @@ class FormHall extends Form {
|
|||||||
private $option;
|
private $option;
|
||||||
private $cinema;
|
private $cinema;
|
||||||
private $og_hall;
|
private $og_hall;
|
||||||
private $first;
|
|
||||||
|
|
||||||
//Constructor:
|
//Constructor:
|
||||||
public function __construct($option, $cinema, $hall) {
|
public function __construct($option, $cinema, $hall) {
|
||||||
@ -18,9 +17,9 @@ class FormHall extends Form {
|
|||||||
$this->og_hall = $hall;
|
$this->og_hall = $hall;
|
||||||
|
|
||||||
if($option == "edit_hall")
|
if($option == "edit_hall")
|
||||||
$this->first = true;
|
$options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."&editing");
|
||||||
|
else
|
||||||
$options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."");
|
$options = array("action" => "./?state=".$option."&number=".$hall->getNumber()."");
|
||||||
parent::__construct('formHall',$options);
|
parent::__construct('formHall',$options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,10 +37,9 @@ class FormHall extends Form {
|
|||||||
$seats_map[$i][$j] = "-1";
|
$seats_map[$i][$j] = "-1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$alltozero = $_POST["alltozero"] ?? 0;
|
||||||
//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(isset($data["restart"]) || $this->first){
|
if(!isset($_GET["editing"])){
|
||||||
$first = false;
|
|
||||||
$rows = $this->og_hall->getNumRows();
|
$rows = $this->og_hall->getNumRows();
|
||||||
$cols = $this->og_hall->getNumCol();
|
$cols = $this->og_hall->getNumCol();
|
||||||
$seat_list = Seat::getSeatsMap($this->og_hall->getNumber(), $this->cinema);
|
$seat_list = Seat::getSeatsMap($this->og_hall->getNumber(), $this->cinema);
|
||||||
@ -54,7 +52,7 @@ class FormHall extends Form {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//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
|
||||||
else{
|
else if(!$alltozero){
|
||||||
$alltoone = $_POST["alltoone"] ?? 0;
|
$alltoone = $_POST["alltoone"] ?? 0;
|
||||||
for($i = 1;$i <= $rows; $i++){
|
for($i = 1;$i <= $rows; $i++){
|
||||||
for($j = 1; $j <= $cols; $j++){
|
for($j = 1; $j <= $cols; $j++){
|
||||||
@ -81,8 +79,8 @@ class FormHall extends Form {
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Mapa de Asientos</legend>
|
<legend>Mapa de Asientos</legend>
|
||||||
'.$errorSeats.' '.$errorRows.' '.$errorCols.'
|
'.$errorSeats.' '.$errorRows.' '.$errorCols.'
|
||||||
<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.'" /> <br>
|
||||||
<label> Columnas: </label> <input type="number" name="cols" min="1" id="cols" value="'.$cols.'"required/> <br>
|
<label> Columnas: </label> <input type="number" name="cols" min="1" id="cols" value="'.$cols.'"/> <br>
|
||||||
<label> Asientos totales:'.$seats.' </label> <input type="hidden" name="seats" id="seats" value="'.$seats.'"readonly/> <br>
|
<label> Asientos totales:'.$seats.' </label> <input type="hidden" name="seats" id="seats" value="'.$seats.'"readonly/> <br>
|
||||||
<input type="submit" name="filter" value="Actualizar mapa de la sala" class="button large" />
|
<input type="submit" name="filter" value="Actualizar mapa de la sala" class="button large" />
|
||||||
';
|
';
|
||||||
@ -92,7 +90,7 @@ class FormHall extends Form {
|
|||||||
</fieldset><br>
|
</fieldset><br>
|
||||||
'.$errorNumber.'
|
'.$errorNumber.'
|
||||||
<label> Numero de sala: </label>
|
<label> Numero de sala: </label>
|
||||||
<input type="number" min="1" name="number" id="number" value="'.$number.'" placeholder="Numero de la Sala" /><br>
|
<input type="number" name="number" id="number" value="'.$number.'" placeholder="Numero de la Sala" /><br>
|
||||||
';
|
';
|
||||||
if($this->option == "new_hall")
|
if($this->option == "new_hall")
|
||||||
$html .='<input type="submit" id="submit" name="sumbit" value="Crear Sala" class="primary" />
|
$html .='<input type="submit" id="submit" name="sumbit" value="Crear Sala" class="primary" />
|
||||||
@ -106,6 +104,7 @@ class FormHall extends Form {
|
|||||||
$html .='</div>
|
$html .='</div>
|
||||||
<div class="column right">
|
<div class="column right">
|
||||||
<input type="submit" name="alltoone" value="Activar todos los asientos" class="button large" />
|
<input type="submit" name="alltoone" value="Activar todos los asientos" class="button large" />
|
||||||
|
<input type="submit" name="alltozero" value="Desactivar todos los asientos" class="button large" />
|
||||||
<h3 class="table_title"> Pantalla </h3>
|
<h3 class="table_title"> Pantalla </h3>
|
||||||
<table class="seat">
|
<table class="seat">
|
||||||
<thead>
|
<thead>
|
||||||
@ -189,25 +188,29 @@ class FormHall extends Form {
|
|||||||
$result['number'] = "<li> El numero de sala tiene que ser mayor que 0. </li> <br>";
|
$result['number'] = "<li> El numero de sala tiene que ser mayor que 0. </li> <br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($datos["restart"])){
|
||||||
|
return $result = "./?state=".$this->option."&number=".$this->og_hall->getNumber()."";
|
||||||
|
}
|
||||||
|
|
||||||
if (count($result) === 0 && isset($datos["sumbit"]) ) {
|
if (count($result) === 0 && isset($datos["sumbit"]) ) {
|
||||||
if($this->option == "new_hall"){
|
if($this->option == "new_hall"){
|
||||||
$_SESSION['msg'] = Hall::create_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map);
|
$_SESSION['msg'] = Hall::create_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map);
|
||||||
$result = './?state=success';
|
return $result = './?state=success';
|
||||||
}
|
}
|
||||||
if($this->option == "edit_hall"){
|
if($this->option == "edit_hall"){
|
||||||
$_SESSION['msg'] = Hall::edit_hall($number,$this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber());
|
$_SESSION['msg'] = Hall::edit_hall($number,$this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber());
|
||||||
$result = './?state=success';
|
return $result = './?state=success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($result['number']) && isset($datos["delete"]) ) {
|
if (!isset($result['number']) && isset($datos["delete"]) ) {
|
||||||
if($this->option == "edit_hall"){
|
if($this->option == "edit_hall"){
|
||||||
$_SESSION['msg'] = Hall::delete_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber());
|
$_SESSION['msg'] = Hall::delete_hall($number, $this->cinema, $rows, $cols, $seats, $seats_map, $this->og_hall->getNumber());
|
||||||
$result = './?state=success';
|
return $result = './?state=success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,64 +12,39 @@
|
|||||||
$manager = false;
|
$manager = false;
|
||||||
$manager = new Manager(null, null, null, null, null);
|
$manager = new Manager(null, null, null, null, null);
|
||||||
|
|
||||||
|
|
||||||
$state = isset($_GET['state']) ? $_GET['state'] : '';
|
$state = isset($_GET['state']) ? $_GET['state'] : '';
|
||||||
switch($state){
|
switch($state){
|
||||||
case "view_user":
|
case "view_user":
|
||||||
$_SESSION["rol"] = null;
|
|
||||||
$panel .= "<div class='row'>
|
|
||||||
<div class='column side'></div>
|
|
||||||
<div class='column middle'>
|
|
||||||
<div class='code info'>
|
|
||||||
<h1> ¡ATENCIÓN! </h1><hr />
|
|
||||||
<p>Está viendo la web como un Usuario NO Registrado.</p>
|
|
||||||
<a href=''><button>Cerrar Mensaje</button></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class='column side'></div>
|
|
||||||
</div>
|
|
||||||
";
|
|
||||||
break;
|
break;
|
||||||
case "view_ruser":
|
case "view_ruser":
|
||||||
$_SESSION["rol"] = "user";
|
|
||||||
$panel .= "<div class='row'>
|
|
||||||
<div class='column side'></div>
|
|
||||||
<div class='column middle'>
|
|
||||||
<div class='code info'>
|
|
||||||
<h1> ¡ATENCIÓN! </h1><hr />
|
|
||||||
<p>Está viendo la web como un Usuario Registrado.</p>
|
|
||||||
<a href=''><button>Cerrar Mensaje</button></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class='column side'></div>
|
|
||||||
</div>
|
|
||||||
";
|
|
||||||
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::welcomeAdmin($manager);
|
$panel = Manager_panel::welcomeAdmin($manager);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
static function welcome($manager){
|
static function welcome($manager){
|
||||||
$bd = new Cinema_DAO('complucine');
|
$bd = new Cinema_DAO('complucine');
|
||||||
if($bd){
|
if($bd){
|
||||||
$cinema = $bd->cinemaData($manager->getIdcinema());
|
$cinema = ($bd->cinemaData( $manager->getIdcinema() ) );
|
||||||
$c_name = $cinema->getName();
|
$c_name = $cinema->getId();
|
||||||
$c_dir = $cinema->getDirection();
|
$c_dir = $cinema->getId();
|
||||||
$c_tel = $cinema->getPhone();
|
$c_tel = $cinema->getId();
|
||||||
}
|
}
|
||||||
$name = strtoupper($_SESSION["nombre"]);
|
$name = strtoupper($_SESSION["nombre"]);
|
||||||
$cinema = strtoupper( $manager->getIdcinema());
|
$cinema = strtoupper( $manager->getIdcinema());
|
||||||
@ -93,20 +93,29 @@
|
|||||||
$panel .= "<h2> No hay ninguna sala en este cine";
|
$panel .= "<h2> No hay ninguna sala en este cine";
|
||||||
}else{
|
}else{
|
||||||
$panel .= '
|
$panel .= '
|
||||||
<h3 class="tablelike_title"> Salas </h3> <h3 class="tablelike_title"> Asientos </h3> <br>
|
<div class="tablelist">
|
||||||
<ul class="tablelike">
|
<u1">
|
||||||
|
<li class="title"> Salas </li>
|
||||||
|
<li class="title"> Asientos </li>
|
||||||
|
<li class="title"> Sesiones </li> <br>
|
||||||
';
|
';
|
||||||
|
$parity = "odd";
|
||||||
foreach($listhall as $hall){
|
foreach($listhall as $hall){
|
||||||
$panel .='
|
$panel .='<div class='.$parity.'>
|
||||||
<li class="tablelike"> '. $hall->getNumber().'</li>
|
<a href="?state=edit_hall&number='. $hall->getNumber().'">
|
||||||
<li class="tablelike"> '.$hall->getTotalSeats().' </li>
|
<li> '. $hall->getNumber().'</li>
|
||||||
<a class="tablelike_link" href="?state=edit_hall&number='. $hall->getNumber().'"> Editar </a>
|
<li> '.$hall->getTotalSeats().' </li>
|
||||||
<a class="tablelike_link" href="?state=manage_sessions&number='. $hall->getNumber().'"> Sessiones </a>
|
</a>
|
||||||
|
<a href="?state=manage_sessions&hall='. $hall->getNumber().'">
|
||||||
|
<li> Sessiones</li>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
';
|
';
|
||||||
|
$parity = ($parity == "odd") ? "even" : "odd";
|
||||||
}
|
}
|
||||||
$panel.='
|
$panel.='
|
||||||
</ul>';
|
</ul>
|
||||||
|
</div>';
|
||||||
}
|
}
|
||||||
$panel.='
|
$panel.='
|
||||||
<form method="post" action="./?state=new_hall">
|
<form method="post" action="./?state=new_hall">
|
||||||
@ -119,7 +128,7 @@
|
|||||||
|
|
||||||
static function new_hall($manager){
|
static function new_hall($manager){
|
||||||
|
|
||||||
$formHall = new FormHall("new_hall",$manager->getIdcinema());
|
$formHall = new FormHall("new_hall",$manager->getIdcinema(),new Hall(null, null, null, null, null, null));
|
||||||
|
|
||||||
$panel = '<h1>Crear una sala.</h1><hr/></br>
|
$panel = '<h1>Crear una sala.</h1><hr/></br>
|
||||||
'.$formHall->gestiona();
|
'.$formHall->gestiona();
|
||||||
|
Loading…
Reference in New Issue
Block a user