Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-14 16:53:59 +02:00 committed by GitHub
parent fdf0a17edd
commit 62038f6f51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 348 additions and 167 deletions

View File

@ -297,7 +297,7 @@
.code a {
text-decoration: underline;
}
.code ul, .code ol {
.code ul, .code ol, .code li{
color: #dadada;
}
.code img{

View File

@ -296,7 +296,7 @@ main img {
.code a {
text-decoration: underline;
}
.code ul, .code ol {
.code ul, .code ol, .code li {
color: #dadada;
}
.code img{

View File

@ -49,7 +49,7 @@ table.seat td:first-child {
background:url('../../img/seat_green.png') no-repeat;
}
button, .black.button {
.black.button {
width: 100%;
height: 30px;
border: 1px solid #dadada;
@ -62,7 +62,7 @@ button, .black.button {
box-shadow: 2px 2px #1f2c3d;
cursor: pointer;
}
button:hover, .black.button:hover {
.black.button:hover {
border:#000000;
background-color: #791515;
}

View File

@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 30-04-2021 a las 21:59:24
-- Tiempo de generación: 14-05-2021 a las 11:28:23
-- Versión del servidor: 10.0.28-MariaDB-2+b1
-- Versión de PHP: 7.3.27-1~deb10u1
@ -48,7 +48,8 @@ CREATE TABLE `cinema` (
--
INSERT INTO `cinema` (`id`, `name`, `direction`, `phone`) VALUES
(1, 'Cinema 1st', 'no tiene direccion', '666666666');
(1, 'Cinema 1st', 'Calle de ejemplo 111', '77777777'),
(3, 'Cinema 2st', 'Calle falsa 123', '123456789');
-- --------------------------------------------------------
@ -61,24 +62,25 @@ CREATE TABLE `film` (
`tittle` varchar(60) NOT NULL,
`duration` int(3) UNSIGNED NOT NULL,
`language` varchar(30) NOT NULL,
`description` text NOT NULL
`description` text NOT NULL,
`img` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `film`
--
INSERT INTO `film` (`id`, `tittle`, `duration`, `language`, `description`) VALUES
(1, 'iron_man', 120, 'spanish', 'Un empresario millonario construye un traje blindado y lo usa para combatir el crimen y el terrorismo.'),
(2, 'iron_man_2', 120, 'spanish', 'Con el mundo ahora consciente de que él es Iron Man, el millonario inventor Tony Stark debe forjar nuevas alianzas y confrontar a un enemigo nuevo y poderoso.'),
(3, 'iron_man_3', 120, 'spanish', 'El descarado y brillante Tony Stark, tras ver destruido todo su universo personal, debe encontrar y enfrentarse a un enemigo cuyo poder no conoce límites. Este viaje pondrá a prueba su entereza una y otra vez, y le obligará a confiar en su ingenio.'),
(4, 'capitan_america_el_primer_vengador', 120, 'spanish', 'Tras tres meses de someterse a un programa de entrenamiento físico y táctico, encomiendan a Steve Rogers su primera misión como Capitán América. Armado con un escudo indestructible, emprende la guerra contra la perversa organización HYDRA.'),
(5, 'capitan_america_el_soldado_de_invierno', 120, 'spanish', 'Capitán América, Viuda Negra y un nuevo aliado, Falcon, se enfrentan a un enemigo inesperado mientras intentan exponer una conspiración que pone en riesgo al mundo.'),
(6, 'capitan_america_civil_war', 180, 'spanish', 'Después de que otro incidente internacional, en el que se ven envueltos los Vengadores, produzca daños colaterales, la presión política obliga a poner en marcha un sistema para depurar responsabilidades.'),
(7, 'marvel_avengers', 120, 'spanish', 'El director de la Agencia SHIELD decide reclutar a un equipo para salvar al mundo de un desastre casi seguro cuando un enemigo inesperado surge como una gran amenaza para la seguridad mundial.'),
(8, 'avengers_age_of_ultron', 120, 'spanish', 'Los Vengadores se reúnen de nuevo y juntan sus fuerzas con las de los recién llegados Quicksilver y Bruja Escarlata para luchar contra un robot maquiavélico llamado Ultrón, el cual Tony Stark creó con el fin de defender la paz, pero resultó defectuoso y ahora pretende exterminar a toda la humanidad.'),
(9, 'avengers_inifinity_war', 180, 'spanish', 'Los superhéroes se alían para vencer al poderoso Thanos, el peor enemigo al que se han enfrentado. Si Thanos logra reunir las seis gemas del infinito: poder, tiempo, alma, realidad, mente y espacio, nadie podrá detenerlo.'),
(10, 'avengers_end_game', 180, 'spanish', 'Los Vengadores restantes deben encontrar una manera de recuperar a sus aliados para un enfrentamiento épico con Thanos, el malvado que diezmó el planeta y el universo.');
INSERT INTO `film` (`id`, `tittle`, `duration`, `language`, `description`, `img`) VALUES
(1, 'iron_man', 120, 'spanish', 'Un empresario millonario construye un traje blindado y lo usa para combatir el crimen y el terrorismo.', ''),
(2, 'iron_man_2', 120, 'spanish', 'Con el mundo ahora consciente de que él es Iron Man, el millonario inventor Tony Stark debe forjar nuevas alianzas y confrontar a un enemigo nuevo y poderoso.', ''),
(3, 'iron_man_3', 120, 'spanish', 'El descarado y brillante Tony Stark, tras ver destruido todo su universo personal, debe encontrar y enfrentarse a un enemigo cuyo poder no conoce límites. Este viaje pondrá a prueba su entereza una y otra vez, y le obligará a confiar en su ingenio.', ''),
(4, 'capitan_america_el_primer_vengador', 120, 'spanish', 'Tras tres meses de someterse a un programa de entrenamiento físico y táctico, encomiendan a Steve Rogers su primera misión como Capitán América. Armado con un escudo indestructible, emprende la guerra contra la perversa organización HYDRA.', ''),
(5, 'capitan_america_el_soldado_de_invierno', 120, 'spanish', 'Capitán América, Viuda Negra y un nuevo aliado, Falcon, se enfrentan a un enemigo inesperado mientras intentan exponer una conspiración que pone en riesgo al mundo.', ''),
(6, 'capitan_america_civil_war', 180, 'spanish', 'Después de que otro incidente internacional, en el que se ven envueltos los Vengadores, produzca daños colaterales, la presión política obliga a poner en marcha un sistema para depurar responsabilidades.', ''),
(7, 'marvel_avengers', 120, 'spanish', 'El director de la Agencia SHIELD decide reclutar a un equipo para salvar al mundo de un desastre casi seguro cuando un enemigo inesperado surge como una gran amenaza para la seguridad mundial.', ''),
(8, 'avengers_age_of_ultron', 120, 'spanish', 'Los Vengadores se reúnen de nuevo y juntan sus fuerzas con las de los recién llegados Quicksilver y Bruja Escarlata para luchar contra un robot maquiavélico llamado Ultrón, el cual Tony Stark creó con el fin de defender la paz, pero resultó defectuoso y ahora pretende exterminar a toda la humanidad.', ''),
(9, 'avengers_inifinity_war', 180, 'spanish', 'Los superhéroes se alían para vencer al poderoso Thanos, el peor enemigo al que se han enfrentado. Si Thanos logra reunir las seis gemas del infinito: poder, tiempo, alma, realidad, mente y espacio, nadie podrá detenerlo.', ''),
(10, 'avengers_end_game', 180, 'spanish', 'Los Vengadores restantes deben encontrar una manera de recuperar a sus aliados para un enfrentamiento épico con Thanos, el malvado que diezmó el planeta y el universo.', '');
-- --------------------------------------------------------
@ -90,17 +92,17 @@ CREATE TABLE `hall` (
`number` int(15) UNSIGNED NOT NULL,
`idcinema` int(15) UNSIGNED NOT NULL,
`numrows` int(3) NOT NULL,
`numcolumns` int(3) NOT NULL
`numcolumns` int(3) NOT NULL,
`total_seats` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `hall`
--
INSERT INTO `hall` (`number`, `idcinema`, `numrows`, `numcolumns`) VALUES
(1, 1, 20, 20),
(2, 1, 20, 20),
(3, 1, 20, 20);
INSERT INTO `hall` (`number`, `idcinema`, `numrows`, `numcolumns`, `total_seats`) VALUES
(1, 1, 12, 8, 60),
(2, 1, 14, 8, 97);
-- --------------------------------------------------------
@ -113,6 +115,13 @@ CREATE TABLE `manager` (
`idcinema` int(15) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `manager`
--
INSERT INTO `manager` (`id`, `idcinema`) VALUES
(1, 1);
-- --------------------------------------------------------
--
@ -127,6 +136,14 @@ CREATE TABLE `promotion` (
`active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `promotion`
--
INSERT INTO `promotion` (`id`, `tittle`, `description`, `code`, `active`) VALUES
(1, '3x2', 'en entradas', '000001A', 0),
(2, 'Promocion de ejemplo', 'Esto es un ejemplo', '1234', 0);
-- --------------------------------------------------------
--
@ -157,6 +174,220 @@ CREATE TABLE `seat` (
`active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `seat`
--
INSERT INTO `seat` (`idhall`, `idcinema`, `numrow`, `numcolum`, `active`) VALUES
(1, 1, 1, 1, 0),
(1, 1, 1, 2, 0),
(1, 1, 1, 3, 0),
(1, 1, 1, 4, -1),
(1, 1, 1, 5, -1),
(1, 1, 1, 6, 0),
(1, 1, 1, 7, 0),
(1, 1, 1, 8, 0),
(1, 1, 2, 1, 0),
(1, 1, 2, 2, 0),
(1, 1, 2, 3, 0),
(1, 1, 2, 4, -1),
(1, 1, 2, 5, -1),
(1, 1, 2, 6, 0),
(1, 1, 2, 7, 0),
(1, 1, 2, 8, 0),
(1, 1, 3, 1, 0),
(1, 1, 3, 2, 0),
(1, 1, 3, 3, 0),
(1, 1, 3, 4, -1),
(1, 1, 3, 5, -1),
(1, 1, 3, 6, 0),
(1, 1, 3, 7, 0),
(1, 1, 3, 8, 0),
(1, 1, 4, 1, -1),
(1, 1, 4, 2, -1),
(1, 1, 4, 3, -1),
(1, 1, 4, 4, -1),
(1, 1, 4, 5, -1),
(1, 1, 4, 6, -1),
(1, 1, 4, 7, -1),
(1, 1, 4, 8, -1),
(1, 1, 5, 1, -1),
(1, 1, 5, 2, -1),
(1, 1, 5, 3, -1),
(1, 1, 5, 4, -1),
(1, 1, 5, 5, -1),
(1, 1, 5, 6, -1),
(1, 1, 5, 7, -1),
(1, 1, 5, 8, -1),
(1, 1, 6, 1, 0),
(1, 1, 6, 2, 0),
(1, 1, 6, 3, 0),
(1, 1, 6, 4, -1),
(1, 1, 6, 5, -1),
(1, 1, 6, 6, 0),
(1, 1, 6, 7, 0),
(1, 1, 6, 8, 0),
(1, 1, 7, 1, 0),
(1, 1, 7, 2, 0),
(1, 1, 7, 3, 0),
(1, 1, 7, 4, -1),
(1, 1, 7, 5, -1),
(1, 1, 7, 6, 0),
(1, 1, 7, 7, 0),
(1, 1, 7, 8, 0),
(1, 1, 8, 1, 0),
(1, 1, 8, 2, 0),
(1,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 1, 12, 3, 1),
(2, 1, 12, 4, 1),
(2, 1, 12, 5, 1),
(2, 1, 12, 6, 1),
(2, 1, 12, 7, 1),
(2, 1, 12, 8, 1),
(2, 1, 13, 1, 1),
(2, 1, 13, 2, 1),
(2, 1, 13, 3, 1),
(2, 1, 13, 4, 1),
(2, 1, 13, 5, 1),
(2, 1, 13, 6, 1),
(2, 1, 13, 7, 1),
(2, 1, 13, 8, 1),
(2, 1, 14, 1, 1),
(2, 1, 14, 2, 1),
(2, 1, 14, 3, 1),
(2, 1, 14, 4, 1),
(2, 1, 14, 5, 1),
(2, 1, 14, 6, 1),
(2, 1, 14, 7, 1),
(2, 1, 14, 8, 1);
-- --------------------------------------------------------
--
@ -171,27 +402,17 @@ CREATE TABLE `session` (
`date` date NOT NULL,
`start_time` time NOT NULL,
`seat_price` float NOT NULL,
`format` varchar(20) NOT NULL
`format` varchar(20) NOT NULL,
`seats_full` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `session`
--
INSERT INTO `session` (`id`, `idfilm`, `idhall`, `idcinema`, `date`, `start_time`, `seat_price`, `format`) VALUES
(3, 4, 2, 1, '2021-04-16', '14:20:00', 5, 'Estandar'),
(4, 4, 2, 1, '2021-04-17', '14:20:00', 5, 'Estandar'),
(5, 4, 2, 1, '2021-04-18', '14:20:00', 5, 'Estandar'),
(6, 9, 2, 1, '2021-04-15', '18:00:00', 7, '3D'),
(7, 9, 1, 1, '2021-04-16', '18:00:00', 7, '3D'),
(8, 9, 1, 1, '2021-04-17', '18:00:00', 7, '3D'),
(9, 9, 1, 1, '2021-04-18', '18:00:00', 7, '3D'),
(10, 9, 1, 1, '2021-04-19', '18:00:00', 7, '3D'),
(11, 9, 1, 1, '2021-04-20', '18:00:00', 7, '3D'),
(12, 9, 1, 1, '2021-04-21', '18:00:00', 7, '3D'),
(13, 9, 1, 1, '2021-04-22', '18:00:00', 7, '3D'),
(14, 10, 1, 1, '2021-04-15', '18:00:00', 10, 'normal'),
(15, 1, 1, 1, '2021-04-30', '14:00:00', 5, '3d');
INSERT INTO `session` (`id`, `idfilm`, `idhall`, `idcinema`, `date`, `start_time`, `seat_price`, `format`, `seats_full`) VALUES
(19, 1, 2, 1, '2021-05-14', '19:00:00', 12, '2d', 0),
(20, 1, 2, 1, '2021-05-15', '19:00:00', 12, '2d', 0);
-- --------------------------------------------------------
@ -215,7 +436,8 @@ INSERT INTO `users` (`id`, `username`, `email`, `passwd`, `rol`) VALUES
(0, 'admin', 'admin@complucine.sytes.net', 'shDBCKnEbWZFc', 'admin'),
(1, 'manager', 'manager@complucine.sytes.net', 'shTS9RK/eJPoQ', 'manager'),
(2, 'user', 'user@complucine.sytes.net', 'shO5etd.DYKWg', 'user'),
(7, 'fernando', 'fer@complucine.sytes.net', '$2y$10$k/R4m.uN1IfZ0rdc5wwc2uaO9b0e5qK9WtOBloxlfkUuBjWPMC3PG', 'user');
(7, 'fernando', 'fer@complucine.sytes.net', '$2y$10$/3yjEh4d7AOY3RyNjXIIkO5H2hg7/kiHiToJa92tCBPd7s3UPtB.G', 'user'),
(63, 'user2', 'user2@ucm.es', '$2y$10$Alopov4Z1HPW9i9PqQ/APedPoU.N/zc3XlRfIfSkwPCQCKI.qTp5u', 'user');
--
-- Índices para tablas volcadas
@ -301,27 +523,32 @@ ALTER TABLE `users`
-- AUTO_INCREMENT de la tabla `cinema`
--
ALTER TABLE `cinema`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de la tabla `film`
--
ALTER TABLE `film`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT de la tabla `hall`
--
ALTER TABLE `hall`
MODIFY `number` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
MODIFY `number` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT de la tabla `promotion`
--
ALTER TABLE `promotion`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `session`
--
ALTER TABLE `session`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=65;
--
-- Restricciones para tablas volcadas
--

View File

@ -1,8 +1,5 @@
<?php
include_once('cinema.php');
$template = new Template();
$prefix = $template->get_prefix();
include_once($prefix.'assets/php/dao.php');
class Cinema_DAO extends DAO {

View File

@ -1,9 +1,5 @@
<?php
include_once('film.php');
$template = new Template();
$prefix = $template->get_prefix();
include_once($prefix.'assets/php/dao.php');
class Film_DAO extends DAO {

View File

@ -1,5 +1,4 @@
<?php
require_once($prefix.'assets/php/dao.php');
include_once('hall.php');

View File

@ -1,8 +1,5 @@
<?php
include_once('manager.php');
$template = new Template();
$prefix = $template->get_prefix();
include_once($prefix.'assets/php/dao.php');
class Manager_DAO extends DAO {

View File

@ -1,8 +1,5 @@
<?php
include_once('promotion.php');
$template = new Template();
$prefix = $template->get_prefix();
include_once($prefix.'assets/php/dao.php');
class Promotion_DAO extends DAO {

View File

@ -1,5 +1,4 @@
<?php
require_once($prefix.'assets/php/dao.php');
include_once('seat.php');
class SeatDAO extends DAO {

View File

@ -1,5 +1,4 @@
<?php
require_once($prefix.'assets/php/dao.php');
include_once('session.php');
class SessionDAO extends DAO {

View File

@ -1,5 +1,4 @@
<?php
require_once('../assets/php/dao.php');
include_once('user.php');
class UserDAO extends DAO {

View File

@ -37,6 +37,7 @@
/**
* Initialize the application:
*/
include_once($prefix.'assets/php/dao.php');
require_once('aplication.php');
$app = Aplicacion::getSingleton();
$app->init(array('host'=>BD_HOST, 'bd'=>BD_NAME, 'user'=>BD_USER, 'pass'=>BD_PASS));

View File

@ -295,7 +295,8 @@
<div class='blockquote'>
<p>".$descriptions[$i]."</p>
</div>
<p>Duración: ".$times[$i]." minutos</p>
<li>Duración: ".$times[$i]." minutos</li>
<li>Lenguaje: ".$languages[$i]."</li>
</div>
</div>
</section>

View File

@ -84,9 +84,6 @@ class formAddCinema extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}
?>

View File

@ -33,7 +33,7 @@ class formAddFilm extends Form{
<input type="number" name="duration" id="duration" placeholder="Duración" required/><pre>'.$errorDuration.'</pre>
<input type="text" name="language" id="language" placeholder="Idioma" required/><pre>'.$errorLanguage.'</pre>
<input type="text" name="description" id="description" placeholder="Descripción" required/><pre>'.$errorDescription.'</pre>
<input type="file" name="archivo" id="archivo" /><pre>'.$errorImage.'</pre></p>
<div class="file">Imagen promocional:<input type="file" name="file" id="file" placeholder="Imagen promocional" /></div><pre>'.$errorImage.'</pre></p>
</fieldset>
<div class="actions">
<input type="submit" id="submit" value="Añadir pelicula" class="primary" />
@ -156,10 +156,6 @@ class formAddFilm extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
private function check_file_uploaded_name ($filename) {
return (bool) ((mb_ereg_match('/^[0-9A-Z-_\.]+$/i',$filename) === 1) ? true : false );
}

View File

@ -24,13 +24,12 @@ class formAddManager extends Form{
$errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
$errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error'));
$html = '<div class="row">
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>Selecciona usuario.</legend>'
$html = '<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>Selecciona usuario.</legend><pre>'.$errorId.'</pre>'
.$this->showUsers().
'</fieldset>
<fieldset>
<legend>Selecciona cine.</legend>'
<legend>Selecciona cine.</legend><pre>'.$errorIdCinema.'</pre>'
.$this->showCinemas().
'</fieldset>
<div class="actions">
@ -38,7 +37,7 @@ class formAddManager extends Form{
<input type="reset" id="reset" value="Borrar" />
</div>
</div>
</div>';
';
return $html;
}
@ -53,7 +52,7 @@ class formAddManager extends Form{
$idcinema = $this->test_input($datos['idcinema']) ?? null;
//||!mb_ereg_match(self::HTML5_EMAIL_REGEXP, $duration)
if (is_null($idcinema)) {
if (empty($idcinema)) {
$result['idcinema'] = "ERROR. No existe un cine con ese ID";
}
@ -88,10 +87,6 @@ class formAddManager extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
private function showUsers() {
$user = new UserDAO("complucine");
$users = $user->allUsersNotM();

View File

@ -101,10 +101,6 @@ class formAddPromotion extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}

View File

@ -18,9 +18,9 @@ class formDeleteCinema extends Form{
$errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error'));
$html = '<div class="column side"></div>
<fieldset id = "cinema_form">'.$htmlErroresGlobales.'</pre>
<fieldset id = "cinema_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>¿Estás seguro de que quieres eliminar este cine?</legend>
<input type="hidden" name="id" value='.$_POST['id'].'/>
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
<p>Name: '.$_POST['name'].' </p>
<p>Dirección: '.$_POST['direction'].' </p>
<p>Teléfono: '.$_POST['phone'].' </p>
@ -70,9 +70,6 @@ class formDeleteCinema extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}
?>

View File

@ -29,7 +29,7 @@ class formDeleteFilm extends Form{
$html = '<div class="row">
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>¿Estás seguro de que quieres eliminar esta pelicula?</legend>
<input type="hidden" name="id" value='.$_POST['id'].'/>
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
<p>Id: '.$_POST['id'].' </p>
<p>Título: '.$_POST['tittle'].' </p>
<p>Duración: '.$_POST['duration'].' </p>
@ -80,10 +80,6 @@ class formDeleteFilm extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}

View File

@ -24,7 +24,7 @@ class formDeleteManager extends Form{
$html = '<div class="row">
<fieldset id="manager_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>¿Estás seguro de que quieres eliminar este gerente?</legend>
<legend>¿Estás seguro de que quieres eliminar este gerente?</legend><pre>'.$errorId.'</pre>
<input type="hidden" name="id" value='.$_POST['id'].'/>
<p>Id: '.$_POST['id'].' </p>
<p>IdCinema: '.$_POST['idcinema'].' </p>
@ -75,10 +75,6 @@ class formDeleteManager extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}

View File

@ -29,7 +29,7 @@ class formDeletePromotion extends Form{
$html = '<div class="row">
<fieldset id="promotion_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>¿Estás seguro de que quieres eliminar esta promocion?</legend>
<input type="hidden" name="id" value='.$_POST['id'].'/>
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>
<p>Id: '.$_POST['id'].' </p>
<p>Nombre: '.$_POST['tittle'].'</p>
<p>Description:'.$_POST['description'].'</p>
@ -84,12 +84,6 @@ class formDeletePromotion extends Form{
}
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}
?>

View File

@ -93,9 +93,6 @@ class formEditCinema extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}
?>

View File

@ -88,7 +88,7 @@ class formEditFilm extends Form{
$bd = new Film_DAO("complucine");
$exist = $bd-> FilmData($id);
if( mysqli_num_rows($exist) == 1){
$bd->editFilm($id,$tittle,$duration,$language,$description);
$bd->editFilm($id, $tittle, $duration, $language, $description, $img = null /* Cambiar cuando se ñaladan las imágenes */);
$_SESSION['message'] = "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
@ -110,12 +110,6 @@ class formEditFilm extends Form{
}
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}
?>

View File

@ -26,8 +26,8 @@ class formEditManager extends Form{
$html = '<div class="row">
<h1>EDITAR GERENTE ID:'.$_POST['id'].'</h1>
<fieldset id="film_form"><pre>'.$htmlErroresGlobales.'</pre>
<legend>Selecciona cine.</legend>
<input type="hidden" name="id" value='.$_POST['id'].'/>'
<legend>Selecciona cine.</legend><pre>'.$errorIdCinema.'</pre>
<input type="hidden" name="id" value='.$_POST['id'].'/><pre>'.$errorId.'</pre>'
.$this->showCinemas().
'</fieldset>
<div class="actions">
@ -83,11 +83,6 @@ class formEditManager extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
private function showCinemas() {
$cine = new Cinema_DAO("complucine");
$cinemas = $cine->allCinemaData();

View File

@ -109,10 +109,6 @@ class formEditPromotion extends Form{
return $result;
}
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}

View File

@ -2,6 +2,7 @@
class Panel {
private $state;
private $login;
private $prefix;
function __construct($panel, $login){
$this->state = $panel;
@ -9,6 +10,7 @@
}
function showPanel($template) {
$this->prefix = $template->get_prefix();
if($this->login){
switch($this->state) {
case 'mc': if(isset($_POST['edit_cinema'])) {
@ -62,14 +64,25 @@
$this->print_managers();
};
break;
case 'un': echo"<h1>En construcción</h1>"; break;
case 'ur': echo"<h1>En construcción</h1>";; break;
case 'ag': echo"<h1>En construcción</h1>";; break;
default: echo "<h1>BIENVENIDO AL PANEL DE ADMINISTRADOR</h1>"; break;
case 'un': echo"<div class='code info'><h1>En construcción</h1><hr /></div>"; break;
case 'ur': echo"<div class='code info'><h1>En construcción</h1><hr /></div>"; break;
case 'ag': echo"<div class='code info'><h1>En construcción</h1><hr /></div>"; break;
default: echo '<div class="code info">
<h1>Bienvenido al Panel de Administrador.</h1>
<hr />
</div>'."\n"; break;
}
}
else {
echo "<h1>NO TIENES PERMISOS DE ADMINISTRADOR</h1>";
echo '<div class="column side"></div>
<div class="column middle">
<div class="code info">
<h1>No tienes permiso de administrador.</h1><hr />
<p>Inicia Sesión con una cuenta de administtación.</p>
<a href="'.$this->prefix.'login/"><button>Iniciar Sesión</button></a>
</div>
</div>
<div class="column side"></div>'."\n";
}
}
@ -166,20 +179,20 @@
}
}
echo "<div class='row'>
<div class='column side'></div>
<div class='column middle'>
<table class='alt'>
<thead>
<tr>
<th>Id</th>
<th>IdCinema</th>
<th>Nombre</th>
<th>Email</th>
<th>Rol</th>
</tr>
</thead>
<tbody>
";
<div class='column side'></div>
<div class='column middle'>
<table class='alt'>
<thead>
<tr>
<th>Id</th>
<th>IdCinema</th>
<th>Nombre</th>
<th>Email</th>
<th>Rol</th>
</tr>
</thead>
<tbody>
";
if(is_array($managers)){
for($i = 0; $i < count($managers); $i++){
echo '<tr>
@ -213,10 +226,11 @@
</table>
</div>
<div class="column side"></div>
</div>
';
}
function showAddBotton() {
echo'<div class="column side"></div>
echo' <div class="column side"></div>
<div class="column middle">
<h2>Añadir gerente</h2>
<form method="post" action="index.php?state=mg">
@ -225,29 +239,33 @@
</div>
</form>
</div>
</div>';
<div class="column side"></div>
</div>
';
}
function addManager(){
include_once('./includes/formAddManager.php');
$formAM = new formAddManager();
$htmlAForm = $formAM->gestiona();
echo '<!-- ADD MANAGER -->
<div class="column side"></div>
<div class="column middle">
<div class="column side"></div>
<div class="column middle">
<h3>AÑADIR GERENTE</h3>
'.$htmlAForm.'
</div>'."\n";
</div>
<div class="column side"></div>'."\n";
}
function editManager(){
include_once('./includes/formEditManager.php');
$formEM = new formEditManager();
$htmlEForm = $formEM->gestiona();
echo '<!-- EDIT MANAGER -->
<div class="column side"></div>
<div class="column middle">
<div class="column side"></div>
<div class="column middle">
<h3>EDITAR GERENTE</h3>
'.$htmlEForm.'
</div>'."\n";
</div>
<div class="column side"></div>'."\n";
}
function deleteManager(){
@ -255,11 +273,12 @@
$formDM = new formDeleteManager();
$htmlDForm = $formDM->gestiona();
echo '<!-- DELETE MANAGER -->
<div class="column side"></div>
<div class="column middle">
<div class="column side"></div>
<div class="column middle">
<h3>ELIMINAR GERENTE</h3>
'.$htmlDForm.'
</div>'."\n";
</div>
<div class="column side"></div>'."\n";
}
@ -269,22 +288,24 @@
$formAP = new formAddPromotion();
$htmlAForm = $formAP->gestiona();
echo '<!-- ADD PROMOTION -->
<div class="column side"></div>
<div class="column middle">
<div class="column side"></div>
<div class="column middle">
<h3>AÑADIR PROMOCIÓN</h3>
'.$htmlAForm.'
</div>'."\n";
</div>
<div class="column side"></div>'."\n";
}
function editPromotion(){
include_once('./includes/formEditPromotion.php');
$formEP = new formEditPromotion();
$htmlEForm = $formEP->gestiona();
echo '<!-- EDIT MANAGER -->
<div class="column side"></div>
<div class="column middle">
<div class="column side"></div>
<div class="column middle">
<h3>EDITAR PROMOCIÓN</h3>
'.$htmlEForm.'
</div>'."\n";
</div>
<div class="column side"></div>'."\n";
}
function deletePromotion(){
@ -318,8 +339,7 @@
}
}
echo "<div class='row'>
<div class='column side'></div>
echo "
<div class='column middle'>
<table class='alt'>
<thead>
@ -368,7 +388,7 @@
echo'</tbody>
</table>
</div>
<div class="column side"></div>
<div class="column side"></div>
';
}

View File

@ -68,7 +68,7 @@
<div class="column middle">
<div class="code info">
<h1>Debes iniciar sesión para ver el Panel de Manager.</h1><hr />
<p>Inicia Sesión en una cuenta con permisos.</p>
<p>Inicia Sesión con una cuenta de Gerente.</p>
<a href="'.$prefix.'login/" ><button class="button large">Iniciar Sesión</button></a>
</div>
</div>