From 05e487e648c83084524c2622994a79280a5bca16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Thu, 13 May 2021 11:48:57 +0200 Subject: [PATCH] Delete formFilm.php --- panel_admin/includes/formFilm.php | 166 ------------------------------ 1 file changed, 166 deletions(-) delete mode 100644 panel_admin/includes/formFilm.php diff --git a/panel_admin/includes/formFilm.php b/panel_admin/includes/formFilm.php deleted file mode 100644 index d66b0ab..0000000 --- a/panel_admin/includes/formFilm.php +++ /dev/null @@ -1,166 +0,0 @@ -reply = array(); - } - - public function getReply() { - if($this->correct){ - if($this->option == "new"){ - $this->reply = "
-
-
-
-

Operacion realizada con exito


-

Se ha aƱadido la pelicula correctamente en la base de datos.

- -
-
-
-
- "; - }else if($this->option == "edit"){ - $this->reply = "
-
-
-
-

Operacion realizada con exito


-

Se ha editado la pelicula correctamente en la base de datos.

- -
-
-
-
- "; - }else if($this->option == "del"){ - $this->reply = "
-
-
-
-

Operacion realizada con exito


-

Se ha eliminado la pelicula correctamente en la base de datos.

- -
-
-
-
- "; - } - - } else { - $this->reply = "
-
-
-
-

ERROR


-

Ha habido un error en la operacion. Revisa los datos introducidos

- -
-
-
-
"; - - } - return $this->reply; - } - - //Process form: - public function processesForm($_id, $_tittle, $_duration, $_language, $_description, $_img, $_option) { - $this->correct = true; - $this->option = $_option; - - $id= $this->test_input($_id); - $tittle=$this->test_input($_tittle); - $duration=$this->test_input($_duration); - $language=$this->test_input($_language); - $description=$this->test_input($_description); - - //Validate promotional film image. - $file_name = $_FILES['file']['name']; - //$file_type = $_FILES['file']['type']; - $file_size = $_FILES['file']['size']; - if(isset($file_name) && $file_name != "" - && strpos($file_name, "jpg") && $file_size < 100000){ - $uploadFile = IMG_DIR . basename($_FILES['file'][$_tittle]); - if (!move_uploaded_file($file_name, $uploadFile)){ - print_r($_FILES); - } - } - else{ - $this->correct = false; - } - - //Habria que validar todo para que encaje en la base de datos - - $bd = new Film_DAO('complucine'); - if($bd){ - if($this->option == "new"){ - //Primero comprobar si los campos no son vacios y la duracion es mayor que 0 - if(!empty($tittle)&&$duration>0&&!empty($language)&&!empty($description)){ - // 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); - - } - $exist->free(); - } - else{ - $this->correct =false; - } - } else if ($this->option == "del"){ - //Primero comprobar si existe una pelicula con el mismo id - $exist = $bd-> FilmData($id); - if( mysqli_num_rows($exist) == 1){ - $bd->deleteFilm($id); - } - else{ - $this->correct =false; - } - } else if ($this->option == "edit"){ - //Primero comprobar si los campos no son vacios y la duracion es mayor que 0 - if(!empty($tittle)&&$duration>0&&!empty($language)&&!empty($description)){ - //comprobar si existe una pelicula con el mismo id - $exist = $bd-> FilmData($id); - if( mysqli_num_rows($exist) == 1){ - $bd->editFilm($id,$tittle,$duration,$language,$description); - } - else{ - $this->correct =false; - } - $exist->free(); - } - else{ - $this->correct =false; - } - } - else {$this->correct = false;} - } - - - } - - protected function test_input($input){ - return htmlspecialchars(trim(strip_tags($input))); - } -} - - -?> \ No newline at end of file