Add files via upload

This commit is contained in:
Fernando Méndez 2021-06-07 11:16:12 +02:00 committed by GitHub
parent c10b90997e
commit 69b5ec6534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 328 additions and 23 deletions

View File

@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/ -- https://www.phpmyadmin.net/
-- --
-- Servidor: localhost:3306 -- Servidor: localhost:3306
-- Tiempo de generación: 02-06-2021 a las 21:03:55 -- Tiempo de generación: 07-06-2021 a las 11:04:18
-- Versión del servidor: 10.0.28-MariaDB-2+b1 -- Versión del servidor: 10.0.28-MariaDB-2+b1
-- Versión de PHP: 7.3.27-1~deb10u1 -- Versión de PHP: 7.3.27-1~deb10u1
@ -30,6 +30,13 @@ CREATE TABLE `admin` (
`id` int(15) UNSIGNED NOT NULL `id` int(15) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `admin`
--
INSERT INTO `admin` (`id`) VALUES
(0);
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --
@ -173,12 +180,6 @@ CREATE TABLE `purchase` (
INSERT INTO `purchase` (`iduser`, `idsession`, `idhall`, `idcinema`, `numrow`, `numcolum`, `time_purchase`) VALUES INSERT INTO `purchase` (`iduser`, `idsession`, `idhall`, `idcinema`, `numrow`, `numcolum`, `time_purchase`) VALUES
(7, 120, 2, 1, 2, 4, '2021-05-28 14:24:58'), (7, 120, 2, 1, 2, 4, '2021-05-28 14:24:58'),
(101, 62, 1, 1, 10, 4, '2021-06-01 17:00:07'),
(101, 92, 2, 1, 4, 1, '2021-06-01 17:01:43'),
(101, 124, 2, 1, 6, 8, '2021-06-01 17:05:45'),
(101, 126, 2, 1, 9, 2, '2021-06-01 17:08:16'),
(101, 78, 1, 1, 12, 4, '2021-06-01 17:30:21'),
(101, 92, 2, 1, 11, 4, '2021-06-01 17:33:57'),
(7, 37, 1, 1, 5, 4, '2021-06-02 09:58:05'), (7, 37, 1, 1, 5, 4, '2021-06-02 09:58:05'),
(7, 93, 2, 1, 9, 5, '2021-06-02 09:58:55'), (7, 93, 2, 1, 9, 5, '2021-06-02 09:58:55'),
(7, 95, 2, 1, 4, 6, '2021-06-02 09:59:28'), (7, 95, 2, 1, 4, 6, '2021-06-02 09:59:28'),
@ -823,8 +824,7 @@ INSERT INTO `users` (`id`, `username`, `email`, `passwd`, `rol`) VALUES
(1, 'manager', 'manager@complucine.sytes.net', 'shTS9RK/eJPoQ', 'manager'), (1, 'manager', 'manager@complucine.sytes.net', 'shTS9RK/eJPoQ', 'manager'),
(2, 'user', 'user@complucine.sytes.net', 'shO5etd.DYKWg', 'user'), (2, 'user', 'user@complucine.sytes.net', 'shO5etd.DYKWg', 'user'),
(3, 'manager2', 'manager2@complucine.sytes.net', '$2y$10$IAoCBP5mWz.dEIV7qsy1guyoOpfrfovwDBOEL9wVFn2oM1x9nx2xW', 'manager'), (3, 'manager2', 'manager2@complucine.sytes.net', '$2y$10$IAoCBP5mWz.dEIV7qsy1guyoOpfrfovwDBOEL9wVFn2oM1x9nx2xW', 'manager'),
(7, 'fernando', 'fer@complucine.sytes.net', '$2y$10$/3yjEh4d7AOY3RyNjXIIkO5H2hg7/kiHiToJa92tCBPd7s3UPtB.G', 'user'), (7, 'fernando', 'fer@complucine.sytes.net', '$2y$10$/3yjEh4d7AOY3RyNjXIIkO5H2hg7/kiHiToJa92tCBPd7s3UPtB.G', 'user');
(101, 'user2', 'user2@ucm.es', '$2y$10$BlP5ymruCBMsqD3WKA4a6u5zL29/K4GYJdRMP76WIUmJgm4EjMf8u', 'user');
-- --
-- Índices para tablas volcadas -- Índices para tablas volcadas

View File

@ -0,0 +1,319 @@
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 02-06-2021 a las 21:03:55
-- Versión del servidor: 10.0.28-MariaDB-2+b1
-- Versión de PHP: 7.3.27-1~deb10u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `complucine`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `admin`
--
CREATE TABLE `admin` (
`id` int(15) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `cinema`
--
CREATE TABLE `cinema` (
`id` int(15) UNSIGNED NOT NULL,
`name` varchar(10) NOT NULL,
`direction` varchar(120) NOT NULL,
`phone` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `film`
--
CREATE TABLE `film` (
`id` int(15) UNSIGNED NOT NULL,
`tittle` varchar(60) NOT NULL,
`duration` int(3) UNSIGNED NOT NULL,
`language` varchar(30) NOT NULL,
`description` text NOT NULL,
`img` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `hall`
--
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,
`total_seats` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `manager`
--
CREATE TABLE `manager` (
`id` int(15) UNSIGNED NOT NULL,
`idcinema` int(15) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `promotion`
--
CREATE TABLE `promotion` (
`id` int(15) UNSIGNED NOT NULL,
`tittle` varchar(30) NOT NULL,
`description` text NOT NULL,
`code` varchar(15) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`img` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `purchase`
--
CREATE TABLE `purchase` (
`iduser` int(15) UNSIGNED NOT NULL,
`idsession` int(15) UNSIGNED NOT NULL,
`idhall` int(15) UNSIGNED NOT NULL,
`idcinema` int(15) UNSIGNED NOT NULL,
`numrow` int(3) UNSIGNED NOT NULL,
`numcolum` int(3) UNSIGNED NOT NULL,
`time_purchase` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `seat`
--
CREATE TABLE `seat` (
`idhall` int(15) UNSIGNED NOT NULL,
`idcinema` int(15) UNSIGNED NOT NULL,
`numrow` int(3) UNSIGNED NOT NULL,
`numcolum` int(3) UNSIGNED NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `session`
--
CREATE TABLE `session` (
`id` int(15) UNSIGNED NOT NULL,
`idfilm` int(15) UNSIGNED NOT NULL,
`idhall` int(15) UNSIGNED NOT NULL,
`idcinema` int(15) UNSIGNED NOT NULL,
`date` date NOT NULL,
`start_time` time NOT NULL,
`seat_price` float NOT NULL,
`format` varchar(20) NOT NULL,
`seats_full` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` int(15) UNSIGNED NOT NULL,
`username` varchar(10) NOT NULL,
`email` varchar(30) NOT NULL,
`passwd` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`rol` varchar(7) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Usuarios';
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `admin`
--
ALTER TABLE `admin`
ADD KEY `PK_A_USER` (`id`);
--
-- Indices de la tabla `cinema`
--
ALTER TABLE `cinema`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `film`
--
ALTER TABLE `film`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `U_TITTLE_LANGUAGE` (`tittle`,`language`);
--
-- Indices de la tabla `hall`
--
ALTER TABLE `hall`
ADD PRIMARY KEY (`number`,`idcinema`),
ADD KEY `FK_CINEMA` (`idcinema`);
--
-- Indices de la tabla `manager`
--
ALTER TABLE `manager`
ADD KEY `PK_M_USER` (`id`),
ADD KEY `PK_M_CINEMA` (`idcinema`);
--
-- Indices de la tabla `promotion`
--
ALTER TABLE `promotion`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `purchase`
--
ALTER TABLE `purchase`
ADD KEY `PK_P_SEAT` (`idhall`,`numrow`,`numcolum`),
ADD KEY `FK_P_SESSION` (`idsession`),
ADD KEY `FK_P_USER` (`iduser`),
ADD KEY `FK_P_SEAT` (`idhall`,`idcinema`,`numrow`,`numcolum`);
--
-- Indices de la tabla `seat`
--
ALTER TABLE `seat`
ADD PRIMARY KEY (`idhall`,`numrow`,`numcolum`,`idcinema`) USING BTREE,
ADD KEY `FK_HALL` (`idhall`,`idcinema`);
--
-- Indices de la tabla `session`
--
ALTER TABLE `session`
ADD PRIMARY KEY (`id`),
ADD KEY `FK_FILM` (`idfilm`),
ADD KEY `FK_HALL_` (`idhall`,`idcinema`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `username_2` (`username`),
ADD KEY `username` (`username`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `cinema`
--
ALTER TABLE `cinema`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT de la tabla `film`
--
ALTER TABLE `film`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT de la tabla `hall`
--
ALTER TABLE `hall`
MODIFY `number` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `promotion`
--
ALTER TABLE `promotion`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT de la tabla `session`
--
ALTER TABLE `session`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=191;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=114;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `admin`
--
ALTER TABLE `admin`
ADD CONSTRAINT `PK_A_USER` FOREIGN KEY (`id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `hall`
--
ALTER TABLE `hall`
ADD CONSTRAINT `FK_CINEMA` FOREIGN KEY (`idcinema`) REFERENCES `cinema` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `manager`
--
ALTER TABLE `manager`
ADD CONSTRAINT `PK_M_CINEMA` FOREIGN KEY (`idcinema`) REFERENCES `cinema` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `PK_M_USER` FOREIGN KEY (`id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `purchase`
--
ALTER TABLE `purchase`
ADD CONSTRAINT `FK_P_SEAT` FOREIGN KEY (`idhall`,`idcinema`,`numrow`,`numcolum`) REFERENCES `seat` (`idhall`, `idcinema`, `numrow`, `numcolum`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_P_SESSION` FOREIGN KEY (`idsession`) REFERENCES `session` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_P_USER` FOREIGN KEY (`iduser`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `seat`
--
ALTER TABLE `seat`
ADD CONSTRAINT `FK_HALL` FOREIGN KEY (`idhall`,`idcinema`) REFERENCES `hall` (`number`, `idcinema`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Filtros para la tabla `session`
--
ALTER TABLE `session`
ADD CONSTRAINT `FK_FILM` FOREIGN KEY (`idfilm`) REFERENCES `film` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_HALL_` FOREIGN KEY (`idhall`,`idcinema`) REFERENCES `hall` (`number`, `idcinema`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@ -211,18 +211,6 @@ class FormPurchase extends Form {
if($purchaseDAO->createPurchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), $rows[$i], $cols[$i], date("Y-m-d H:i:s"))){ if($purchaseDAO->createPurchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), $rows[$i], $cols[$i], date("Y-m-d H:i:s"))){
$purchase = new Purchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), $datos["row"], $datos["col"], strftime("%A %e de %B de %Y a las %H:%M")); $purchase = new Purchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), $datos["row"], $datos["col"], strftime("%A %e de %B de %Y a las %H:%M"));
/*
$seatDAO = new SeatDAO("complucine");
$seats_list = $seatDAO->getAllSeats($this->session->getIdhall(), $this->cinema->getId());
foreach($seats_list as $key=>$value){
if( $seats_list[$key]->getNumRows() === $datos["row"][11] &&
$seats_list[$key]->getNumCol() === $datos["col"][11] ){
$seats_list[$key]->setState(intval(-1));
$seatDAO->changeSeatState( $seats_list[$key]->getNumber(), $seats_list[$key]->getIdcinema(), $seats_list[$key]->getNumRows(), $seats_list[$key]->getNumCol(), $seats_list[$key]->getState());
}
}
*/
$_SESSION["purchase"] = serialize($purchase); $_SESSION["purchase"] = serialize($purchase);
$_SESSION["film_purchase"] = serialize($this->film); $_SESSION["film_purchase"] = serialize($this->film);
$result = "resume.php"; $result = "resume.php";
@ -232,8 +220,6 @@ class FormPurchase extends Form {
} }
} else { } else {
$purchase = new Purchase("null", $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), $datos["row"], $datos["col"], strftime("%A %e de %B de %Y a las %H:%M")); $purchase = new Purchase("null", $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), $datos["row"], $datos["col"], strftime("%A %e de %B de %Y a las %H:%M"));
$_SESSION["purchase"] = serialize($purchase); $_SESSION["purchase"] = serialize($purchase);
$_SESSION["film_purchase"] = serialize($this->film); $_SESSION["film_purchase"] = serialize($this->film);
$result = "resume.php"; $result = "resume.php";