diff --git a/assets/php/common/hall.php b/assets/php/common/hall.php index 9580548..a9f638a 100644 --- a/assets/php/common/hall.php +++ b/assets/php/common/hall.php @@ -1,5 +1,5 @@ searchHall($hall['cinema'], $hall['number'])){ - $bd->createHall($hall['number'], $hall['cinema'], $hall['cols'], $hall['rows']); - return "Se ha creado la sala con exito"; - } else { - return "Esta sala ya existe"; - } - } else { return "Error al conectarse a la base de datos"; } - } - //Getters && Setters: public function setNumber($number){ $this->_number = $number; } public function getNumber(){ return $this->_number; } diff --git a/assets/php/common/session.php b/assets/php/common/session.php index dc6e939..ca8fc2b 100644 --- a/assets/php/common/session.php +++ b/assets/php/common/session.php @@ -1,7 +1,7 @@ searchSession($session['cinema'], $session['origin_hall'],$session['origin_start'],$session['origin_date'])){ - $origin = array("cinema" => $session['cinema'],"hall" => $session['origin_hall'],"start" => $session['origin_start'],"date" => $session['origin_date']); - $bd->editSession($session['film'], $session['hall'], $session['cinema'], $session['date'], - $session['start'], $session['price'], $session['format'],$origin); - return "Se ha editado la session con exito"; - } else - return "Esta session no existe"; - - } else return "Error al conectarse a la base de datos"; - } - - public static function delete_session($session){ - $bd = new SessionDAO('complucine'); - if($bd ){ - if($bd->searchSession($session['cinema'], $session['hall'],$session['start'],$session['date'])){ - $bd->deleteSession($session['hall'], $session['cinema'], $session['date'], $session['start']); - return "Se ha eliminado la session con exito"; - } else - return "Esta session no existe"; - - } else return "Error al conectarse a la base de datos"; - } - - //Esto deberia estar en film.php? seguramente public static function getFilmTitle($idfilm){ $bd = new Film_DAO('complucine'); diff --git a/assets/php/common/session_dao.php b/assets/php/common/session_dao.php index 8d8abea..6330e5d 100644 --- a/assets/php/common/session_dao.php +++ b/assets/php/common/session_dao.php @@ -67,7 +67,7 @@ return $sessions; } - public function editSession($idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format, $origin){ + public function editSession($idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format){ $format = $this->mysqli->real_escape_string($format); $date = date('Y-m-d', strtotime( $date ) ); $startTime = date('H:i:s', strtotime( $startTime ) ); @@ -77,7 +77,7 @@ `start_time` = '%s', `seat_price` = '%d', `format` = '%s' WHERE idcinema = '%s' AND idhall = '%s' AND date = '%s' AND start_time = '%s'", - $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format, $origin["cinema"],$origin["hall"],$origin["date"],$origin["start"]); + $idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format, $_SESSION["cinema"],$_SESSION["hall"],$_SESSION["date"],$_SESSION["start"]); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); diff --git a/assets/php/config.php b/assets/php/config.php index ebb1e38..670f787 100644 --- a/assets/php/config.php +++ b/assets/php/config.php @@ -7,10 +7,15 @@ define('BD_USER', 'sw'); define('BD_PASS', '_admin_'); + /* + * Configuration parameters used to generate URLs and file paths in the application + */ + define('ROUTE_APP', '/'); //Change if it´s necessary. + /** - * Temprarl files directory. - */ - define('TMP_DIR', __DIR__.'/img/'); + * Image files directory. + */ + define('IMG_DIR', ROUTE_APP.'img/'); /** * Utf-8 support settings, location (language and country) and time zone. diff --git a/assets/php/template.php b/assets/php/template.php index 61c9ee1..10b0c2c 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -186,14 +186,14 @@ case "manager": array_push($menus, "