当前位置: 首页>>代码示例>>PHP>>正文


PHP Common::surveyModes方法代码示例

本文整理汇总了PHP中Common::surveyModes方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::surveyModes方法的具体用法?PHP Common::surveyModes怎么用?PHP Common::surveyModes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common的用法示例。


在下文中一共展示了Common::surveyModes方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: watch

    function watch()
    {
        $returnStr = $this->showHeader(Language::messageSMSTitle());
        $returnStr .= $this->displayComboBox();
        $returnStr .= "<form method='post'>";
        $params = getSessionParams();
        //$params['reportpage'] = 'reportRes';
        $returnStr .= setSessionParamsPost($params);
        $returnStr .= '<div id="wrap">';
        $returnStr .= '<div class="container"><p>';
        $returnStr .= '<div class="panel panel-default">
                <div class="panel-heading">';
        $returnStr .= '<h4>' . Language::linkWatch() . '</h4>';
        $returnStr .= '                </div>
                <div class="panel-body">';
        require_once 'data.php';
        require_once 'display.php';
        $data = new Data();
        $values = $data->getRespondentData(getFromSessionParams('watchsuid'), getFromSessionParams('watchprimkey'));
        $returnStr .= '</div>
    <div role="panel" class="panel">';
        if (sizeof($values) == 0) {
            $returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelWatchNoData() . '</div>';
        } else {
            $returnStr .= $this->displayDataTablesScripts(array("colvis", "rowreorder"));
            $returnStr .= "<script type='text/javascript'>\n                        \$(document).ready(function(){\n                            \$('#issuetable').dataTable(\n                                {\n                                    \"iDisplayLength\": 5,\n                                    dom: 'C<\"clear\">lfrtip',\n                                    searching: false,\n                                    paging: true\n                                    }    \n                                );\n                                         \n                       });</script>\n\n                        ";
            //
            $returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
            $returnStr .= "<th>" . Language::labelWatchVariable() . "</th><th>" . Language::labelWatchValue() . "</th><th>" . Language::labelWatchClean() . "</th><th>" . Language::labelWatchMode() . "</th><th>" . Language::labelWatchLanguage() . "</th><th>" . Language::labelWatchTime() . "</th></tr>";
            $returnStr .= "</thead><tbody>";
            $modes = Common::surveyModes();
            $languages = Language::getLanguagesArray();
            $sesid = session_id();
            require_once 'object.php';
            require_once 'component.php';
            require_once 'setting.php';
            require_once 'type.php';
            require_once 'variabledescriptive.php';
            $survey = new Survey(getFromSessionParams('watchsuid'));
            foreach ($values as $is) {
                $returnStr .= "<tr>";
                $returnStr .= "<td>" . $is["variablename"] . "</td>";
                $returnStr .= "<td>" . $this->getDisplayValue($survey->getVariableDescriptiveByName($is["variablename"]), $is["answer_dec"]) . "</td>";
                $returnStr .= "<td>" . $this->displayDirty([$is["dirty"]]) . "</td>";
                $returnStr .= "<td>" . $modes[$is["mode"]] . "</td>";
                $returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
                $returnStr .= "<td>" . $is["ts"] . "</td>";
                $returnStr .= "</tr>";
            }
            $returnStr .= "</tbody></table>";
        }
        $returnStr .= '</div>
  </div>
</div>';
        $returnStr .= '                </div></div>';
        $returnStr .= '</p></div>    </div>';
        //container and wrap
        $returnStr .= $this->showFooter(false);
        echo $returnStr;
    }
开发者ID:nubissurveying,项目名称:nubis,代码行数:60,代码来源:watchwindow.php

示例2: isSurveyMode

function isSurveyMode($l)
{
    if (trim($l) == "" || !is_numeric($l)) {
        return false;
    }
    /* forego checks below */
    if (Config::checkComponents() == false) {
        return true;
    }
    global $mode;
    if ($l == $mode) {
        return true;
    }
    // check in modes
    return inArray($l, array_keys(Common::surveyModes()));
}
开发者ID:nubissurveying,项目名称:nubis,代码行数:16,代码来源:functions.php

