Add files via upload

This commit is contained in:
Fernando Méndez
2021-05-12 10:40:22 +02:00
committed by GitHub
parent b6ea25caa1
commit 1b64bce911
16 changed files with 170 additions and 178 deletions

View File

@ -328,6 +328,13 @@
text-align: center;
height: 250px;
}
.code.info #register{
border: 1px solid#d3ebff;
}
.code.info #register:hover {
color: #1f2c3d;
background-color: #d3ebff;
}
.code.showtimes{
height: 600px;
}
@ -532,7 +539,7 @@
color: rgb(138, 150, 32);
}
#submit {
#submit, #register {
width: 100%;
height: 35px;
border: 1px solid #dadada;
@ -544,7 +551,7 @@
filter: brightness(105%);
cursor: pointer;
}
#submit:hover {
#submit:hover, #register:hover {
color: #dadada;
background-color: #1f2c3d;
}

View File

@ -327,6 +327,9 @@ main img {
text-align: center;
height: 250px;
}
.code.info #register{
border: 1px solid#d3ebff;
}
.code.showtimes{
height: 600px;
}
@ -526,7 +529,7 @@ textarea {
color: rgb(138, 150, 32);
}
#submit {
#submit, #register {
width: 100%;
height: 35px;
border: 1px solid #000000;
@ -538,7 +541,7 @@ textarea {
filter: brightness(105%);
cursor: pointer;
}
#submit:hover {
#submit:hover, #register:hover {
background-color: #d3ebff;
}

View File

@ -33,17 +33,18 @@
return "";
}
public static function create_session($cinema, $hall, $start, $date, $film, $price, $format,$repeat){
public static function create_session($session){
$bd = new SessionDAO('complucine');
if($bd ){
if(!$bd->searchSession($cinema, $hall, $start, $date)){
$bd->createSession(null,$film, $hall, $cinema, $date, $start, $price, $format);
if($repeat > "0") {
$repeats = $repeat;
$repeat = $repeat - 1;
$date = date('Y-m-d', strtotime( $date . ' +1 day') );
self::create_session($cinema, $hall, $start, $date, $film, $price, $format,$repeat);
if(!$bd->searchSession($session['cinema'], $session['hall'],$session['start'],$session['date'])){
$bd->createSession(null,$session['film'], $session['hall'], $session['cinema'], $session['date'],
$session['start'], $session['price'], $session['format']);
if($session['repeat'] > "0") {
$repeat = $session['repeat'];
$session['repeat'] = $session['repeat'] - 1;
$session['date'] = date('Y-m-d', strtotime( $session['date'] . ' +1 day') );
self::create_session($session);
return "Se han creado las ".$repeat ." sesiones con exito";
}
@ -55,13 +56,13 @@
} else return "Error al conectarse a la base de datos";
}
public static function edit_session($cinema, $or_hall, $or_date, $or_start, $hall, $start, $date, $film, $price, $format){
public static function edit_session($session){
$bd = new SessionDAO('complucine');
if($bd ){
if($bd->searchSession($cinema, $or_hall, $or_start, $or_date)){
$origin = array("cinema" => $cinema,"hall" => $or_hall,"start" => $or_start,"date" => $or_date);
$bd->editSession($film, $hall, $cinema, $date,
$start, $price, $format,$origin);
if($bd->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";
@ -69,11 +70,11 @@
} else return "Error al conectarse a la base de datos";
}
public static function delete_session($cinema, $hall, $start, $date){
public static function delete_session($session){
$bd = new SessionDAO('complucine');
if($bd ){
if($bd->searchSession($cinema, $hall, $start, $date)){
$bd->deleteSession($hall, $cinema, $date, $start);
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";

View File

@ -46,4 +46,9 @@
* @see http://php.net/manual/en/language.types.callable.php
*/
register_shutdown_function(array($app, 'shutdown'));
//Depuración (BORRAR):
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>

View File

@ -335,4 +335,9 @@ abstract class Form {
return $result;
}
//Test some form input.
protected function test_input($input){
return htmlspecialchars(trim(strip_tags($input)));
}
}