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"){ }else if($this->option == "list"){
$this->reply = $this->sessions; $this->reply = $this->sessions;
} }
} else { } else if($this->correct == false) {
$this->reply = "<h1> ERROR </h1><hr /> $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> <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>"; <a href='../panel_manager/index.php'><button>Panel Gerente</button></a>";

View File

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

View File

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

View File

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