示例3: showNavBar

    public function showNavBar()
    {
        $returnStr = $this->getHeader();
        //language
        $rgid = $this->engine->getRgid();
        $variablenames = $this->getRealVariables(explode("~", $this->engine->getDisplayed()));
        $variablenamesfull = $this->engine->getDisplayed();
        $template = $this->engine->getTemplate();
        $click = "";
        if ($template != "") {
            $group = $this->engine->getGroup($template);
            $click = $this->engine->replaceFills($group->getClickLanguageChange());
        } else {
            $vars = explode("~", $variablenames);
            $var = $this->engine->getVariableDescriptive($vars[0]);
            $click = $this->engine->replaceFills($var->getClickLanguageChange());
        }
        $click = str_replace("'", "", $click);
        $clickmode = "";
        if ($template != "") {
            $group = $this->engine->getGroup($template);
            $clickmode = $this->engine->replaceFills($group->getClickModeChange());
        } else {
            $vars = explode("~", $variablenames);
            $var = $this->engine->getVariableDescriptive($vars[0]);
            $clickmode = $this->engine->replaceFills($var->getClickModeChange());
        }
        $clickmode = str_replace("'", "", $clickmode);
        // begin language
        global $survey;
        $user = new User($_SESSION['URID']);
        $allowedmodes = $user->getModes();
        $allowedlanguages = explode("~", $user->getLanguages(getSurvey(), getSurveyMode()));
        $default = $survey->getDefaultLanguage();
        $ut = "sysadmin";
        if ($user->getUserType() == USER_TRANSLATOR) {
            $ut = "translator";
            if (!inArray($default, $allowedlanguages)) {
                $allowedlanguages[] = $default;
            }
        } else {
            if ($user->GetUserType() == USER_TESTER) {
                $ut = "tester";
            }
        }
        if (getSurveyModeAllowChange() == MODE_CHANGE_RESPONDENT_ALLOWED) {
            //$allowed = explode("~", $survey->getAllowedModes());
            if (sizeof($allowedmodes) > 1) {
                $template = $this->engine->getTemplate();
                $returnStr .= '<li class="dropdown">';
                $returnStr .= '   <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mode <b class="caret"></b></a>';
                $returnStr .= '<ul class="dropdown-menu" role="menu">';
                $current = getSurveyMode();
                $modes = Common::surveyModes();
                foreach ($modes as $key => $mode) {
                    if (inArray($key, $allowedmodes)) {
                        $check = '';
                        if ($key == $current) {
                            $check = ' <span class="glyphicon glyphicon-ok"></span>';
                        }
                        //$returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_LASTACTION => $this->engine->getLastSurveyAction(), SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->primkey, SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => $current, SESSION_PARAM_VERSION => getSurveyVersion(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWMODE => $key))) . '"; document.getElementById("navigation").value="' . NAVIGATION_MODE_CHANGE . '"; $("#form").submit(); \'>' . $mode . $check . '</a></li>';
                        $returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->engine->getPrimaryKey(), SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => getSurveyMode(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TEMPLATE => getSurveyTemplate(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWMODE => $key))) . '"; document.getElementById("navigation").value="' . addslashes(Language::buttonUpdate()) . '"; ' . $clickmode . ' document.getElementById("form").submit(); \'>' . $mode . $check . '</a></li>';
                    }
                }
                $returnStr .= '</ul></li>';
            }
        }
        if (getSurveyLanguageAllowChange() == LANGUAGE_CHANGE_RESPONDENT_ALLOWED) {
            //$allowed = explode("~", $survey->getAllowedLanguages(getSurveyMode()));
            if (sizeof($allowedlanguages) > 1) {
                $returnStr .= '<li class="dropdown">';
                $returnStr .= '   <a href="#" class="dropdown-toggle" data-toggle="dropdown">Language <b class="caret"></b></a><ul class="dropdown-menu">';
                $langs = Language::getLanguagesArray();
                //getSurveyLanguages($this->engine->survey);
                foreach ($langs as $lang) {
                    if (inArray($lang["value"], $allowedlanguages)) {
                        $check = '';
                        if ($lang["value"] == getSurveyLanguage()) {
                            $check = ' <span class="glyphicon glyphicon-ok"></span>';
                        }
                        $returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->engine->getPrimaryKey(), SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => getSurveyMode(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TEMPLATE => getSurveyTemplate(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWLANGUAGE => $lang["value"]))) . '"; document.getElementById("navigation").value="' . addslashes(Language::buttonUpdate()) . '"; ' . $click . ' document.getElementById("form").submit(); \'>' . $lang["name"] . $check . '</a></li>';
                    }
                }
                $returnStr .= '</ul></li>';
            }
            //end language
        }
        $user = new User($_SESSION['URID']);
        $returnStr .= '<li class="dropdown">
              <a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">' . $user->getName() . ' <b class="caret"></b></a>
                 <ul class="dropdown-menu">
										<li class="dropdown-header">' . $this->engine->getPrimaryKey() . '</li>
                                                                                <li class="dropdown-header">' . $variablenamesfull . '</li>';
        $windowopen = 'window.open(\'tester/' . setSessionParams(array('reporturid' => $_SESSION['URID'], 'testpage' => 'report', 'reportsuid' => $this->engine->getSuid(), 'reportseid' => $this->engine->getSeid(), 'reportmainseid' => $this->engine->getMainSeid(), 'reportrgid' => $rgid, 'reportdisplayed' => $variablenames, 'reportlanguage' => getSurveyLanguage(), 'reportmode' => getSurveyMode(), 'reportversion' => getSurveyVersion(), 'reportprimkey' => $this->engine->getPrimarykey())) . '\', \'popupWindow\', \'width=770,height=500,scrollbars=yes,top=100,left=100\'); return false;';
        $javascript = ' onclick="' . $windowopen . '"';
        $returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-remove-sign"></span> ' . Language::linkReportProblem() . '</a></li>';
        $windowopen = 'window.open(\'tester/' . setSessionParams(array('testpage' => 'watch', 'watchurid' => $_SESSION['URID'], 'watchsuid' => $this->engine->getSuid(), 'watchseid' => $this->engine->getSeid(), 'watchmainseid' => $this->engine->getMainSeid(), 'watchrgid' => $rgid, 'watchdisplayed' => $variablenames, 'watchlanguage' => getSurveyLanguage(), 'watchmode' => getSurveyMode(), 'watchversion' => getSurveyVersion(), 'watchprimkey' => $this->engine->getPrimarykey())) . '\', \'popupWindow\', \'width=770,height=650,scrollbars=yes,top=100,left=100\'); return false;';
        $javascript = ' onclick="' . $windowopen . '"';
        $returnStr .= '<li><a style="cursor: pointer;" ' . $javascript . '><span class="glyphicon glyphicon-zoom-in"></span> ' . Language::linkWatch() . '</a></li>';
        $first = $this->engine->isFirstState();
