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 <?php
require('./includes/room_dto.php'); require('./includes/hall_dto.php');
require('./includes/session_dto.php'); require('./includes/session_dto.php');
require('../panel_admin/includes/film_dto.php'); require('../panel_admin/includes/film_dto.php');
include_once('./includes/session_dao.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 $r1 = new HallDTO(1,20,20,30); //Esto se deberia cambiar por una llamada a una lista de salas
$r2 = new RoomDTO(2,10,30,30); $r2 = new HallDTO(2,10,30,30);
$rooms = array($r1, $r2); $rooms = array($r1, $r2);
require_once('./includes/listFilms.php'); require_once('./includes/listFilms.php');
$filmList = new ListFilms(); $filmList = new Film_DAO('complucine');
$films = $filmList->getArray(); $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 //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') { if(isset($_REQUEST['option']) && $_REQUEST['option'] == 'edit') {
@ -29,10 +29,10 @@
</div> </div>
<select name=\"hall\" class=\"button large\">"; <select name=\"hall\" class=\"button large\">";
foreach($rooms as $r){ foreach($rooms as $r){
if($r->getid() == $session['idhall']){ if($r->getNumber() == $session['idhall']){
echo "<option value=\"". $r->getid() ." \"selected> Sala ". $r->getid() . "</option>"; echo "<option value=\"". $r->getNumber() ." \"selected> Sala ". $r->getNumber() . "</option>";
}else{ }else{
echo "<option value=\"". $r->getid() ." \"> Sala ". $r->getid() . "</option>"; echo "<option value=\"". $r->getNumber() ." \"> Sala ". $r->getNumber() . "</option>";
} }
} }
echo "<div class=\"_format\"> echo "<div class=\"_format\">

View File

@ -1,13 +1,13 @@
<?php <?php
require('./includes/room_dto.php'); require('./includes/hall_dto.php');
$r1 = new RoomDTO(0,20,20,30); $r1 = new HallDTO(0,20,20,30);
$r2 = new RoomDTO(1,10,30,30); $r2 = new HallDTO(1,10,30,30);
$r3 = new RoomDTO(2,30,10,30); $r3 = new HallDTO(2,30,10,30);
$r4 = new RoomDTO(3,15,15,30); $r4 = new HallDTO(3,15,15,30);
$rooms = array($r1, $r2, $r3, $r4); $rooms = array($r1, $r2, $r3, $r4);
function drawRooms($ros){ function drawHalls($ros){
echo " echo "
<table class='alt'> <table class='alt'>
<thead> <thead>
@ -22,8 +22,8 @@
<tr> <tr>
<!-- AUN NO HEMOS VISTO JAVASCRIPT --> <!-- 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 --> <!-- 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> <button type=\"button\"> Sala ". $r->getNumber() ."</button> </td> -->
<td><a href=\"\" class='button'>Sala". $r->getId() ."</a></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> <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> <td><a href=\"index.php?edit_rooms=true\" class='button'>Editar</a></td>
</tr>"; </tr>";
@ -32,6 +32,6 @@
</table>\n"; </table>\n";
echo "<a href=\"index.php?edit_sessions=true\" class='button large'>Añadir</a>"; echo "<a href=\"index.php?edit_sessions=true\" class='button large'>Añadir</a>";
} }
drawRooms($rooms); drawHalls($rooms);
?> ?>
</div> </div>

View File

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