本文整理汇总了PHP中Survey::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::getName方法的具体用法?PHP Survey::getName怎么用?PHP Survey::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Survey
的用法示例。
在下文中一共展示了Survey::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSection
function showSection($seid, $message = '')
{
$user = new User($_SESSION['URID']);
$survey = new Survey($_SESSION['SUID']);
$section = $survey->getSection($seid);
$returnStr = $this->showTranslatorHeader(Language::messageSMSTitle());
$returnStr .= '<div id="wrap">';
$returnStr .= $this->showNavBar();
$returnStr .= '<div class="container">';
$returnStr .= '<ol class="breadcrumb">';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'translator.surveys'), Language::headerSurveys()) . '</li>';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'translator.survey'), $survey->getName()) . '</li>';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'translator.survey.section', 'seid' => $seid), $section->getName()) . '</li>';
//if (!$user->hasNavigationInBreadCrumbs()) {
if ($_SESSION['VRFILTERMODE_SECTION'] == 0) {
$returnStr .= '<li class="active">' . Language::labelVariables() . '</li>';
} elseif ($_SESSION['VRFILTERMODE_SECTION'] == 3) {
$returnStr .= '<li class="active">' . Language::labelGroups() . '</li>';
} else {
$returnStr .= '<li class="active">' . Language::labelVariables() . '</li>';
}
//}
$returnStr .= '</ol>';
$returnStr .= $message;
$returnStr .= '<div class="row row-offcanvas row-offcanvas-right">';
$returnStr .= '<div style="" class="col-xs-12 col-sm-9">';
if ($user->hasNavigationInBreadCrumbs()) {
$active = array_fill(0, 16, 'label-primary');
$active[$_SESSION['VRFILTERMODE_SECTION']] = 'label-default';
$show = false;
if (getSurveyLanguage() != $survey->getDefaultLanguage(getSurveyMode())) {
$show = true;
}
$span = "";
if ($show) {
$status = "glyphicon glyphicon-remove";
$statustext = Language::messageTranslationStatusIncomplete();
if ($section->isTranslatedVariables()) {
$status = "glyphicon glyphicon-ok";
$statustext = Language::messageTranslationStatusComplete();
}
$span = '<span style="padding-right: 5px;" title="' . $statustext . '" class="' . $status . '"></span>';
}
if ($_SESSION['VRFILTERMODE_SECTION'] == 0) {
$returnStr .= ' <span class="label ' . $active[0] . '">' . $span . Language::labelVariables() . '</span>';
} else {
$returnStr .= ' <a onclick="$(\'#vrfiltermode_section\').val(0);$(\'#sectionsidebar\').submit(); return false;" style="text-decoration:none;"><span class="label ' . $active[0] . '">' . $span . Language::labelVariables() . '</span></a>';
}
}
$returnStr .= '<div class="well" style="background-color:white;">';
if ($_SESSION['VRFILTERMODE_SECTION'] == 0) {
//show variables
$returnStr .= $this->showVariables($survey->getVariableDescriptives($seid, "position", "asc"));
} else {
$returnStr .= $this->showVariables($survey->getVariableDescriptives($seid, "position", "asc"));
}
$returnStr .= '</div>';
//end well
//END CONTENT
$returnStr .= '</div>';
$returnStr .= $this->showSurveySideBar($survey, $_SESSION['VRFILTERMODE_SURVEY']);
$returnStr .= $this->showSectionSideBar($survey, $_SESSION['VRFILTERMODE_SECTION']);
$returnStr .= '</div>';
$returnStr .= '</div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}
示例2: showRemoveSurveyRes
function showRemoveSurveyRes()
{
/* update last page */
$_SESSION['LASTPAGE'] = 'sysadmin.surveys';
$displaySysAdmin = new DisplaySysAdmin();
$suid = getFromSessionParams('suid');
if ($suid != '') {
//remove
$survey = new Survey($suid);
/* remove sections */
$sections = $survey->getSections();
foreach ($sections as $section) {
$section->remove();
/* remove variables */
$variables = $survey->getVariableDescriptives($section->getSeid());
foreach ($variables as $variable) {
$variable->remove();
}
}
/* remove types */
$types = $survey->getTypes();
foreach ($types as $type) {
$type->remove();
}
/* remove types */
$groups = $survey->getGroups();
foreach ($groups as $group) {
$group->remove();
}
/* remove versions */
$versions = $survey->getVersions();
foreach ($versions as $version) {
$version->remove();
}
/* remove survey */
$survey->remove();
/* update users */
$users = new Users();
$users = $users->getUsers();
foreach ($users as $u) {
$u->removeSurvey($suid);
$u->saveChanges();
}
/* return result */
return $displaySysAdmin->showSurveys($displaySysAdmin->displaySuccess(Language::messageSurveyRemoved($survey->getName())));
} else {
return $displaySysAdmin->showSurveys();
}
}
示例3: 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());
//.........这里部分代码省略.........
示例4: showSection
function showSection($seid, $message = '')
{
$user = new User($_SESSION['URID']);
$survey = new Survey($_SESSION['SUID']);
$section = $survey->getSection($seid);
$returnStr = $this->showSysAdminHeader(Language::messageSMSTitle());
$returnStr .= '<div id="wrap">';
$returnStr .= $this->showNavBar();
$returnStr .= '<div class="container">';
$returnStr .= '<ol class="breadcrumb">';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'sysadmin.surveys'), Language::headerSurveys()) . '</li>';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'sysadmin.survey'), $survey->getName()) . '</li>';
$returnStr .= '<li>' . setSessionParamsHref(array('page' => 'sysadmin.survey.section', 'seid' => $seid), $section->getName()) . '</li>';
if (!$user->hasNavigationInBreadCrumbs()) {
if ($_SESSION['VRFILTERMODE_SECTION'] == 0) {
$returnStr .= '<li class="active">' . Language::labelVariables() . '</li>';
} elseif ($_SESSION['VRFILTERMODE_SECTION'] == 1) {
$returnStr .= '<li class="active">' . Language::labelRouting() . '</li>';
} else {
$returnStr .= '<li class="active">' . Language::labelVariables() . '</li>';
}
}
$returnStr .= '</ol>';
//CONTENT
$returnStr .= $message;
$returnStr .= '<div class="row row-offcanvas row-offcanvas-right">';
$returnStr .= '<div style="" class="col-xs-12 col-sm-9">';
if ($user->hasNavigationInBreadCrumbs()) {
$active = array_fill(0, 16, 'label-primary');
$active[$_SESSION['VRFILTERMODE_SECTION']] = 'label-default';
if ($_SESSION['VRFILTERMODE_SECTION'] == 0) {
$returnStr .= ' <span class="label ' . $active[0] . '">' . Language::labelVariables() . '</span>';
} else {
$returnStr .= ' <a onclick="$(\'#vrfiltermode_section\').val(0);$(\'#sectionsidebar\').submit(); return false;" style="text-decoration:none;"><span class="label ' . $active[0] . '">' . Language::labelVariables() . '</span></a>';
}
if ($_SESSION['VRFILTERMODE_SECTION'] == 1) {
$returnStr .= ' <span class="label ' . $active[1] . '">' . Language::labelRouting() . '</span>';
} else {
$returnStr .= ' <a onclick="$(\'#vrfiltermode_section\').val(1);$(\'#sectionsidebar\').submit(); return false;" style="text-decoration:none;"><span class="label ' . $active[1] . '">' . Language::labelRouting() . '</span></a>';
}
/* if ($_SESSION['VRFILTERMODE_SECTION'] == 3) {
$returnStr .= ' <span class="label ' . $active[3] . '">' . Language::labelGroups() . '</span>';
} else {
$returnStr .= ' <a onclick="$(\'#vrfiltermode_section\').val(3);$(\'#sectionsidebar\').submit(); return false;" style="text-decoration:none;"><span class="label ' . $active[3] . '">' . Language::labelGroups() . '</span></a>';
} */
}
$returnStr .= '<div class="well" style="background-color:white;">';
if ($_SESSION['VRFILTERMODE_SECTION'] == 0) {
//show variables
$returnStr .= $this->showVariables($survey->getVariableDescriptives($seid, "position", "asc"));
} elseif ($_SESSION['VRFILTERMODE_SECTION'] == 1) {
//show routing!
$returnStr .= $this->showRouting($seid);
} elseif ($_SESSION['VRFILTERMODE_SECTION'] == 3) {
//show groups!
$returnStr .= $this->showGroups($survey->getGroups());
} else {
$returnStr .= $this->showTextBase($seid);
}
$returnStr .= '</div>';
//end well
//END CONTENT
$returnStr .= '</div>';
$returnStr .= $this->showSurveySideBar($survey, $_SESSION['VRFILTERMODE_SURVEY']);
$returnStr .= $this->showSectionSideBar($survey, $_SESSION['VRFILTERMODE_SECTION']);
$returnStr .= '</div>';
$returnStr .= '</div></div>';
//container and wrap
$returnStr .= $this->showBottomBar();
$returnStr .= $this->showFooter(false);
return $returnStr;
}