Esempio n. 1
0
 public function show()
 {
     $this->resetSessionData();
     //capture suggester data
     $this->getFormData();
     //validate form data
     if (!$this->isFormValid()) {
         $_SESSION['message'] = $this->message;
         header("Location:.\\?page=messagesuccess");
         return;
     }
     //once  form is validated, get to thanks page
     $view = new MessageSuccessView();
     $view->render();
     //send email to the suggester
     $suggesterEmail = new SuggesterEmailView($this->message);
     $suggesterEmail->render();
     //send email to the host
     $hostEmail = new HostEmailView($this->message);
     $hostEmail->render();
 }
 public function show()
 {
     $this->resetSessionData();
     //capture suggester data
     $this->getFormData();
     //validate form data
     if (!$this->isFormValid()) {
         $_SESSION['moviesuggest'] = $this->moviesuggest;
         header("Location:./#moviesuggest");
         return;
     }
     // form is valid, and so redirect the user to a success page
     // header("Location:./?page=moviesuggestsuccess");
     $view = new MovieSuggestSuccessView();
     $view->render();
     //send email to the suggester
     $suggesterEmail = new SuggesterEmailView($this->moviesuggest);
     $suggesterEmail->render();
     //send email to the host
     $hostEmail = new HostEmailView($this->moviesuggest);
     $hostEmail->render();
 }