From 357465a383d86af94791c42002ce9fef0ebb3089 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fernando=20M=C3=A9ndez?=
<45081533+FerMdez@users.noreply.github.com>
Date: Mon, 9 Aug 2021 11:12:47 +0200
Subject: [PATCH] Delete formSelectCinemaSession-FER_SURFACE.php
---
.../formSelectCinemaSession-FER_SURFACE.php | 269 ------------------
1 file changed, 269 deletions(-)
delete mode 100644 purchase/includes/formSelectCinemaSession-FER_SURFACE.php
diff --git a/purchase/includes/formSelectCinemaSession-FER_SURFACE.php b/purchase/includes/formSelectCinemaSession-FER_SURFACE.php
deleted file mode 100644
index 035f06f..0000000
--- a/purchase/includes/formSelectCinemaSession-FER_SURFACE.php
+++ /dev/null
@@ -1,269 +0,0 @@
- "selectSeat.php");
- parent::__construct('formSelectCinemaSession', $options);
-
- $TODAY = getdate();
- $this->_TODAY = "$TODAY[mday]"."-"."$TODAY[mon]"."-"."$TODAY[year]";
-
- }
-
- protected function generaCamposFormulario($datos, $errores = array()){
- $cinemas = [];
- $sessions = [];
-
- // Se generan los mensajes de error, si existen.
- $htmlErroresGlobales = self::generaListaErroresGlobales($errores);
- $errorCinema = self::createMensajeError($errores, 'cinemas', 'span', array('class' => 'error'));
- $errorFilm = self::createMensajeError($errores, 'films', 'span', array('class' => 'error'));
- $errorSession = self::createMensajeError($errores, 'sessions', 'span', array('class' => 'error'));
- $errorCode = self::createMensajeError($errores, 'code', 'span', array('class' => 'error'));
-
- $pay = true;
- if(isset($_GET["film"])){
- $filmDAO = new Film_DAO("complucine");
- $film = $filmDAO->FilmData($_GET["film"]);
- if($film){
- $tittle = $film->getTittle();
- $image = $film->getImg();
-
- $cinemas = $filmDAO->getCinemas($_GET["film"]);
- $cinema_id = $_GET["cinema"];
- if(!empty($cinemas)){
- $cinemasNames = new ArrayIterator(array());
- $cinemasIDs = new ArrayIterator(array());
- foreach($cinemas as $key=>$value){
- $cinemasIDs[$key] = $value->getId();
- $cinemasNames[$key] = $value->getName();
- }
- $cinemasIT = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC);
- $cinemasIT->attachIterator($cinemasIDs, "cID");
- $cinemasIT->attachIterator($cinemasNames, "NAME");
-
- $cinemasListHTML = ''.$htmlErroresGlobales.'
- '.$errorCinema.' ';
- if(!isset($cinema_id)){
- $cinemasListHTML .= 'Selecciona un cine ';
- foreach($cinemasIT as $value){
- $cinemasListHTML .=''.$value["NAME"].' ';
- }
- } else {
- foreach($cinemasIT as $value){
- if($value["cID"] == $cinema_id){
- $cinemasListHTML .= ''.$value["NAME"].' ';
- } else {
- $cinemasListHTML .=''.$value["NAME"].' ';
- }
- }
- }
- $cinemasListHTML .= '
- ';
- } else {
- $cinemasListHTML = '
';
- }
-
- $fiml_id = $film->getId();
-
- if(isset($cinema_id)){
- $sessionsDAO = new SessionDAO("complucine");
- $sessions = $sessionsDAO->getSessions_Film_Cinema($fiml_id, $cinema_id);
- if(!empty($sessions)){
- $sessionsDates = new ArrayIterator(array());
- $sessionsStarts = new ArrayIterator(array());
- $sessionsHalls = new ArrayIterator(array());
- $sessionsIDs = new ArrayIterator(array());
- foreach($sessions as $key=>$value){
- $sessionsIDs[$key] = $value->getId();
- $sessionsDates[$key] = date_format(date_create($value->getDate()), 'j-n-Y');
- $sessionsHalls[$key] = $value->getIdhall();
- $sessionsStarts[$key] = $value->getStartTime();
- }
- $sessionsIT = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC);
- $sessionsIT->attachIterator($sessionsIDs, "sID");
- $sessionsIT->attachIterator($sessionsDates, "DATE");
- $sessionsIT->attachIterator($sessionsHalls, "HALL");
- $sessionsIT->attachIterator($sessionsStarts, "HOUR");
-
- $count = 0;
- $sessionsListHTML = ''.$errorSession.' ';
- foreach ($sessionsIT as $value) {
- if(strtotime($this->_TODAY) <= strtotime($value["DATE"])){
- if($value === reset($sessionsIT)){
- $sessionsListHTML .= 'Fecha: '.$value["DATE"].' | Hora: '.$value["HOUR"].' | Sala: '.$value["HALL"].' ';
- } else {
- $sessionsListHTML .='Fecha: '.$value["DATE"].' | Hora:'.$value["HOUR"].' | Sala: '.$value["HALL"].' ';
- }
- $count++;
- }
- }
- $sessionsListHTML .= ' ';
-
- if($count == 0) {
- $sessionsListHTML = 'No hay sesiones disponibles para esta película. ';
- $pay = false;
- }
- } else {
- $sessionsListHTML = 'No hay sesiones disponibles para esta película. ';
- $pay = false;
- }
- } else {
- $sessionsListHTML = 'Primero seleccione un cine. ';
- $pay = false;
- }
-
- //Reply: Depends on whether the purchase is to be made from a selected movie or a cinema.
- $html = '
-
Película seleccionada: '.str_replace('_', ' ', $tittle).'
-
-
Duración: '.$film->getDuration().' minutos
-
Idioma: '.$film->getLanguage().'
-
-
-
Seleccione un Cine y una Sesión
-
Cines
- '.$cinemasListHTML.'
-
Sesiones
- '.$sessionsListHTML.'
-
Aplicar código promocional✔ ❌
-
'.$errorCode.'
-
';
- } else {
- $html = 'No existe la película. ';
- $pay = false;
- }
- } else if(isset($_GET["cinema"])) {
- $pay = false;
- $cinemaDAO = new Cinema_DAO("complucine");
- $cinema = $cinemaDAO->cinemaData($_GET["cinema"]);
- if($cinema){
- $cinema_name = $cinema->getName();
- $cinema_address = $cinema->getDirection();
- $cinema_tlf = $cinema->getPhone();
-
- $films = $cinemaDAO->getFilms($_GET["cinema"]);
- $film_id = $_GET["film"];
- if(!empty($films)){
- $filmsNames = new ArrayIterator(array());
- $filmsIDs = new ArrayIterator(array());
- foreach($films as $key=>$value){
- $filmsIDs[$key] = $value->getId();
- $filmsNames[$key] = str_replace('_', ' ', $value->getTittle());
- }
- $filmsIT = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC);
- $filmsIT->attachIterator($filmsIDs, "fID");
- $filmsIT->attachIterator($filmsNames, "NAME");
-
- $filmsListHTML = ''.$htmlErroresGlobales.'
- '.$errorFilm.' ';
- if(!empty($films)){
- $filmsListHTML .= 'Selecciona una película ';
- foreach($filmsIT as $value){
- $filmsListHTML .=''.$value["NAME"].' ';
- }
- } else {
- foreach($filmsIT as $value){
- if($value["cID"] == $film_id){
- $filmsListHTML .= ''.$value["NAME"].' ';
- } else {
- $filmsListHTML .=''.$value["NAME"].' ';
- }
- }
- }
- $filmsListHTML .= '
- ';
-
- } else {
- $filmsListHTML = 'No hay películas disponibles para este cine. ';
- }
-
- //Reply: Depends on whether the purchase is to be made from a selected movie or a cinema.
- $html = '
-
Cine seleccionado: '.$cinema_name.'
-
-
Dirección: '.$cinema_address.'
-
Teléfono: '.$cinema_tlf.'
-
-
-
Seleccione una Película y una Sesión
- Películas
- '.$filmsListHTML.'
- Sesiones
-
- Primero selecione una película.
-
- ';
-
- } else {
- $html = 'No existe el cine. ';
- $pay = false;
- }
- } else {
- $html = 'No se ha encontrado película ni cine. ';
- $pay = false;
- }
-
- //Select seat button:
- if($pay){
- $pay = ' ';
- }
-
- return '
-
- ';
- }
-
- protected function procesaFormulario($datos){
- $result = array();
-
- $cinema = $this->test_input($datos['cinemas']) ?? null;
- if ( empty($cinema) ) {
- $result['cinemas'] = "Selecciona un cine.";
- }
-
- $films = $this->test_input($datos['films']) ?? null;
- if ( empty($films) ) {
- $result['films'] = "Selecciona una película.";
- }
-
- $session = $this->test_input($datos['sessions']) ?? null;
- if ( empty($session) ) {
- $result['sessions'] = "Selecciona una sesión.";
- }
-
- $code = $this->test_input($datos['code']) ?? null;
- $avaliable = "../assets/php/common/checkPromo.php?code=".$code;
- if ( !empty($code) && mb_strlen($code) != 8 && $avaliable === "avaliable") {
- $result['code'] = "El código promocional no es válido.";
- }
-
- if (count($result) === 0) {
- $result = "selectSeat.php";
- }
-
- return $result;
- }
-}
-?>
\ No newline at end of file