本文整理汇总了PHP中LogActions::getNumberOfSurveyActionsBySession方法的典型用法代码示例。如果您正苦于以下问题:PHP LogActions::getNumberOfSurveyActionsBySession方法的具体用法?PHP LogActions::getNumberOfSurveyActionsBySession怎么用?PHP LogActions::getNumberOfSurveyActionsBySession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogActions
的用法示例。
在下文中一共展示了LogActions::getNumberOfSurveyActionsBySession方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: surveyEntry
function surveyEntry()
{
global $engine;
if ($this->checkDateTime() == false) {
/* get whatever the language is (either post or default) and use it */
$l = getSurveyLanguage();
if (file_exists("language/language" . getSurveyLanguagePostFix($l) . ".php")) {
require_once 'language' . getSurveyLanguagePostFix($l) . '.php';
// language
} else {
require_once 'language_en.php';
// fall back on english language file
}
$login = new Login(session_id());
return $login->getClosedScreen();
}
$logactions = new LogActions();
$nosessionactions = $logactions->getNumberOfSurveyActionsBySession($this->phpid, USCIC_SURVEY);
/* no entry yet, then ask for prim_key in login screen */
if ($nosessionactions == 0 || loadvarSurvey(POST_PARAM_NEW_PRIMKEY) == '1') {
//no entry yet: ask for prim_key!
if (loadvarSurvey(POST_PARAM_NEW_PRIMKEY) == '1') {
$logactions->deleteLoggedInSurveySession($this->phpid);
}
/* get whatever the language is (either post or default) and use it */
$l = getSurveyLanguage();
if (file_exists("language/language" . getSurveyLanguagePostFix($l) . ".php")) {
require_once 'language' . getSurveyLanguagePostFix($l) . '.php';
// language
} else {
require_once 'language_en.php';
// fall back on english language file
}
$logactions->addAction('', '', "loginstart", USCIC_SURVEY, 1);
$login = new Login($this->phpid);
return $login->getLoginScreen();
} else {
//entry: is this person logged in?
$loggedin = $logactions->getLoggedInSurveySession($this->phpid);
// gets the last logged in action
/* no prim_key assigned to this sessionid. Assign if given (and check for pwd etc??)! */
if ($loggedin["count"] == 0) {
/* we don't have active session, so take the template we can get */
global $survey;
require_once "display/templates/displayquestion_" . getSurveyTemplate() . ".php";
// we don't have an active session, so fall back to whatever was passed along as language in post OR is the default language
$l = getSurveyLanguage();
if (file_exists("language/language" . getSurveyLanguagePostFix($l) . ".php")) {
//echo 'well done';
require_once 'language' . getSurveyLanguagePostFix($l) . '.php';
// language
} else {
require_once 'language_en.php';
// fall back on english language file
}
$primkey = loadvarSurvey(POST_PARAM_PRIMKEY);
$_SESSION['PRIMKEY'] = $primkey;
if ($primkey != '' && strlen($primkey) < 20) {
// make sure primkey is not encrypted!
//check!!!!!!
$login = new Login($this->phpid);
if ($login->checkAccess()) {
$primkey = $_SESSION['PRIMKEY'];
$logactions->addAction($primkey, '', "loggedin", USCIC_SURVEY, 1);
// pass along primkey to load correct engine!
$engine = loadEngine(getSurvey(), $primkey, $this->phpid, getSurveyVersion(), getSurveySection(getSurvey(), $primkey));
$engine->setFirstForm(true);
return $engine->getNextQuestion();
} else {
// incorrect login..start new session
endSession();
session_start();
session_regenerate_id(true);
$logactions->addAction('', '', "loginempty", USCIC_SURVEY, 1);
$login = new Login(session_id());
global $survey;
return $login->getLoginScreen($survey->getLoginError());
}
} else {
$logactions->addAction('', '', "loginempty", USCIC_SURVEY, 1);
$login = new Login($this->phpid);
global $survey;
if ($survey->getAccessType() == LOGIN_ANONYMOUS) {
return $login->getLoginScreen(Language::messageEnterPrimKey());
} else {
if ($survey->getAccessType() == LOGIN_LOGINCODE) {
return $login->getLoginScreen($survey->getLoginError());
} else {
return $login->getLoginScreen(Language::messageEnterPrimKeyDirectAccess());
}
}
}
} else {
//continue interview! EXTRA CHECK!!!
/* update survey info with what we know from the last session action */
setSurvey($loggedin["suid"]);
/* include survey template now that we know which survey we are in */
global $survey;
require_once "display/templates/displayquestion_" . getSurveyTemplate() . ".php";
/* update interview mode with what we know from the last session action
//.........这里部分代码省略.........