//.........这里部分代码省略.........
开发者ID:nubissurveying,项目名称:nubis,代码行数:101,代码来源:displayquestiontest.php

示例4: showEditUserAccessRes

 function showEditUserAccessRes()
 {
     /* update last page */
     $_SESSION['LASTPAGE'] = 'sysadmin.users.edituser';
     $displayUsers = new DisplayUsers();
     $urid = getFromSessionParams('urid');
     $_SESSION['LASTURID'] = $urid;
     // store access
     $user = new User($urid);
     $content = $displayUsers->displaySuccess(Language::messageUserChanged($user->getName()));
     $surv = loadvar(SMS_POST_SURVEY);
     $allmodes = Common::surveyModes();
     foreach ($allmodes as $k => $all) {
         if (loadvar(SETTING_USER_MODE . $k) == USER_MODE_YES) {
             $ans = loadvar(SETTING_USER_LANGUAGES . $k);
             if (!is_array($ans)) {
                 $ans = array($ans);
             }
             if (sizeof($ans) > 0) {
                 //echo implode("~", $ans);
                 $user->setLanguages($surv, $k, implode("~", $ans));
             }
         } else {
             $user->removeMode($surv, $k);
         }
     }
     $user->saveChanges();
     return $displayUsers->showEditUser($_SESSION['LASTURID'], $content);
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:29,代码来源:sysadmin.php

示例5: getAllowedModes

 function getAllowedModes()
 {
     $allowed = $this->getSettingDirectly(USCIC_SURVEY, OBJECT_SURVEY, SETTING_ALLOWED_MODES)->getValue();
     if ($allowed == "") {
         $allowed = implode("~", array_keys(Common::surveyModes()));
     }
     return $allowed;
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:8,代码来源:survey.php

示例6: showMode

    function showMode()
    {
        global $survey;
        $allowed = explode("~", $survey->getAllowedModes());
        if (sizeof($allowed) == 1) {
            return "";
        }
        $rgid = $this->engine->getRgid();
        $variablenames = $this->getRealVariables(explode("~", $this->engine->getDisplayed()));
        $template = $this->engine->getTemplate();
        $click = "";
        if ($template != "") {
            $group = $this->engine->getGroup($template);
            $click = $this->engine->replaceFills($group->getClickModeChange());
        } else {
            $vars = explode("~", $variablenames);
            $var = $this->engine->getVariableDescriptive($vars[0]);
            $click = $this->engine->replaceFills($var->getClickModeChange());
        }
        $click = str_replace("'", "", $click);
        $returnStr = '<div class="btn-group">
  <button type="button" class="btn btn-default dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
    ' . Language::surveyChangeMode() . ' <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu">';
        $current = getSurveyMode();
        $modes = Common::surveyModes();
        foreach ($modes as $key => $mode) {
            if (inArray($key, $allowed)) {
                $check = '';
                if ($key == $current) {
                    $check = ' <span class="glyphicon glyphicon-ok"></span>';
                }
                $returnStr .= '<li><a href=# onclick=\'document.getElementById("r").value="' . setSessionsParamString(array_merge(array(SESSION_PARAM_LASTACTION => $this->engine->getLastSurveyAction(), SESSION_PARAM_SURVEY => $survey->getSuid(), SESSION_PARAM_PRIMKEY => $this->primkey, SESSION_PARAM_RGID => $rgid, SESSION_PARAM_VARIABLES => $variablenames, SESSION_PARAM_GROUP => $template, SESSION_PARAM_MODE => $current, SESSION_PARAM_VERSION => getSurveyVersion(), SESSION_PARAM_LANGUAGE => getSurveyLanguage(), SESSION_PARAM_TIMESTAMP => time(), SESSION_PARAM_SEID => $this->engine->getSeid(), SESSION_PARAM_MAINSEID => $this->engine->getMainSeid()), array(SESSION_PARAM_NEWMODE => $key))) . '"; document.getElementById("navigation").value="' . NAVIGATION_MODE_CHANGE . '"; ' . $click . ' document.getElementById("form").submit(); \'>' . $mode . $check . '</a></li>';
            }
        }
        $returnStr .= '
  </ul>
</div>';
        return $returnStr;
    }
开发者ID:nubissurveying,项目名称:nubis,代码行数:41,代码来源:displayquestion.php

示例7: reportSub

    function reportSub($message = '')
    {
        $returnStr = $this->displayComboBox();
        $returnStr .= '<div class="panel panel-default">
                <div class="panel-heading">';
        $returnStr .= '<h4>' . Language::reportProblem() . '</h4>';
        $returnStr .= '                </div>
                <div class="panel-body">';
        $returnStr .= $message;
        global $survey;
        $issues = $survey->getReportedIssues();
        $returnStr .= '<div>
  <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist">
    <li role="presentation" class="active"><a href="#newissue" aria-controls="home" role="tab" data-toggle="tab">New problem</a></li>
    <li role="presentation"><a href="#reportedissues" aria-controls="home" role="tab" data-toggle="tab">Reported problems (' . sizeof($issues) . ')</a></li>
  </ul>
<div class="tab-content">
    <div role="tabpanel" class="tab-pane active" id="newissue">';
        $returnStr .= "<br/><table>";
        $returnStr .= "<tr><td>" . Language::reportProblemCategory() . "</td><td>";
        $returnStr .= "<select class='selectpicker show-tick' name='reportcategory'>";
        $options = Language::reportProblemCategories();
        foreach ($options as $k => $option) {
            $returnStr .= "<option value=" . $k . ">" . $option . "</option>";
        }
        $returnStr .= "</select></td></tr>";
        $returnStr .= "<tr><td valign=top>" . Language::reportProblemDescription() . "</td><td>";
        $returnStr .= "<textarea name='reportcomment' class='form-control' style='min-width: 400px;' rows=6></textarea>";
        $returnStr .= "</td></tr>";
        $returnStr .= '</table><br/>';
        $returnStr .= '<button type="submit" class="btn btn-success" style="min-width:100px">' . Language::buttonReport() . '</button>';
        $returnStr .= '<button onclick="window.close();" type="cancel" class="btn btn-default" style="min-width:100px">' . Language::buttonClose() . '</button>';
        $returnStr .= "</form>";
        $returnStr .= '</div>
    <div role="tabpanel" class="tab-pane" id="reportedissues">';
        if (sizeof($issues) == 0) {
            $returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelNoProblemsReported() . '</div>';
        } else {
            $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>" . Language::labelReportedOn() . "</th><th>" . Language::labelReportedCategory() . "</th><th>" . Language::labelReportedDescription() . "</th><th>" . Language::labelReportedMode() . "</th><th>" . Language::labelReportedLanguage() . "</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>" . $modes[$is["mode"]] . "</td>";
                $returnStr .= "<td>" . $languages[str_replace("_", "", getSurveyLanguagePostFix($is["language"]))]['name'] . "</td>";
                $returnStr .= "</tr>";
            }
            $returnStr .= "</tbody></table>";
        }
        $returnStr .= '</div>
  </div>
</div>';
        return $returnStr;
    }
开发者ID:nubissurveying,项目名称:nubis,代码行数:66,代码来源:reportissue.php

示例8: 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;
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:66,代码来源:displaysysadmin.php

示例9: showEditUser


//.........这里部分代码省略.........
     $returnStr .= "</script>";
     if (inArray($user->getUserType(), array(USER_NURSE))) {
         $returnStr .= '<tr id=subtype><td align=top>' . Language::labelUserUserSubType() . '</td><td>';
         $returnStr .= $this->showDropDown(array(USER_NURSE_MAIN => Language::labelNurseMain(), USER_NURSE_LAB => Language::labelNurseLab(), USER_NURSE_FIELD => Language::labelNurseField(), USER_NURSE_VISION => Language::labelNurseVision()), $user->getUserSubType(), 'usersubtype');
         $returnStr .= '</td></tr>';
     } else {
         if (inArray($user->getUserType(), array(USER_SYSADMIN))) {
             $returnStr .= '<tr id=subtype2><td align=top>' . Language::labelUserUserSubType() . '</td><td>';
             $returnStr .= $this->showDropDown(array(USER_SYSADMIN_MAIN => Language::labelSysadminMain(), USER_SYSADMIN => Language::labelSysadminAdmin()), $user->getUserSubType(), 'usersubtype');
             $returnStr .= '</td></tr>';
         } else {
             $returnStr .= '<tr id=subtype style="display: none;"><td align=top>' . Language::labelUserUserSubType() . '</td><td>';
             $returnStr .= $this->showDropDown(array(USER_NURSE_MAIN => Language::labelNurseMain(), USER_NURSE_LAB => Language::labelNurseLab(), USER_NURSE_FIELD => Language::labelNurseField(), USER_NURSE_VISION => Language::labelNurseVision()), $user->getUserSubType(), 'usersubtype');
             $returnStr .= '</td></tr>';
             $returnStr .= '<tr id=subtype2 style="display: none;"><td align=top>' . Language::labelUserUserSubType() . '</td><td>';
             $returnStr .= $this->showDropDown(array(USER_SYSADMIN_MAIN => Language::labelSysadminMain(), USER_SYSADMIN => Language::labelSysadminAdmin()), $user->getUserSubType(), 'usersubtype');
             $returnStr .= '</td></tr>';
         }
     }
     if (inArray($user->getUserType(), array(USER_INTERVIEWER, USER_CATIINTERVIEWER, USER_NURSE, USER_SUPERVISOR))) {
         $returnStr .= '<tr id=super><td>' . Language::labelUserSupervisor() . '</td><td>';
         $users = new Users();
         $users = $users->getUsersByType(USER_SUPERVISOR);
         $returnStr .= $this->displayUsers($users, $user->getSupervisor(), 'uridsel', true);
         $returnStr .= '</td></tr>';
     }
     $extra = '';
     if (inArray($user->getUserType(), array(USER_NURSE, USER_INTERVIEWER, USER_SUPERVISOR, USER_CATIINTERVIEWER))) {
         $extra = "style='display: none;'";
     }
     $returnStr .= '<tr id="surveyaccess"' . $extra . '><td>' . Language::labelUserSurveyAllowed() . '</td><td>' . $this->displaySurveys(SETTING_USER_SURVEYS . "[]", SETTING_USER_SURVEYS, implode("~", $user->getSurveysAccess()), '', "multiple") . '</td></tr>';
     $returnStr .= '</table></div>';
     $returnStr .= '<div class="col-md-6">';
     $returnStr .= '<table>';
     $returnStr .= '<tr><td align=top>' . Language::labelUserPassword() . '</td><td><input type="text" class="form-control" name="pwd1"></td></tr>';
     $returnStr .= '<tr><td align=top>' . Language::labelUserPassword2() . '</td><td><input type="text" class="form-control" name="pwd2"></td></tr>';
     $returnStr .= '</table></div></div>';
     if ($urid != "") {
         $returnStr .= '<br/><input type="submit" class="btn btn-default" value="' . Language::buttonEdit() . '"/>';
     } else {
         $returnStr .= '<br/><input type="submit" class="btn btn-default" value="' . Language::buttonAdd() . '"/>';
     }
     $returnStr .= '</div></form>';
     $suid = $_SESSION['SUID'];
     /* available surveys */
     if ($urid != "") {
         $extra = '';
         if (inArray($user->getUserType(), array(USER_NURSE, USER_INTERVIEWER, USER_SUPERVISOR, USER_CATIINTERVIEWER))) {
             $extra = "style='display: none;'";
         }
         $returnStr .= "<div " . $extra . " id='accessdiv'>";
         $returnStr .= "<form id=refreshform method=post>";
         $returnStr .= '<input type=hidden name=page value="sysadmin.users.edituser">';
         $returnStr .= '<input type=hidden name="' . SMS_POST_SURVEY . '" id="' . SMS_POST_SURVEY . '_hidden" value="' . getSurvey() . '">';
         $returnStr .= "</form>";
         $returnStr .= '<form id="editform1" method="post">';
         $returnStr .= setSessionParamsPost(array('page' => 'sysadmin.users.edituseraccessres', 'urid' => $urid));
         $returnStr .= '<span class="label label-default">' . Language::labelUserAccess() . '</span>';
         $returnStr .= '<div class="well">';
         $returnStr .= "<table>";
         $allsurveys = $user->getSurveysAccess();
         if (!inArray($suid, $allsurveys)) {
             $suid = $allsurveys[0];
         }
         $survey = new Survey($suid);
         $u = $_SESSION['URID'];
         $_SESSION['URID'] = $urid;
         // pretend to be edited user for a moment to get surveys to display
         $returnStr .= '<tr><td>' . Language::labelUserSurveyAccess() . '</td><td>' . $this->displaySurveys(SMS_POST_SURVEY, SMS_POST_SURVEY, $suid, '', "") . '</td></tr>';
         $_SESSION['URID'] = $u;
         $returnStr .= "<script type='text/javascript'>";
         $returnStr .= '$( document ).ready(function() {
                                             $("#' . SMS_POST_SURVEY . '").change(function (e) {
                                                 $("#' . SMS_POST_SURVEY . '_hidden").val(this.value);                                                     
                                                 $("#refreshform").submit();
                                             });
                                             })';
         $returnStr .= "</script>";
         /* available modes */
         $modes = Common::surveyModes();
         $allowedmodes = explode("~", $survey->getAllowedModes());
         $usermodes = $user->getModes($suid);
         foreach ($allowedmodes as $mode) {
             $returnStr .= "<tr class='modesrow'><td>" . $modes[$mode] . "</td><td>";
             $returnStr .= $this->displayUserMode(SETTING_USER_MODE . $mode, inArray($mode, $usermodes));
             $userlanguages = $user->getLanguages($suid, $mode);
             $returnStr .= "<td>" . Language::labelUserLanguageAllowed() . "</td>";
             $returnStr .= "<td>" . $this->displayLanguagesAdmin(SETTING_USER_LANGUAGES . $mode, SETTING_USER_LANGUAGES . $mode, $userlanguages, true, false, false, "multiple", $survey->getAllowedLanguages($mode)) . "</td>";
             $returnStr .= "</tr>";
         }
         $returnStr .= '</table>';
         $returnStr .= '<br/><input type="submit" class="btn btn-default" value="' . Language::buttonEdit() . '"/>';
         $returnStr .= '</div></form></div>';
     }
     $returnStr .= '</p></div>    </div>';
     //container and wrap
     $returnStr .= $this->showBottomBar();
     $returnStr .= $this->showFooter(false);
     return $returnStr;
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:101,代码来源:displayusers.php

