SW/panel_manager/edit_sessions.php

140 lines
5.5 KiB
PHP
Raw Normal View History

<?php
//General Config File:
2021-04-15 21:43:06 +02:00
require_once('../assets/php/config.php');
include_once('./includes/formHall.php');
require_once('./includes/hall_dto.php');
require_once('./includes/session_dto.php');
2021-04-11 19:55:21 +02:00
include_once('./includes/session_dao.php');
require_once('../panel_admin/includes/film_dto.php');
include_once('../panel_admin/includes/film_dao.php');
$formHall = new FormHall();
2021-04-15 22:34:33 +02:00
$formHall->processesForm(null, $_SESSION["cinema"], null, null, "list");
2021-04-11 17:58:01 +02:00
2021-04-12 17:21:59 +02:00
$filmList = new Film_DAO('complucine');
2021-04-15 21:43:06 +02:00
if($filmList){
$films = $filmList->allFilmData();
}else {
$films = null;
}
2021-04-11 17:58:01 +02:00
2021-04-15 21:43:06 +02:00
if(isset($_REQUEST['option']) && $_REQUEST['option'] == 'edit') {
2021-04-15 22:34:33 +02:00
$_SESSION["hall"] = $_POST['hall'];
$_SESSION["date"] = $_POST['date'];
$_SESSION["start"] = $_POST['start'];
2021-04-15 21:43:06 +02:00
echo " <div class = \"column middle\">
<h2>Editar/Eliminar Sesion</h2>
<form method=\"post\" id=\"edit_ses\" action=\"validateSession.php\">
<div class=\"row\">
<fieldset id=\"datos\">
<legend>Datos</legend>
<div class=\"_price\">
2021-04-16 12:57:10 +02:00
<input type=\"number\" name=\"price\" id=\"price\" value=\"". $_POST['price'] ."\"min=\"0\" placeholder=\"Precio de la entrada\" required/>
2021-04-15 21:43:06 +02:00
</div>
<select name=\"hall\" class=\"button large\">";
foreach($formHall->getReply() as $r){
if($r->getNumber() == $_POST['hall']){
echo "<option value=\"". $r->getNumber() ." \"selected> Sala ". $r->getNumber() . "</option>";
}else{
echo "<option value=\"". $r->getNumber() ." \"> Sala ". $r->getNumber() . "</option>";
}
}
echo "
<div class=\"_format\">
<input type=\"text\" name=\"format\" id=\"format\" value=\"". $_POST['format'] ."\" placeholder=\"Formato\" required/>
</div>
</fieldset>
<fieldset id=\"Horario\">
<legend>Horario</legend>
<div class=\"_start_time\">
<input type=\"time\" name=\"start\" id=\"start_time\" value=\"". $_POST['start'] ."\" placeholder=\"Hora de inicio\" required/>
</div>
<div class=\"_date\">
<input type=\"date\" name=\"date\" id=\"date\" value=\"". $_POST['date'] ."\"Fecha de inicio\" required/>
</div>
</fieldset>
<div class=\"actions\">
<input type=\"submit\" name=\"edit\" value=\"Editar\" class=\"button\" />
<input type=\"reset\" id=\"reset\" value=\"Limpiar\" />
<input type=\"submit\" name=\"del\" value=\"Eliminar\" class=\"button\" />
2021-04-11 19:55:21 +02:00
</div>
</div>
2021-04-15 21:43:06 +02:00
</form>
<div>
<div class=\"column side\">
<select name=\"film\" form=\"edit_ses\" class=\"button large\">\n";
2021-04-11 19:55:21 +02:00
foreach($films as $f){
if($f->getId() == $_POST['idfilm']){
2021-04-15 21:43:06 +02:00
echo " <option value=\"". $f->getId() ." \"selected> " . $f->getId() . "|" . $f->getTittle() ." Idioma: " . $f->getLanguage() . "</option>\n";
2021-04-11 19:55:21 +02:00
}else{
2021-04-15 21:43:06 +02:00
echo " <option value=\"". $f->getId() ." \"> " . $f->getId() . "|" . $f->getTittle() ." Idioma: " . $f->getLanguage() . "</option>\n";
2021-04-11 19:55:21 +02:00
}
}
2021-04-15 21:43:06 +02:00
echo " </div>";
2021-04-11 19:55:21 +02:00
}
else{
2021-04-15 21:43:06 +02:00
echo " <div class = \"column middle\">
<h2>Crear Sesion</h2>
<form method=\"post\" id=\"new_ses\" action=\"validateSession.php\">
<div class=\"row\">
<fieldset id=\"datos\">
<legend>Datos</legend>
<input type=\"hidden\" name=\"cinema\" value =\"1\" />
<div class=\"_price\">
2021-04-16 12:57:10 +02:00
<input type=\"number\" name=\"price\" id=\"price\" min=\"0\" placeholder=\"Precio de la entrada\" required/>
2021-04-15 21:43:06 +02:00
</div>
<select name=\"hall\" class=\"button large\">";
foreach($formHall->getReply() as $r){
if($r->getNumber() == $_POST['hall']){
echo "
<option value=\"". $r->getNumber() ." \"selected> Sala ". $r->getNumber() . "</option>";
}else{
echo "
<option value=\"". $r->getNumber() ." \"> Sala ". $r->getNumber() . "</option>";
}
2021-04-11 17:58:01 +02:00
}
2021-04-15 21:43:06 +02:00
echo "
<div class=\"_format\">
<input type=\"text\" name=\"format\" id=\"format\" value=\"\" placeholder=\"Formato\" required/>
</div>
</fieldset>
<fieldset id=\"Horario\">
<legend>Horario</legend>
<div class=\"_start_time\">
<input type=\"time\" name=\"start\" id=\"start_time\" value=\"\" placeholder=\"Hora de inicio\" required/>
</div>
<div class=\"_date\">
<input type=\"date\" name=\"date\" id=\"date\" value=\"". $_POST['date'] . "\"Fecha de inicio\" required/>
</div>
<div class=\"_repeat\">
<br> Introducir un numero para añadir esta sesion a los futuros X dias
<input type=\"number\" name=\"repeat\" id=\"repeat\" title=\"Repetir esta sesion durante X dias\" min=\"0\" max=\"31\" placeholder=\"Repetir X dias\"/>
</div>
</fieldset>
<div class=\"actions\">
<input type=\"submit\" name=\"new\" value=\"Añadir\" class=\"primary\" />
<input type=\"reset\" id=\"reset\" value=\"Limpiar\" />
2021-04-11 19:55:21 +02:00
</div>
</div>
2021-04-15 21:43:06 +02:00
</form>
<div>
<div class=\"column side\">
<select name=\"film\" form=\"new_ses\" class=\"button large\">\n";
2021-04-11 17:58:01 +02:00
foreach($films as $f){
2021-04-15 21:43:06 +02:00
echo " <option value=\"". $f->getId() ." \"> " . $f->getId() . "|" . $f->getTittle() ." Idioma: " . $f->getLanguage() . "</option>\n";
2021-04-11 17:58:01 +02:00
}
2021-04-15 21:43:06 +02:00
echo " </div>";
}
2021-04-11 17:58:01 +02:00
?>
2021-04-08 18:02:25 +02:00