Add files via upload
This commit is contained in:
@ -1,69 +1,84 @@
|
||||
<?php
|
||||
require('./includes/room_dto.php');
|
||||
require('./includes/session_dto.php');
|
||||
require('../panel_admin/includes/film_dto.php');
|
||||
require('../panel_admin/includes/film_dao.php');
|
||||
|
||||
//Login form validate:
|
||||
require_once('./includes/listSessions.php');
|
||||
$sessionList = new ListSessions("1", "1", "2021-04-10");
|
||||
$sessionList = new ListSessions();
|
||||
|
||||
$placeholder_date = date("Y-m-d");
|
||||
$placeholder_hall = "1";
|
||||
$filtered = false;
|
||||
|
||||
?>
|
||||
<input type="date" name="fecha" min="2021-01-01" max="2031-12-31">
|
||||
<?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);
|
||||
$rooms = array($r1, $r2, $r3, $r4);
|
||||
if(isset($_POST['submit'])) {
|
||||
$sessionList->filterList(1,$_POST["hall"],$_POST["date"]);
|
||||
$placeholder_date = $_POST["date"];
|
||||
$placeholder_hall = $_POST["hall"];
|
||||
$filtered = true;
|
||||
}
|
||||
|
||||
$sessions = $sessionList->getArray();
|
||||
|
||||
function drawRooms($ros){
|
||||
echo "<table>";
|
||||
foreach($ros as $r){
|
||||
echo "
|
||||
$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);
|
||||
$rooms = array($r1, $r2);
|
||||
echo"
|
||||
<form method=\"post\">
|
||||
<input type=\"date\" name=\"date\" value=\"". $placeholder_date . "\" min=\"2021-01-01\" max=\"2031-12-31\">
|
||||
<select name=\"hall\" class=\"button large\">";
|
||||
|
||||
foreach($rooms as $r){
|
||||
if($r->getid() == $placeholder_hall){
|
||||
echo "
|
||||
<option value=\"". $r->getid() ." \"selected> Sala ". $r->getid() . "</option>";
|
||||
}else{
|
||||
echo "
|
||||
<option value=\"". $r->getid() ." \"> Sala ". $r->getid() . "</option>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "
|
||||
<input type=\"submit\" name=\"submit\" value=\"Filtrar\" class=\"button large\" />
|
||||
</div>";
|
||||
?>
|
||||
|
||||
<div class="column side"> <?php
|
||||
function drawSessions($ses,$bd){
|
||||
echo "
|
||||
<table class='alt'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td> <button type=\"button\"> Sala ". $r->getId() ."</button> </td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
</table>\n";
|
||||
}
|
||||
drawRooms($rooms);
|
||||
?>
|
||||
</div>
|
||||
<div class="column side">
|
||||
<?php
|
||||
$sessionList->filterList();
|
||||
$sessions = $sessionList->getArray();
|
||||
|
||||
function drawSessions($ses){
|
||||
|
||||
echo "
|
||||
<table class='alt'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hora</th>
|
||||
<th>idPelícula</th>
|
||||
<th>Formato</th>
|
||||
<th>Precio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
foreach($ses as $s){
|
||||
echo "
|
||||
|
||||
<tr>
|
||||
|
||||
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getStartTime() . "</a></td>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getIdfilm() . "</a></td>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getFormat() . "</a></td>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">". $s->getSeatPrice() . "</a></td>
|
||||
|
||||
</tr>"
|
||||
;
|
||||
}
|
||||
echo "<tbody>
|
||||
</table>\n";
|
||||
echo "<a href=\"./?state=edit_session&option=new\" class='button large'>Añadir</a>";
|
||||
}
|
||||
drawSessions($sessions);
|
||||
?>
|
||||
</div>
|
||||
<th>Hora</th>
|
||||
<th>Pelicula</th>
|
||||
<th>Formato</th>
|
||||
<th>Precio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
foreach($ses as $s){
|
||||
$fila = ($bd->FilmData($s->getIdfilm()))->fetch_assoc();
|
||||
echo "
|
||||
<tr>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getStartTime() . "</a></td>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">" .$fila['tittle'] . "</a></td>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">" . $s->getFormat() . "</a></td>
|
||||
<td><a href=\"./?state=edit_session&option=edit\">". $s->getSeatPrice() . "</a></td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
<tbody>
|
||||
</table>";
|
||||
}
|
||||
if($filtered){
|
||||
$bd = new Film_DAO('complucine');
|
||||
if($bd){
|
||||
drawSessions($sessions,$bd);
|
||||
echo "
|
||||
<input type=\"submit\" name=\"submit\" value=\"Añadir\" class=\"button large\" formaction=\"./?state=edit_session&option=new\"/>\n";
|
||||
}
|
||||
}
|
||||
echo " </form>
|
||||
</div>";
|
||||
?>
|
||||
|
||||
|
Reference in New Issue
Block a user