'; if ($thissurvey==false || !tableExists("tokens_{$surveyid}")){ $html .= $clang->gT('This survey does not seem to exist.'); } else { $usquery = "SELECT emailstatus from ".db_table_name("tokens_{$surveyid}")." where token=".db_quoteall($token,true); $usresult = $connect->GetOne($usquery); if ($usresult==false) { $html .= $clang->gT('You are not a participant in this survey.'); } elseif ($usresult=='OK') { $usquery = "Update ".db_table_name("tokens_{$surveyid}")." set emailstatus='OptOut', usesleft=0 where token=".db_quoteall($token,true); $usresult = $connect->Execute($usquery); //queXS addition //Set to Hard Refusal, respondent $sql = "UPDATE `case` SET current_outcome_id = 9 WHERE token = '$token'"; $connect->Execute($sql); $sql = "SELECT case_id FROM `case` WHERE token = '$token'"; $case_id = $connect->GetOne($sql); include_once(dirname(__FILE__) . '/quexs.php'); //Add a case note to clarify (need to translate this string) $sql = "INSERT INTO `case_note` (case_id,operator_id,note,datetime) VALUES ($case_id,1,'" . TQ_("Self completion refused via opt out function") . "',CONVERT_TZ(NOW(),'System','UTC'))"; $connect->Execute($sql); $html .= $clang->gT('You have been successfully removed from this survey.'); } else { $html .= $clang->gT('You have been already removed from this survey.'); } } $html .= '

'; //PRINT COMPLETED PAGE if (!$thissurvey['templatedir']) { $thistpl=sGetTemplatePath($defaulttemplate); } else { $thistpl=sGetTemplatePath($thissurvey['templatedir']); } sendcacheheaders(); doHeader(); echo templatereplace(file_get_contents("$thistpl/startpage.pstpl")); echo templatereplace(file_get_contents("$thistpl/survey.pstpl")); echo $html; echo templatereplace(file_get_contents("$thistpl/endpage.pstpl")); doFooter(); // Closing PHP tag is intentially left out (yes, it's fine!)