Add files via upload

This commit is contained in:
Markines16 2021-04-14 19:59:52 +02:00 committed by GitHub
parent 1c43a649c9
commit 3e7378d9d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 22 deletions

View File

@ -37,7 +37,7 @@ class FormSession extends Form {
}else if($this->option == "list"){
$this->reply = $this->sessions;
}
} else {
} else if($this->correct == false) {
$this->reply = "<h1> ERROR </h1><hr />
<p> Ha habido un error en la operacion. Revisa los datos introducidos o ponte en contacto con el administrador de la base de datos.</p>
<a href='../panel_manager/index.php'><button>Panel Gerente</button></a>";

View File

@ -3,9 +3,11 @@
session_start();
require_once('../assets/php/template.php');
require_once('./panel_manager.php');
$template = new Template();
$prefix = $template->get_prefix();
include_once('panel_manager.php');
$login = false;
if(isset($_SESSION["login"]) && $_SESSION["nombre"] == "manager") $login = true;

View File

@ -5,30 +5,31 @@
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('../assets/php/template.php');
$template = new Template();
$prefix = $template->get_prefix();
require($prefix.'panel_admin/includes/film_dto.php');
require($prefix.'/panel_admin/includes/film_dao.php');
$formSession = new FormSession();
$formHall = new FormHall();
$placeholder_date = date("Y-m-d");
$placeholder_hall = "1";
$filtered = false;
$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");
}
$formHall->processesForm(null, $cinema, null, null, "list");
$formSession->processesForm(null, null, $placeholder_hall, $cinema, $placeholder_date, null, null, null, null, "list");
echo" <form method=\"post\">
<!--Session Filter -->
<div class = \"column middle\">
<div class = \"column left\">
<input type=\"date\" name=\"date\" value=\"". $placeholder_date . "\" min=\"2021-01-01\" max=\"2031-12-31\">
<select name=\"hall\" class=\"button large\">";
@ -45,9 +46,9 @@
echo "
<input type=\"submit\" name=\"filter\" value=\"Filtrar\" class=\"button large\" />
</div>";
function drawSessions($sessions){
function drawSessions($sessions,$bd){
echo " <!--Session List -->
<div class=\"column side\">
<div class=\"column right\">
<table class='alt'>
<thead>
<tr>
@ -59,11 +60,13 @@
</thead>
<tbody>";
foreach($sessions as $s){
$film = mysqli_fetch_array($bd->FilmData($s->getIdfilm()));
echo "
<tr>
<td> " . $s->getStartTime() . "</a></td>
<td> " . $s->getIdfilm() . "</a></td>
<td> ". $s->getSeatPrice() . "</a></td>
<td> " . date('H:i', strtotime( $s->getStartTime())) . "</a></td>
<td> " . str_replace('_', ' ', $film["tittle"]) . "</a></td>
<td> " . $s->getFormat() . "</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>";
}
@ -74,12 +77,20 @@
</div>";
}
if($formSession->getReply() != null){
drawSessions($formSession->getReply());
if($formSession->getReply()){
$bd = new Film_DAO('complucine');
if($bd){
drawSessions($formSession->getReply(), $bd);
} else {
echo "<div class=\"column side\">
<p> Hay un error en la conexion </p>
</div>";
}
} else {
echo "<div class=\"column side\">
<p> No hay ninguna session en la sala ". $placeholder_hall . " el dia ". $placeholder_date . "</p>
";
<input type=\"submit\" name=\"submit\" value=\"Añadir\" class=\"button large\" formaction=\"./?state=edit_session&option=new\">
</div>";
}
echo "

View File

@ -6,6 +6,7 @@
function __construct($panel,$log){
$this->state = $panel;
$this->login = $log;
}
function showPanel() {