public function render()
 {
     $respondents = $this->respondent_service->getResultsRespondent($this->filter);
     $template = $this->prepareTemplate();
     $template->respondents = $respondents;
     $template->count = count($respondents);
     $template->render();
 }
 public function renderRespondent($id_respondent)
 {
     if ($id_respondent === null) {
         $this->redirect("Results:");
     }
     $respondent = $this->respondent_service->getResultsRespondentDetail($id_respondent);
     if (!$respondent) {
         $this->redirect("Results:");
     }
     $this->template->respondent = $respondent;
     $this->template->categories = $this->entity_category_service->getResultsRespondentCategory(new RespondentCategory(array(RespondentCategory::ID_RESPONDENT => $id_respondent)));
 }
 /**
  * @param Form $form
  */
 public function finalFormSubmitted(Form $form)
 {
     $values = $form->getValues();
     foreach ($values->website as $id_website => $param) {
         $period = $param["period"];
         if ($period !== null) {
             $this->respondent_website_service->addWebsiteToRespondent($id_website, $this->sessionSection->id_respondent, $period);
         }
     }
     foreach ($values->duels as $id_page_related => $param) {
         $page = $param["page"];
         if ($page !== null) {
             if ($page === RespondentPageDuel::MORE_OFTEN_BOTH || $page === RespondentPageDuel::MORE_OFTEN_NONE) {
                 $id_page = null;
                 $mote_often = $page;
             } else {
                 $id_page = $page;
                 $mote_often = RespondentPageDuel::MORE_OFTEN_PAGE;
             }
             $this->respondent_page_duel->addPageDuelToRespondent($id_page_related, $this->sessionSection->id_respondent, $mote_often, $id_page);
         }
     }
     if ($values->email !== null) {
         $respondent = $this->respondent_service->get($this->sessionSection->id_respondent);
         if ($respondent !== null) {
             $respondent->email = $values->email;
             $this->respondent_service->save($respondent);
         }
     }
     $this->sessionSection->cannot_final = true;
     $this->redirect("Survey:results");
 }
 public function renderDefault()
 {
     $this->template->highscore = $this->respondent_service->getHighscore();
     $this->template->id_respondent = $this->getSession()->getSection("survey")->id_respondent;
 }