Exemplo n.º 1
0
 function showStartSurvey($primkey, $type = 1, $message = '')
 {
     if ($type == 1) {
         $respondent = new Respondent($primkey);
     } else {
         $respondent = new Household($primkey);
     }
     $_SESSION['SURVEYLOGIN'] = LOGIN_DIRECT;
     $respondent->setStatus(1);
     //set status to 1: started survey
     $respondent->saveChanges();
     //add contact 100
     $contactcode = Language::startInterviewCode();
     $contactts = date('Y-m-d H:i:s');
     $contacts = new Contacts();
     $errorMessage = $contacts->addContact($respondent->getPrimkey(), $contactcode, $contactts, '', '', '', '', $_SESSION['URID']);
     //end add contact
     $displayInterviewer = new DisplayInterviewer();
     return $displayInterviewer->showStartSurvey($respondent, $message);
 }