Cambios a la estructura del índex y sus vistas

This commit is contained in:
Markines16 2021-04-13 21:16:07 +02:00 committed by GitHub
parent b0cf43c313
commit e716de272f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 160 additions and 73 deletions

View File

@ -18,7 +18,7 @@
if($bd){
$session = ($bd->sessionData($_GET["id"]))->fetch_assoc();
echo "<h2>Editar/Eliminar Sesion</h2>
<form method=\"post\" id=\"new_ses\" action=\"validate.php\">
<form method=\"post\" id=\"edit_ses\" action=\"validate.php\">
<div class=\"row\">
<fieldset id=\"datos\">
<legend>Datos</legend>
@ -61,7 +61,7 @@
</form>
<div>
<div class=\"column side\">
<select name=\"film\" form=\"new_ses\" class=\"button large\">";
<select name=\"film\" form=\"edit_ses\" class=\"button large\">";
foreach($films as $f){
if($f->getId() == $session['idfilm']){
echo "<option value=\"". $f->getId() ." \"selected> " . $f->getId() . "|" . $f->getTittle() ." Idioma: " . $f->getLanguage() . "</option>";
@ -74,7 +74,7 @@
}
else{
echo "<h2>Crear Sesion</h2>
<form method=\"post\" id=\"new_ses\" action=\"validate.php\">
<form method=\"post\" id=\"new_ses\" action=\"validateSession.php\">
<div class=\"row\">
<fieldset id=\"datos\">
<legend>Datos</legend>

View File

@ -0,0 +1,5 @@
<div class="column middle">
<h1> Bienvenido al panel de Gerente </h1>
<br>
<p> Espero que este pasando un buen dia <p>
</div>

View File

@ -58,9 +58,8 @@
</ul>
</div>
<!--Contents -->
<div class="row">
<div class="column middle">
<?php $panel->showPanel(); ?>
<div class="row">
<?php $panel->showPanel(); ?>
</div>
</div>
<!-- Footer -->

View File

@ -9,6 +9,7 @@
function drawHalls($ros){
echo "
<div class=\"column middle\">
<table class='alt'>
<thead>
<tr>
@ -30,8 +31,9 @@
}
echo "<tbody>
</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>
</div>";
}
drawHalls($rooms);
?>
</div>

View File

@ -1,34 +1,38 @@
<?php
require('./includes/hall_dto.php');
require('./includes/formHall.php');
require('./includes/session_dto.php');
require('./includes/formSession.php');
require('../panel_admin/includes/film_dto.php');
require('../panel_admin/includes/film_dao.php');
require_once('./includes/listSessions.php');
$sessionList = new ListSessions();
$formSession = new FormSession();
$formHall = new FormHall();
$placeholder_date = date("Y-m-d");
$placeholder_hall = "1";
$filtered = false;
if(isset($_POST['submit'])) {
$sessionList->filterList(1,$_POST["hall"],$_POST["date"]);
$cinema = "1";
$formHall->processesForm(null, $cinema, null, null, "list");
if(isset($_POST['filter'])) {
$placeholder_date = $_POST["date"];
$placeholder_hall = $_POST["hall"];
$filtered = true;
$formSession->processesForm(null, null, $placeholder_hall, $cinema, $placeholder_date, null, null, null, null, "list");
}
$sessions = $sessionList->getArray();
$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\">
echo" <form method=\"post\">
<!--Session Filter -->
<div class = \"column middle\">
<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){
foreach($formHall->getReply() as $r){
if($r->getNumber() == $placeholder_hall){
echo "
<option value=\"". $r->getNumber() ." \"selected> Sala ". $r->getNumber() . "</option>";
@ -39,47 +43,46 @@
}
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>
<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();
<input type=\"submit\" name=\"filter\" value=\"Filtrar\" class=\"button large\" />
</div>";
function drawSessions($sessions){
echo " <!--Session List -->
<div class=\"column side\">
<table class='alt'>
<thead>
<tr>
<th>Hora</th>
<th>Pelicula</th>
<th>Formato</th>
<th>Precio</th>
</tr>
</thead>
<tbody>";
foreach($sessions as $s){
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->getSeatPrice() . "</a></td>
<td> <input type=\"submit\" name=\"submit\" value=\"Editar\" class=\"button\" formaction=\"./?state=edit_session&option=edit&id=". $s->getid() ."\"/> </td>
</tr>";
<tr>
<td> " . $s->getStartTime() . "</a></td>
<td> " . $s->getIdfilm() . "</a></td>
<td> ". $s->getSeatPrice() . "</a></td>
<td> <input type=\"submit\" name=\"submit\" value=\"Editar\" class=\"button\" formaction=\"./?state=edit_session&option=edit&id=". $s->getid() ."\"/> </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\">";
}
<tbody>
</table>
<input type=\"submit\" name=\"submit\" value=\"Añadir\" class=\"button large\" formaction=\"./?state=edit_session&option=new\">
</div>";
}
echo " </form>
</div>";
if($formSession->getReply() != null){
drawSessions($formSession->getReply());
} else {
echo "<div class=\"column side\">
<p> No hay ninguna session en la sala ". $placeholder_hall . " el dia ". $placeholder_date . "</p>
";
}
echo "
</form>";
?>

View File

@ -0,0 +1,5 @@
<div class="column middle">
<h1> Entrada Impedida </h1>
<br>
<p> No estas logeado como gerente >.< </p>
</div>

View File

@ -16,17 +16,11 @@
case 'rooms': require('manage_rooms.php'); break;
case 'sessions': require('manage_sessions.php'); break;
case 'edit_session': require('edit_sessions.php'); break;
default: echo "<h1>BIENVENIDO AL PANEL DE GERENTE </h1>
<br>
<p> Espero que este pasando un buen dia </p>
</div>"; break;
default: require('hello_panel.php'); break;
}
}
else{
echo "<h1>ERROR </h1>
<br>
<p> No tiene permiso en esta sección de la pagina web </p>
</div>";
require('no_permisions_panel.php');
}
}
}

