different changes

- change from $ _REQUEST to $ _POST / $ _ GET
- Session messages are managed globally by template
This commit is contained in:
Daniel Muñoz Garcia
2021-04-14 11:38:51 +02:00
committed by GitHub
parent 5ad88e6e35
commit 4968bc8e25
7 changed files with 95 additions and 63 deletions

View File

@ -46,7 +46,7 @@ class FormFilm extends Form {
}
//Process form:
public function processesForm($id,$tittle,$duration,$language,$description, $option) {
public function processesForm($id,$title,$duration,$languaje,$description, $option) {
$this->correct = true;
$this->option = $option;
@ -56,29 +56,11 @@ class FormFilm extends Form {
if($bd ){
if($option == "new"){
//Primero comprobar si existe una pelicula con el mismo titulo e idioma
$exist = $bd-> GetFilm($tittle,$language);
if( mysqli_num_rows($exist) != 0){
$this->correct =false;
}
else{
$bd->createFilm(null, $tittle,$duration,$language,$description);
}
$bd->createFilm(null, $title,$duration,$languaje,$description);
} else if ($option == "del"){
$exist = $bd-> FilmData($id);
if( mysqli_num_rows($exist) != 0){
$bd->deleteFilm($id);
}
else{
$this->correct =false;
}
$bd->deleteFilm($id);
} else if ($option == "edit"){
$exist = $bd-> FilmData($id);
if( mysqli_num_rows($exist) != 0){
$bd->editFilm($id,$tittle,$duration,$language,$description);
}
else{
$this->correct =false;
}
$bd->editFilm($id,$title,$duration,$languaje,$description);
} else if($this->option == "show") {
$this->array = $bd->allFilmData();
}