reply = array(); } public function getReply() { if($this->correct){ if($this->option == "new"){ $this->reply = "
Se ha aƱadido la pelicula correctamente en la base de datos.
"; }else if($this->option == "edit"){ $this->reply = "Se ha editado la pelicula correctamente en la base de datos.
"; }else if($this->option == "del"){ $this->reply = "Se ha eliminado la pelicula correctamente en la base de datos.
"; } } else { $this->reply = "Ha habido un error en la operacion. Revisa los datos introducidos
"; } return $this->reply; } //Process form: public function processesForm($id,$title,$duration,$languaje,$description, $option) { $this->correct = true; $this->option = $option; //Habria que validar todo para que encaje en la base de datos $start = date('H:i:s', strtotime( $start ) ); $date = date('Y-m-d', strtotime( $date ) ); $bd = new FilmDAO('complucine'); if($bd ){ if($option == "new"){ $selectFilm = $bd->selectSession($cinema, $hall, $start, $date); if($selectSession && $selectSession->num_rows >= 1) { $this->correct = false; } else{ $bd->createFilm(null, $title,$duration,$languaje,$description); } mysqli_free_result($selectSession); } else if ($option == "del"){ $bd->deleteFilm($id); } else if ($option == "edit"){ $bd->editFilm($id,$title,$duration,$languaje,$description); } } else {$this->correct = false;} } } ?>