Add files via upload

This commit is contained in:
OscarRui 2021-04-12 17:21:59 +02:00 committed by GitHub
parent e0ff3aed42
commit cc841917df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 23 deletions

View File

@ -1,16 +1,16 @@
<?php
require('./includes/room_dto.php');
require('./includes/hall_dto.php');
require('./includes/session_dto.php');
require('../panel_admin/includes/film_dto.php');
include_once('./includes/session_dao.php');
$r1 = new RoomDTO(1,20,20,30); //Esto se deberia cambiar por una llamada a una lista de salas
$r2 = new RoomDTO(2,10,30,30);
$r1 = new HallDTO(1,20,20,30); //Esto se deberia cambiar por una llamada a una lista de salas
$r2 = new HallDTO(2,10,30,30);
$rooms = array($r1, $r2);
require_once('./includes/listFilms.php');
$filmList = new ListFilms();
$films = $filmList->getArray();
$filmList = new Film_DAO('complucine');
$films = $filmList->allFilmData();
//DISCLAIMER; sabemos que si se edita la ulr se pueden acceder a datos de una sesion que no pertenece al usuario y que incluso puede hasta editarlas/borrarlas en la base de datos
if(isset($_REQUEST['option']) && $_REQUEST['option'] == 'edit') {
@ -29,10 +29,10 @@
</div>
<select name=\"hall\" class=\"button large\">";
foreach($rooms as $r){
if($r->getid() == $session['idhall']){
echo "<option value=\"". $r->getid() ." \"selected> Sala ". $r->getid() . "</option>";
if($r->getNumber() == $session['idhall']){
echo "<option value=\"". $r->getNumber() ." \"selected> Sala ". $r->getNumber() . "</option>";
}else{
echo "<option value=\"". $r->getid() ." \"> Sala ". $r->getid() . "</option>";
echo "<option value=\"". $r->getNumber() ." \"> Sala ". $r->getNumber() . "</option>";
}
}
echo "<div class=\"_format\">

View File

@ -1,13 +1,13 @@
<?php
require('./includes/room_dto.php');
require('./includes/hall_dto.php');
$r1 = new RoomDTO(0,20,20,30);
$r2 = new RoomDTO(1,10,30,30);
$r3 = new RoomDTO(2,30,10,30);
$r4 = new RoomDTO(3,15,15,30);
$r1 = new HallDTO(0,20,20,30);
$r2 = new HallDTO(1,10,30,30);
$r3 = new HallDTO(2,30,10,30);
$r4 = new HallDTO(3,15,15,30);
$rooms = array($r1, $r2, $r3, $r4);
function drawRooms($ros){
function drawHalls($ros){
echo "
<table class='alt'>
<thead>
@ -22,8 +22,8 @@
<tr>
<!-- AUN NO HEMOS VISTO JAVASCRIPT -->
<!-- ADEMÁS, AUNQUE USÁSEMOS JS, ESO NO SE HARÍA CON UN WINDOWS.LOCATION.HREF, DE MOMENTO, USAD LOS BOTONES COMO OS PONGO EL DE AÑADIR -->
<!--<td> <button type=\"button\"> Sala ". $r->getId() ."</button> </td> -->
<td><a href=\"\" class='button'>Sala". $r->getId() ."</a></td>
<!--<td> <button type=\"button\"> Sala ". $r->getNumber() ."</button> </td> -->
<td><a href=\"\" class='button'>Sala". $r->getNumber() ."</a></td>
<!--<td> <button type=\"button\" onClick=\"Javascript:window.location.href = 'index.php?edit_rooms=true';\")\">Editar</button> </td> MAL, POR LO MISMO-->
<td><a href=\"index.php?edit_rooms=true\" class='button'>Editar</a></td>
</tr>";
@ -32,6 +32,6 @@
</table>\n";
echo "<a href=\"index.php?edit_sessions=true\" class='button large'>Añadir</a>";
}
drawRooms($rooms);
drawHalls($rooms);
?>
</div>

View File

@ -1,5 +1,5 @@
<?php
require('./includes/room_dto.php');
require('./includes/hall_dto.php');
require('./includes/session_dto.php');
require('../panel_admin/includes/film_dto.php');
require('../panel_admin/includes/film_dao.php');
@ -20,8 +20,8 @@
$sessions = $sessionList->getArray();
$r1 = new RoomDTO(1,20,20,30); //Esto se deberia cambiar por una llamada a una lista de salas
$r2 = new RoomDTO(2,10,30,30);
$r1 = new HallDTO(1,20,20,30); //Esto se deberia cambiar por una llamada a una lista de salas
$r2 = new HallDTO(2,10,30,30);
$rooms = array($r1, $r2);
echo"
<form method=\"post\">
@ -29,12 +29,12 @@
<select name=\"hall\" class=\"button large\">";
foreach($rooms as $r){
if($r->getid() == $placeholder_hall){
if($r->getNumber() == $placeholder_hall){
echo "
<option value=\"". $r->getid() ." \"selected> Sala ". $r->getid() . "</option>";
<option value=\"". $r->getNumber() ." \"selected> Sala ". $r->getNumber() . "</option>";
}else{
echo "
<option value=\"". $r->getid() ." \"> Sala ". $r->getid() . "</option>";
<option value=\"". $r->getNumber() ." \"> Sala ". $r->getNumber() . "</option>";
}
}