Add files via upload
This commit is contained in:
parent
2925084c7c
commit
d2c4fdd77f
@ -28,7 +28,6 @@
|
||||
$bd = new HallDAO('complucine');
|
||||
if($bd )
|
||||
return $bd->getAllHalls($cinema);
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function create_hall($number, $cinema, $rows, $cols, $seats, $seats_map){
|
||||
|
@ -42,19 +42,23 @@
|
||||
return $hall;
|
||||
}
|
||||
|
||||
//Returns the count of the hall searched
|
||||
public function searchHall($number, $cinema){
|
||||
|
||||
$sql = sprintf( "SELECT COUNT(*) FROM hall WHERE
|
||||
$sql = sprintf( "SELECT * FROM hall WHERE
|
||||
number = '%s' AND idcinema = '%s'",
|
||||
$number, $cinema);
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
$hall = false;
|
||||
|
||||
$hall = mysqli_fetch_array($resul);
|
||||
|
||||
mysqli_free_result($resul);
|
||||
|
||||
return $hall[0];
|
||||
if($resul){
|
||||
if($resul->num_rows == 1){
|
||||
$fila = $resul->fetch_assoc();
|
||||
$hall = $this->loadHall($fila["number"], $fila["idcinema"], $fila["numrows"], $fila["numcolumns"], $fila["total_seats"], null);
|
||||
}
|
||||
$resul->free();
|
||||
}
|
||||
|
||||
return $hall;
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
if($bd ) {
|
||||
return $bd->getAllSessions($hall, $cinema, $date);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function create_session($cinema, $hall, $start, $date, $film, $price, $format,$repeat){
|
||||
@ -59,10 +58,12 @@
|
||||
$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);
|
||||
return "Se ha editado la session con exito";
|
||||
if(!$bd->searchSession($cinema,$hall,$start,$date)){
|
||||
$origin = array("cinema" => $cinema,"hall" => $or_hall,"start" => $or_start,"date" => $or_date);
|
||||
$bd->editSession($film, $hall, $cinema, $date, $start, $price, $format,$origin);
|
||||
return "Se ha editado la session con exito";
|
||||
}else
|
||||
return "Ya existe una sesion con los parametros nuevos";
|
||||
} else
|
||||
return "Esta session no existe";
|
||||
|
||||
@ -87,23 +88,6 @@
|
||||
if($bd ) {
|
||||
return $bd->filmTittle($idfilm);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function getThisSessionId($cinema, $hall, $start, $date){
|
||||
$bd = new SessionDAO('complucine');
|
||||
if($bd ) {
|
||||
return $bd->searchSession($cinema, $hall, $start, $date);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function getThisSessionFromId($id){
|
||||
$bd = new SessionDAO('complucine');
|
||||
if($bd ) {
|
||||
return $bd->sessionData($id);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function setId($id){ $this->_id = $id; }
|
||||
|
Loading…
Reference in New Issue
Block a user