From a5c8dd4ff8b6ecd8dfb47d1c7f2f37eb523ce192 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fernando=20M=C3=A9ndez?=
<45081533+FerMdez@users.noreply.github.com>
Date: Wed, 26 May 2021 09:01:40 +0200
Subject: [PATCH] Delete purchase directory
---
purchase/confirm.php | 21 ----
purchase/includes/formPurchase.php | 121 -----------------------
purchase/index.php | 150 -----------------------------
3 files changed, 292 deletions(-)
delete mode 100644 purchase/confirm.php
delete mode 100644 purchase/includes/formPurchase.php
delete mode 100644 purchase/index.php
diff --git a/purchase/confirm.php b/purchase/confirm.php
deleted file mode 100644
index 8781465..0000000
--- a/purchase/confirm.php
+++ /dev/null
@@ -1,21 +0,0 @@
-gestiona();
-
- //Page-specific content:
- $section = '
-
Completar la Compra
-
- '.$formHTML.'
- ';
-
- //General page content:
- require RAIZ_APP.'/HTMLtemplate.php';
-?>
\ No newline at end of file
diff --git a/purchase/includes/formPurchase.php b/purchase/includes/formPurchase.php
deleted file mode 100644
index eaf0b5f..0000000
--- a/purchase/includes/formPurchase.php
+++ /dev/null
@@ -1,121 +0,0 @@
-session = $sessionDAO->sessionData($_POST["session_id"]);
-
- $filmDAO = new Film_DAO("complucine");
- $this->film = $filmDAO->FilmData($this->session->getIdfilm());
-
- $cinemaDAO = new Cinema_DAO("complucine");
- $this->cinema = $cinemaDAO->cinemaData($this->session->getIdcinema());
-
- $TODAY = getdate();
- $year = "$TODAY[year]";
-
- $this->years = array();
- for($i = $year; $i < $year+10; $i++) array_push($this->years, $i);
-
- $this->months = array();
- for($i = 1; $i <= 12; $i++) array_push($this->months, $i);
- }
-
- protected function generaCamposFormulario($datos, $errores = array()){
-
- // Se generan los mensajes de error si existen.
- $htmlErroresGlobales = self::generaListaErroresGlobales($errores);
- $errorNombre = self::createMensajeError($errores, 'name', 'span', array('class' => 'error'));
- $errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error'));
-
- $monthsHTML = "";
- foreach($this->months as $value){
- $monthsHTML .= "";
- }
-
- $yearsHTML = "";
- foreach($this->years as $value){
- $yearsHTML .= "";
- }
-
- $html = "";
-
- return $html;
- }
-
- protected function procesaFormulario($datos){
- $result = array();
-
- //$nombre = $this->test_input($datos['name']) ?? null;
- $nombre = $datos['name'] ?? null;
- $nombre = strtolower($nombre);
- if ( empty($nombre) || mb_strlen($nombre) < 3 || mb_strlen($nombre) > 15 ) {
- $result['name'] = "El nombre tiene que tener\n una longitud de al menos\n 3 caracteres\n y menos de 15 caracteres.";
- }
-
- //$password = $this->test_input($datos['pass']) ?? null;
- $password = $datos['pass'] ?? null;
- if ( empty($password) || mb_strlen($password) < 4 ) {
- $result['pass'] = "El password tiene que tener\n una longitud de al menos\n 4 caracteres.";
- }
-
- if (count($result) === 0) {
- $result[] = "La compra aun está en desarrollo. Vuelva en unos días.";
- }
-
- return $result;
- }
-}
-?>
\ No newline at end of file
diff --git a/purchase/index.php b/purchase/index.php
deleted file mode 100644
index 5475fbe..0000000
--- a/purchase/index.php
+++ /dev/null
@@ -1,150 +0,0 @@
-FilmData($_GET["film"]);
- if($film){
- $tittle = $film->getTittle();
-
- $cinemas = $filmDAO->getCinemas($_GET["film"]);
- 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 = '';
- } else {
- $cinemasListHTML = '';
- }
-
- $fiml_id = $film->getId();
- $cinema_id = $value["cID"];
-
- $sessionsDAO = new SessionDAO("complucine");
- $sessions = $sessionsDAO->getSessions_Film_Cinema($fiml_id, $cinema_id);
- //print_r($sessions);
- 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");
-
- $sessionsListHTML = '';
- } else {
- $sessionsListHTML = '';
- }
-
- $session_id = $value["sID"];
- $hall_id = $value["HALL"];
- $date_ = $value["DATE"];
- $hour_ = $value["HOUR"];
-
- //Reply: Depends on whether the purchase is to be made from a selected movie or a cinema.
- $reply = '
-
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.'
-
- ';
- } else {
- $reply = 'No existe la película.
';
- $pay = false;
- }
- } else if(isset($_GET["cinema"])) {
- $reply = 'ESTAMOS TRABAJANDO EN ELLO
';
- $pay = false;
- } else {
- $reply = 'No se ha encontrado película ni cine.
';
- $pay = false;
- }
-
-
- //Pay button:
- if($pay){
- $pay = '';
- }
- //Page-specific content:
- $section = '
-
- ';
-
- //General page content:
- require RAIZ_APP.'/HTMLtemplate.php';
-?>