本文整理汇总了PHP中Survey::getSuid方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::getSuid方法的具体用法?PHP Survey::getSuid怎么用?PHP Survey::getSuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::getSuid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showTest
function showTest($content = "")
{
$returnStr = $this->showToolsHeader(Language::headerToolsTester());
$returnStr .= $content;
$surveys = new Surveys();
$surveys = $surveys->getSurveys();
if (sizeof($surveys) > 0) {
$returnStr .= "<form id=refreshform method=post>";
$returnStr .= '<input type=hidden name=page value="translator.tools.test">';
$returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_MODE . '" id="' . SMS_POST_MODE . '_hidden" value="' . getSurveyMode() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_LANGUAGE . '" id="' . SMS_POST_LANGUAGE . '_hidden" value="' . getSurveyLanguage() . '">';
$returnStr .= "</form>";
$returnStr .= "<form method=post>";
$returnStr .= '<input type=hidden name=' . POST_PARAM_SE . ' value="' . addslashes(USCIC_SURVEY) . '">';
$returnStr .= '<input type=hidden name=' . POST_PARAM_PRIMKEY . ' value="' . addslashes(encryptC(generateRandomPrimkey(8), Config::directLoginKey())) . '">';
$returnStr .= '<input type=hidden name=' . POST_PARAM_NEW_PRIMKEY . ' value="1">';
$returnStr .= '<input type=hidden name=' . POST_PARAM_SURVEY_EXECUTION_MODE . ' value="' . SURVEY_EXECUTION_MODE_TEST . '">';
$returnStr .= '<span class="label label-default">' . Language::labelToolsTestSettings() . '</span>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= $this->displayComboBox();
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelTestSurvey() . "</td><td><select onchange='document.getElementById(\"" . SMS_POST_SURVEY . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();' name=" . POST_PARAM_SUID . " class='selectpicker show-tick'>";
$current = new Survey(getSurvey());
foreach ($surveys as $survey) {
$selected = "";
if ($survey->getSuid() == $current->getSuid()) {
$selected = "SELECTED";
}
$returnStr .= "<option {$selected} value=" . $survey->getSuid() . '>' . $survey->getName() . '</option>';
}
$returnStr .= "</select></td></tr>";
$user = new User($_SESSION['URID']);
$cm = getSurveyMode();
$cl = getSurveyLanguage();
$modes = $user->getModes(getSurvey());
$langs = explode("~", $user->getLanguages(getSurvey(), getSurveyMode()));
$default = $current->getDefaultLanguage();
if (!inArray($default, $langs)) {
$langs[] = $default;
}
$returnStr .= "<tr><td>" . Language::labelTestModeInput() . "</td><td>" . $this->displayModesAdmin(POST_PARAM_MODE, POST_PARAM_MODE, getSurveyMode(), "", implode("~", $modes), "onchange='document.getElementById(\"" . SMS_POST_MODE . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();'") . "</td></tr>";
$returnStr .= "<tr><td>" . Language::labelTestLanguage() . "</td><td>" . $this->displayLanguagesAdmin(POST_PARAM_LANGUAGE, POST_PARAM_LANGUAGE, getSurveyLanguage(), true, true, false, "", implode("~", $langs)) . "</td></tr>";
$returnStr .= '</table>';
$returnStr .= '</div>';
$returnStr .= '<button type="submit" class="btn btn-default navbar-btn">' . Language::buttonTest() . '</button>';
$returnStr .= "</form>";
} else {
$returnStr .= $this->displayInfo(Language::messageNoSurveysAvailable());
}
$returnStr .= '</p></div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例2: handleGroupAction
//.........这里部分代码省略.........
$newgroups[] = $group;
}
/* compile new */
$compiler = new Compiler($suid, getSurveyVersion($survey));
$mess = $compiler->generateGroups($newgroups);
$mess = $compiler->generateGetFillsGroups($newgroups);
$mess = $compiler->generateInlineFieldsGroups($newgroups);
$content = $displaySysAdmin->displaySuccess(Language::messageToolsBatchEditorCopied(Language::labelGroupsLower()));
break;
case 'move':
$tocompile = array();
$moved = array();
$newgroups = array();
// determine survey
$suid = loadvar('suid');
$cookiearr = explode("-", $groupcookievalue);
foreach ($selected as $sel) {
$s = explode("~", $sel);
if (isset($surveys[$s[0]])) {
$survey = $surveys[$s[0]];
} else {
$survey = new Survey($s[0]);
$surveys[$s[0]] = $survey;
$tocompile[] = $s[0];
}
$group = $survey->getGroup($s[1]);
$oldgroup = $group;
$group->move($suid);
if (isset($moved[$s[0]])) {
$arr = $moved[$s[0]];
} else {
$arr = array();
}
$arr[] = $oldgroup;
$moved[$s[0]] = $arr;
$newgroups[] = $group;
/* update cookie */
$ind = array_search($sel, $cookiearr);
$cookiearr[$ind] = $group->getSuid() . '~' . $group->getGid();
}
/* update cookie */
setcookie('uscicgroupcookie', implode("-", $cookiearr));
//implode("-", $arr));
$groupcookievalue = implode("-", $cookiearr);
/* compile old */
foreach ($tocompile as $comp) {
if (isset($surveys[$comp])) {
$survey = $surveys[$comp];
} else {
$survey = new Survey($comp);
$surveys[$comp] = $survey;
}
/* we moved across survey for one or more groups in this survey */
if ($suid != $comp) {
$compiler = new Compiler($comp, getSurveyVersion($surveys[$comp]));
$mess = $compiler->generateGroups($moved[$comp], true);
}
}
/* compile new */
$compiler = new Compiler($suid, getSurveyVersion($survey));
$mess = $compiler->generateGroups($newgroups);
$mess = $compiler->generateGetFillsGroups($newgroups);
$mess = $compiler->generateInlineFieldsGroups($newgroups);
$content = $displaySysAdmin->displaySuccess(Language::messageToolsBatchEditorMoved(Language::labelGroupsLower()));
break;
case 'remove':
$removed = array();
$cookiearr = explode("-", $groupcookievalue);
foreach ($selected as $sel) {
$s = explode("~", $sel);
if (isset($surveys[$s[0]])) {
$survey = $surveys[$s[0]];
} else {
$survey = new Survey($s[0]);
$surveys[$s[0]] = $survey;
}
$group = $survey->getGroup($s[1]);
$group->remove();
$removed[] = $group;
/* update cookie */
$ind = array_search($sel, $cookiearr);
unset($cookiearr[$ind]);
}
/* update cookie */
setcookie('uscicgroupcookie', implode("-", $cookiearr));
//implode("-", $arr));
$groupcookievalue = implode("-", $cookiearr);
/* compile */
foreach ($surveys as $survey) {
$compiler = new Compiler($survey->getSuid(), getSurveyVersion($survey));
$mess = $compiler->generateGroups($removed, true);
}
$content = $displaySysAdmin->displaySuccess(Language::messageToolsBatchEditorRemoved(Language::labelGroupsLower()));
break;
default:
$content = $displaySysAdmin->displayWarning(Language::messageToolsBatchEditorUnrecognizedAction());
break;
}
return $content;
}
示例3: showOutputStatisticsParadata
function showOutputStatisticsParadata($content = "")
{
$survey = new Survey($_SESSION['SUID']);
//echo $_SESSION["SUID"] . '----';
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output'), Language::headerOutput()), 'label' => Language::headerOutputData());
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.statistics'), Language::headerOutputStatistics()), 'label' => Language::headerOutputStatistics());
$headers[] = array('link' => '', 'label' => Language::headerOutputStatisticsParadata());
$returnStr = $this->showOutputHeader($headers);
$returnStr .= $content;
$returnStr .= $this->displayComboBox();
$surveys = new Surveys();
$surveys = $surveys->getSurveys();
if (sizeof($surveys) > 0) {
$returnStr .= "<form id=refreshform method=post>";
$returnStr .= '<input type=hidden name=page value="sysadmin.output.statistics.paradata">';
$returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_MODE . '" id="' . SMS_POST_MODE . '_hidden" value="' . getSurveyMode() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_LANGUAGE . '" id="' . SMS_POST_LANGUAGE . '_hidden" value="' . getSurveyLanguage() . '">';
$returnStr .= "</form>";
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelTestSurvey() . "</td><td><select onchange='document.getElementById(\"" . SMS_POST_SURVEY . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();' name=" . POST_PARAM_SUID . " class='selectpicker show-tick'>";
$current = new Survey(getSurvey());
foreach ($surveys as $s) {
$selected = "";
if ($s->getSuid() == $current->getSuid()) {
$selected = "SELECTED";
}
$returnStr .= "<option {$selected} value=" . $s->getSuid() . '>' . $s->getName() . '</option>';
}
$returnStr .= "</select></td></tr>";
$returnStr .= '</table><br/><br/>';
$sections = $survey->getSections();
foreach ($sections as $section) {
$returnStr .= '<a href="index.php?r=' . setSessionsParamString(array('page' => 'sysadmin.output.statistics.paradata.section', 'seid' => $section->getSeid())) . '" class="list-group-item">' . $section->getName() . ' ' . $section->getDescription() . '</a>';
}
$returnStr .= "</div>";
} else {
$returnStr .= $this->displayInfo(Language::messageNoSurveysAvailable());
}
$returnStr .= '</p></div> </div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例4: showIssues
function showIssues($content = "")
{
$returnStr = $this->showToolsHeader(Language::linkReported());
$returnStr .= $content;
$surveys = new Surveys();
$surveys = $surveys->getSurveys();
if (sizeof($surveys) > 0) {
$returnStr .= "<form id=refreshform method=post>";
$returnStr .= '<input type=hidden name=page value="sysadmin.tools.issues">';
$returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_MODE . '" id="' . SMS_POST_MODE . '_hidden" value="' . getSurveyMode() . '">';
$returnStr .= '<input type=hidden name="' . SMS_POST_LANGUAGE . '" id="' . SMS_POST_LANGUAGE . '_hidden" value="' . getSurveyLanguage() . '">';
$returnStr .= "</form>";
// get reported issues for survey
global $survey;
$issues = $survey->getReportedIssues();
// no problems reported
if (sizeof($issues) == 0) {
$returnStr .= "<br/>" . '<div class="alert alert-warning">' . 'No reported problems found' . '</div>';
} else {
$returnStr .= $this->displayComboBox();
$returnStr .= '<span class="label label-default">Filter by</span>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelTestSurvey() . "</td><td><select onchange='document.getElementById(\"" . SMS_POST_SURVEY . "_hidden\").value=this.value; document.getElementById(\"refreshform\").submit();' name=" . POST_PARAM_SUID . " class='selectpicker show-tick'>";
$current = new Survey(getSurvey());
foreach ($surveys as $survey) {
$selected = "";
if ($survey->getSuid() == $current->getSuid()) {
$selected = "SELECTED";
}
$returnStr .= "<option {$selected} value=" . $survey->getSuid() . '>' . $survey->getName() . '</option>';
}
$returnStr .= "</select></td></tr></table></div>";
$returnStr .= $this->displayDataTablesScripts(array("colvis", "rowreorder"));
$returnStr .= "<script type='text/javascript'>\n \$(document).ready(function(){\n \$('#issuetable').dataTable(\n {\n \"iDisplayLength\": " . sizeof($issues) . ",\n dom: 'C<\"clear\">lfrtip',\n searching: false,\n paging: false\n } \n );\n \n });</script>\n\n ";
//
$returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
$returnStr .= "<th>Reported by</th><th>Reported on</th><th>Category</th><th>Description</th><th>Primary key</th><th>Interview mode</th><th>Language</th>";
$returnStr .= "</thead><tbody>";
$modes = Common::surveyModes();
$languages = Language::getLanguagesArray();
$cats = Language::reportProblemCategories();
foreach ($issues as $is) {
$us = new User($is['urid']);
$returnStr .= "<tr>";
$returnStr .= "<td>" . $us->getUsername() . "</td>";
$returnStr .= "<td>" . $is["ts"] . "</td>";
$returnStr .= "<td>" . $cats[$is["category"]] . "</td>";
$returnStr .= "<td>" . $is["comment"] . "</td>";
$returnStr .= "<td>" . $is["primkey"] . "</td>";
$returnStr .= "<td>" . $modes[$is["mode"]] . "</td>";
$returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
$returnStr .= "</tr>";
}
$returnStr .= "</tbody></table>";
}
} else {
$returnStr .= $this->displayInfo(Language::messageNoSurveysAvailable());
}
$returnStr .= '</p></div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}