updates
This commit is contained in:
parent
dad530edb4
commit
1f6cd81724
@ -57,6 +57,7 @@
|
|||||||
return $cinema;
|
return $cinema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns if exist a cinema with that id
|
||||||
public function existCinema($id){
|
public function existCinema($id){
|
||||||
$id = $this->mysqli->real_escape_string($id);
|
$id = $this->mysqli->real_escape_string($id);
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
return $film;
|
return $film;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns if exist a Film with this id
|
||||||
public function existFilm($id){
|
public function existFilm($id){
|
||||||
$id = $this->mysqli->real_escape_string($id);
|
$id = $this->mysqli->real_escape_string($id);
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Returns a query to get All the films.
|
//Returns a query to get All the promotion.
|
||||||
public function allPromotionData(){
|
public function allPromotionData(){
|
||||||
$sql = sprintf( "SELECT * FROM promotion ");
|
$sql = sprintf( "SELECT * FROM promotion ");
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
@ -33,21 +33,21 @@
|
|||||||
return $promotions;
|
return $promotions;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Returns a film data .
|
//Returns a promotion data by code.
|
||||||
public function GetPromotion($code){
|
public function GetPromotion($code){
|
||||||
$sql = sprintf( "SELECT * FROM promotion WHERE promotion.code = '%s'", $code );
|
$sql = sprintf( "SELECT * FROM promotion WHERE promotion.code = '%s'", $code );
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
return $resul;
|
return $resul;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Returns a film data .
|
//Returns a promotion data by id.
|
||||||
public function promotionData($id){
|
public function promotionData($id){
|
||||||
$sql = sprintf( "SELECT * FROM promotion WHERE promotion.id = '%d'", $id);
|
$sql = sprintf( "SELECT * FROM promotion WHERE promotion.id = '%d'", $id);
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
return $resul;
|
return $resul;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deleted film by "id".
|
//Deleted promotion by "id".
|
||||||
public function deletePromotion($id){
|
public function deletePromotion($id){
|
||||||
$sql = sprintf( "DELETE FROM promotion WHERE promotion.id = '%d' ;",$id);
|
$sql = sprintf( "DELETE FROM promotion WHERE promotion.id = '%d' ;",$id);
|
||||||
|
|
||||||
@ -56,7 +56,7 @@
|
|||||||
return $resul;
|
return $resul;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Edit a film.
|
//Edit a promotion with new img.
|
||||||
public function editPromotion($id, $tittle, $description, $code, $active, $img){
|
public function editPromotion($id, $tittle, $description, $code, $active, $img){
|
||||||
$sql = sprintf( "UPDATE promotion SET tittle = '%s' , description = '%s', code ='%s' , active ='%s', img = '%s'
|
$sql = sprintf( "UPDATE promotion SET tittle = '%s' , description = '%s', code ='%s' , active ='%s', img = '%s'
|
||||||
WHERE promotion.id = '%d';",
|
WHERE promotion.id = '%d';",
|
||||||
@ -67,6 +67,7 @@
|
|||||||
return $resul;
|
return $resul;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Edit a promotion without new img.
|
||||||
public function editPromotionNoImg($id, $tittle, $description, $code, $active){
|
public function editPromotionNoImg($id, $tittle, $description, $code, $active){
|
||||||
$sql = sprintf( "UPDATE promotion SET tittle = '%s' , description = '%s', code ='%s' , active ='%s'
|
$sql = sprintf( "UPDATE promotion SET tittle = '%s' , description = '%s', code ='%s' , active ='%s'
|
||||||
WHERE promotion.id = '%d';",
|
WHERE promotion.id = '%d';",
|
||||||
@ -77,7 +78,7 @@
|
|||||||
return $resul;
|
return $resul;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Returns a film data .
|
//Returns a promotion data as object.
|
||||||
public function GetPromotionObj($code){
|
public function GetPromotionObj($code){
|
||||||
$sql = sprintf( "SELECT * FROM promotion WHERE promotion.code = '%s'", $code );
|
$sql = sprintf( "SELECT * FROM promotion WHERE promotion.code = '%s'", $code );
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
|
Loading…
Reference in New Issue
Block a user