示例10: update

    function update()
    {
        $returnStr = $this->showHeader(Language::messageSMSTitle());
        $returnStr .= $this->displayComboBox();
        $returnStr .= '<div id="wrap">';
        $returnStr .= '<div class="container"><p>';
        $returnStr .= '<div class="panel panel-default">
                <div class="panel-heading">';
        $returnStr .= '<h4>' . Language::linkUpdate() . '</h4>';
        $returnStr .= '                </div>
                <div class="panel-body">';
        require_once 'data.php';
        require_once 'display.php';
        $data = new Data();
        $values = $data->getRespondentData(getFromSessionParams('watchsuid'), getFromSessionParams('watchprimkey'));
        $returnStr .= '</div>
    <div role="panel" class="panel">';
        if (sizeof($values) == 0) {
            $returnStr .= "<br/>" . '<div class="alert alert-warning">' . Language::labelWatchNoData() . '</div>';
        } else {
            $display = $this->engine->getDisplayObject();
            $returnStr .= $display->displayDataTablesScripts(array("colvis", "rowreorder"));
            $returnStr .= "<script type='text/javascript'>\n                        \$(document).ready(function(){\n                            \$('#issuetable').dataTable(\n                                {\n                                    \"iDisplayLength\": 4,\n                                    dom: 'C<\"clear\">lfrtip',\n                                    searching: false,\n                                    paging: true\n                                    }    \n                                );\n                                         \n                       });</script>\n\n                        ";
            //
            $returnStr .= "<br/><table id='issuetable' class='table table-bordered table-striped'><thead>";
            $returnStr .= "<th>" . Language::labelUpdateVariable() . "</th><th>" . Language::labelUpdateQuestion() . "</th><th>" . Language::labelUpdateCurrent() . "</th><th>" . Language::labelUpdateChangeTo() . "</th></tr>";
            $returnStr .= "</thead><tbody>";
            $modes = Common::surveyModes();
            $languages = Language::getLanguagesArray();
            $sesid = session_id();
            require_once 'object.php';
            require_once 'component.php';
            require_once 'setting.php';
            require_once 'type.php';
            require_once 'variabledescriptive.php';
            global $survey;
            $survey = new Survey(getFromSessionParams('watchsuid'));
            $cnt = 1;
            $params = getSessionParams();
            $params[SESSION_PARAM_SURVEY] = getFromSessionParams('watchsuid');
            // add for getSurvey
            $params['testpage'] = 'updateRes';
            $paramstring = setSessionParamsPost($params);
            foreach ($values as $is) {
                $var = $survey->getVariableDescriptiveByName($is["variablename"]);
                $returnStr .= "<tr>";
                $returnStr .= "<td>" . $is["variablename"] . "</td>";
                $returnStr .= "<td>" . $var->getQuestion() . "</td>";
                $returnStr .= "<td>" . $this->getDisplayValue($var, $is["answer_dec"]) . "</td>";
                $returnStr .= "<td>" . $this->displayInput($paramstring, $is["variablename"], $var, $is["answer_dec"], $cnt) . "</td>";
                $returnStr .= "</tr>";
                $cnt++;
            }
            $returnStr .= "</tbody></table>";
        }
        $returnStr .= '</div>
  </div>
</div>';
        $returnStr .= '                </div></div>';
        $returnStr .= '</p></div>    </div>';
        //container and wrap
        $returnStr .= $this->showFooter(false);
        echo $returnStr;
    }