View File

@ -1,4 +1,6 @@
<h1> Vista de usuario registrado </h1>
<br>
<p> Esta vista aun no esta implementada </p>
<div class="column middle">
<h1> Vista de usuario registrado </h1>
<br>
<p> Esta vista aun no esta implementada </p>
</div>

View File

@ -1,3 +1,6 @@
<h1> Vista de usuario no registrado </h1>
<br>
<p> Esta vista aun no esta implementada </p>
<div class="column middle">
<h1> Vista de usuario no registrado </h1>
<br>
<p> Esta vista aun no esta implementada </p>
</div>

View File

@ -0,0 +1,74 @@
<?php
session_start();
//Depuración (BORRAR):
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//HTML template:
require_once('../assets/php/template.php');
$template = new Template();
$action ="";
$id = null;
if(isset($_POST['new'])){
$action = "new";
} else if (isset($_POST['edit'])){
$action = "edit";
$id = $_POST["id"];
} else if (isset($_POST['del'])){
$action = "del";
$id = $_POST["id"];
}
//Login form validate:
require_once('./includes/formSession.php');
$session = new FormSession();
$session->processesForm($id, $_POST["film"], $_POST["hall"], $_POST["cinema"],$_POST["date"],$_POST["start"],$_POST["price"],$_POST["format"],$_POST["repeat"], $action);
$reply = $session->getReply();
?>
<!DOCTYPE HTML>
<!--
Práctica 2 - Sistemas Web | Grupo D
CompluCine - FDI-cines
-->
<html lang="es">
<!-- Head -->
<?php
$template->print_head();
?>
<body>
<!-- Header -->
<?php
$template->print_header();
?>
<!-- Main -->
<div class="main">
<div class="image"><img src="../img/logo_trasparente.png" /></div>
</div>
<!-- Reply -->
<section class="reply">
<div class ="row">
<div class="column side"></div>
<div class="column middle">
<div class="code info">
<?php
echo $reply;
?>
</div>
</div>
<div class="column side"></div>
</div>
</section>
<!-- Footer -->
<?php
$template->print_footer();
?>
</body>
</html>