本文整理汇总了PHP中Survey::getSection方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::getSection方法的具体用法?PHP Survey::getSection怎么用?PHP Survey::getSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::getSection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showTranslateVariable
function showTranslateVariable($vsid, $message = "")
{
$survey = new Survey($_SESSION['SUID']);
$section = $survey->getSection($_SESSION['SEID']);
$var = $survey->getVariableDescriptive($vsid);
$returnStr = $this->showVariableHeader($survey, $section, $var, Language::headerTranslateVariable(), $message);
if ($_SESSION['VRFILTERMODE_VARIABLE'] == 0) {
$returnStr .= $this->showTranslateVariableGeneral($var);
} elseif ($_SESSION['VRFILTERMODE_VARIABLE'] == 2) {
$returnStr .= $this->showTranslateVariableLayout($var);
} elseif ($_SESSION['VRFILTERMODE_VARIABLE'] == 3) {
$returnStr .= $this->showTranslateVariableAssistance($var);
} elseif ($_SESSION['VRFILTERMODE_VARIABLE'] == 4) {
$returnStr .= $this->showTranslateVariableFill($var);
}
$returnStr .= '<div style="min-height: 100px; max-height: 100%;"></div>';
$returnStr .= $this->showVariableFooter($survey);
return $returnStr;
}
示例2: showEditSectionRes
function showEditSectionRes($suid, $seid)
{
$survey = new Survey($suid);
$section = $survey->getSection($seid);
$texttype = loadvar("texttype");
$value = loadvarAllowHTML("text");
switch ($texttype) {
case SETTING_PAGE_HEADER:
$section->setHeader($value);
break;
case SETTING_PAGE_FOOTER:
$section->setFooter($value);
break;
default:
break;
}
$section->save();
$compiler = new Compiler($suid, getSurveyVersion($survey));
$mess = $compiler->generateSections(array($section));
$mess = $compiler->generateGetFillsSections(array($section));
$mess = $compiler->generateInlineFieldsSections(array($section));
}
示例3: showRemoveSectionRes
function showRemoveSectionRes()
{
$_SESSION['LASTPAGE'] = 'sysadmin.survey';
$displaySysAdmin = new DisplaySysAdmin();
$survey = new Survey($_SESSION['SUID']);
$seid = getFromSessionParams('seid');
if ($seid != '') {
//edit
$section = $survey->getSection($seid);
$section->remove();
$variables = $survey->getVariableDescriptives($seid);
foreach ($variables as $variable) {
$variable->remove();
}
/* compile */
$compiler = new Compiler($_SESSION['SUID'], getSurveyVersion($survey));
$mess = $compiler->generateVariableDescriptives($variables, true);
$mess = $compiler->generateSections(array($section), true);
return $displaySysAdmin->showSurvey($displaySysAdmin->displaySuccess(Language::messageSectionRemoved($section->getName())));
} else {
return $displaySysAdmin->showSurvey();
}
}
示例4: showOutputStatisticsParadataVariable
function showOutputStatisticsParadataVariable($seid, $vsid)
{
if (loadvar(DATA_OUTPUT_TYPEDATA) != "") {
if (loadvar(DATA_OUTPUT_TYPEDATA) == DATA_TEST) {
$_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_TEST;
} else {
$_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
}
} else {
$_SESSION[SURVEY_EXECUTION_MODE] = SURVEY_EXECUTION_MODE_NORMAL;
}
$survey = new Survey($_SESSION['SUID']);
$section = $survey->getSection($seid);
$variable = $survey->getVariableDescriptive($vsid);
$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' => setSessionParamsHref(array('page' => 'sysadmin.output.statistics.paradata'), Language::headerOutputStatisticsParadata()), 'label' => Language::headerOutputStatisticsParadata());
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.statistics.paradata', 'suid' => $suid), $survey->getName()), 'label' => $survey->getName());
$headers[] = array('link' => setSessionParamsHref(array('page' => 'sysadmin.output.statistics.paradata.section', 'seid' => $seid), $section->getName()), 'label' => $section->getName());
$headers[] = array('link' => '', 'label' => $variable->getName());
$returnStr = $this->showOutputHeader($headers);
$returnStr .= '<form id=surveyform method="post">';
$returnStr .= '<span class="label label-default">' . Language::labelAggregateDetails() . '</span>';
$returnStr .= '<div class="well well-sm">';
$returnStr .= '<table>';
$returnStr .= $this->displayComboBox();
$returnStr .= '<tr><td>' . Language::labelOutputDataType() . '</td><td>';
$returnStr .= "<select id='typedata' class='selectpicker show-tick' name=" . DATA_OUTPUT_TYPEDATA . ">";
$selected = array('', '');
if (loadvar(DATA_OUTPUT_TYPEDATA) != "") {
$selected[loadvar(DATA_OUTPUT_TYPEDATA)] = "selected";
}
//print_r($selected);
$returnStr .= "<option " . $selected[0] . " value=" . DATA_REAL . ">" . Language::optionsDataReal() . "</option>";
$returnStr .= "<option " . $selected[1] . " value=" . DATA_TEST . ">" . Language::optionsDataTest() . "</option>";
$returnStr .= "</select>";
$returnStr .= "</td></tr>";
$returnStr .= '<script type=text/javascript>
$(document).ready(function(){
$("#typedata").on("change", function(event) {
document.getElementById("surveyform").submit();
});
});
</script>';
$returnStr .= "</form>";
$returnStr .= '</table>';
$returnStr .= '<br/><table>';
$returnStr .= '<tr><td valign=top style="min-width: 100px;">' . Language::labelTypeEditGeneralQuestion() . ": </td><td valign=top>";
$returnStr .= $variable->getQuestion() . "</td></tr>";
$returnStr .= '<tr><td valign=top>' . Language::labelTypeEditGeneralAnswerType() . ": </td><td valign=top>";
$answertype = $variable->getAnswerType();
$arr = Language::getAnswerTypes();
$returnStr .= $arr[$answertype] . "</td></tr>";
if (inArray($answertype, array(ANSWER_TYPE_ENUMERATED, ANSWER_TYPE_SETOFENUMERATED, ANSWER_TYPE_DROPDOWN, ANSWER_TYPE_MULTIDROPDOWN))) {
$returnStr .= '<tr><td valign=top>' . Language::labelTypeEditGeneralCategories() . ": </td><td valign=top>";
$returnStr .= str_replace("\r\n", "<br/>", $variable->getOptionsText()) . "</td></tr>";
} else {
if (inArray($answertype, array(ANSWER_TYPE_RANGE, ANSWER_TYPE_SLIDER))) {
$returnStr .= '<tr><td valign=top>' . Language::labelTypeEditRangeMinimum() . ": </td><td valign=top>";
$returnStr .= $variable->getMinimum() . "</td></tr>";
$returnStr .= '<tr><td valign=top>' . Language::labelTypeEditRangeMaximum() . ": </td><td valign=top>";
$returnStr .= $variable->getMaximum() . "</td></tr>";
}
}
if ($variable->isArray()) {
$returnStr .= $this->displayComboBox();
$returnStr .= '<tr><td valign=top>' . Language::labelTypeEditGeneralArrayInstance() . ": </td><td valign=top>";
$options = $this->getArrayData($_SESSION['SUID'], $variable->getName());
$returnStr .= "<form id=instanceform method=post>";
$returnStr .= "<select class='selectpicker show-tick' id='arrayinstance' name='arrayinstance'>";
foreach ($options as $op) {
$returnStr .= "<option value='" . $op . "'>" . $op . "</option>";
}
$returnStr .= "</select>";
$returnStr .= "</td></tr>";
$params = getSessionParams();
$params['vsid'] = $variable->getVsid();
$returnStr .= setSessionParamsPost($params);
$returnStr .= "</form>";
$returnStr .= "<script type='text/javascript'>";
$returnStr .= "\$('#arrayinstance').change(function () {\n \$('#instanceform').submit();\n });";
$returnStr .= "</script>";
}
$returnStr .= "</table></div>";
$returnStr .= '<span class="label label-default">' . Language::labelAggregateData() . '</span>';
$returnStr .= '<div class="well well-sm">';
$data = new Data();
$brackets = array();
$varname = $variable->getName();
if ($variable->isArray()) {
if (loadvar("arrayinstance") != "") {
$varname = loadvar("arrayinstance");
} else {
$varname = $varname . "[1]";
}
}
$paradata = $data->getParaData($variable, $varname);
//$aggdata = array(2,5);
if (sizeof($paradata) == 0) {
$returnStr .= "<br>" . $this->displayWarning(Language::messageNoData());
//.........这里部分代码省略.........
示例5: showRefactorVariable
function showRefactorVariable($vsid, $message = "")
{
$survey = new Survey($_SESSION['SUID']);
$section = $survey->getSection($_SESSION['SEID']);
$variable = $survey->getVariableDescriptive($vsid);
$returnStr = $this->showVariableHeader($survey, $section, $variable, Language::headerRefactorVariable(), $message);
$returnStr .= $this->displayWarning(Language::messageRefactorVariable($variable->getName()));
$returnStr .= '<form method="post">';
$returnStr .= '<div class="well">';
$returnStr .= setSessionParamsPost(array('page' => 'sysadmin.survey.refactorvariableres', 'vsid' => $variable->getVsid()));
$returnStr .= '<table>';
$returnStr .= '<tr><td>' . Language::labelTypeRefactor() . '</td>';
$returnStr .= "<td><input class='form-control' type=text name=" . SETTING_NAME . " /></td></tr>";
$returnStr .= '</table>';
$returnStr .= '</div>';
$returnStr .= '<input type="submit" class="btn btn-default" value="' . Language::buttonRefactor() . '"/>';
$returnStr .= '</form>';
$returnStr .= '<div style="min-height: 100px; max-height: 100%;"></div>';
$returnStr .= $this->showVariableFooter($survey);
return $returnStr;
}