开发者ID:nubissurveying,项目名称:nubis,代码行数:64,代码来源:updater.php

示例11: displayModesAdmin

 function displayModesAdmin($name, $id, $value, $multiple = "", $list = "", $onchange = "")
 {
     $returnStr = $this->displayComboBox();
     $tag = "";
     if ($multiple != "") {
         $tag = "[]";
     }
     $returnStr .= '<select ' . $onchange . ' ' . $multiple . ' id="' . $id . '" name="' . $name . $tag . '" class="form-control selectpicker show-tick">';
     $modes = Common::surveyModes();
     ksort($modes);
     $values = explode("~", $value);
     $modelist = explode("~", $list);
     $icons = array(MODE_CAPI => "data-icon='glyphicon glyphicon-user'", MODE_CATI => "data-icon='glyphicon glyphicon-earphone'", MODE_CASI => "data-icon='glyphicon glyphicon-globe'", MODE_CADI => "data-icon='glyphicon glyphicon-pencil'");
     foreach ($modes as $k => $mode) {
         if (trim($list) == "" || inArray($k, $modelist)) {
             $selected = "";
             if (inArray($k, $values)) {
                 $selected = "SELECTED";
             }
             $icon = $icons[$k];
             $returnStr .= "<option {$icon} {$selected} value=" . $k . ">" . $mode . "</option>";
         }
     }
     $returnStr .= "</select>";
     return $returnStr;
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:26,代码来源:display.php


注:本文中的Common::surveyModes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。