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


PHP Display::displayError方法代码示例

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


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

示例1: showEditRes

 function showEditRes($primkey, $type = 1)
 {
     $communication = new Communication();
     if ($type == 1) {
         $respondent = new Respondent($primkey);
         $respondent->setFirstName(loadvar('firstname'), true);
         $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
         $respondent->setLastName(loadvar('lastname'), true);
         $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     } else {
         $respondent = new Household($primkey);
         $respondent->setName(loadvar('name'), true);
     }
     $respondent->setAddress1(loadvar('address1'), true);
     $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     $respondent->setAddress2(loadvar('address2'), true);
     $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     $respondent->setZip(loadvar('zip'), true);
     $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     $respondent->setCity(loadvar('city'), true);
     $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     $respondent->setTelephone1(loadvar('telephone1'), true);
     $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     //$respondent->setTelephone2(loadvar('telephone2'));
     //$communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     $respondent->setEmail(loadvar('email'), true);
     $communication->addSQLToUser($respondent->getLastQuery(), $respondent->getUrid());
     //log???
     $errorMessage = $respondent->saveChanges();
     $display = new Display();
     $messageEditError = $display->displaySuccess(Language::messageRespondentChanged($respondent));
     //'<div class="alert alert-info">Changes saved.</div>';
     if (sizeof($errorMessage) > 0) {
         $messageEditError = $display->displayError(implode('<br/>', $errorMessage));
     }
     $displaySupervisor = new DisplaySupervisor();
     return $displaySupervisor->showInfo($respondent, $messageEditError);
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:38,代码来源:supervisor.php

示例2: getSurvey

function getSurvey()
{
    /* SMS */
    if ($_SESSION['SYSTEM_ENTRY'] == USCIC_SMS) {
        if (loadvar(SMS_POST_SURVEY) != "") {
            $_SESSION['SUID'] = loadvar(SMS_POST_SURVEY);
        }
        if (isset($_SESSION['SUID'])) {
            return $_SESSION['SUID'];
        }
        $surveys = new Surveys();
        $suid = $surveys->getFirstSurvey(true);
        if (isSurvey($l)) {
            $_SESSION['SUID'] = $suid;
            return $suid;
        }
        $_SESSION['SUID'] = 1;
        return 1;
    }
    /* SURVEY */
    // check for new survey
    global $engine, $suid;
    /* get from loadvar */
    $l = loadvarSurvey(POST_PARAM_SUID);
    if (isSurvey($l)) {
        $suid = $l;
        $_SESSION["PARAMS"][SESSION_PARAM_SURVEY] = $l;
        return $suid;
    }
    $l = getFromSessionParams(SESSION_PARAM_NEWSURVEY);
    if (isSurvey($l)) {
        $_SESSION["PARAMS"][SESSION_PARAM_SURVEY] = $l;
        unset($_SESSION["PARAMS"][SESSION_PARAM_NEWSURVEY]);
        $suid = $l;
        return $suid;
    }
    // check for old survey
    $l = getFromSessionParams(SESSION_PARAM_SURVEY);
    if (isSurvey($l)) {
        $suid = $l;
        $_SESSION["PARAMS"][SESSION_PARAM_SURVEY] = $l;
        return $suid;
    }
    /* global suid has been set (via setting below, so no need to repeat) */
    if (isSurvey($suid)) {
        return $suid;
    }
    /* check for default survey */
    $l = getDefaultSurvey();
    if (isSurvey($l)) {
        $suid = $l;
        $_SESSION["PARAMS"][SESSION_PARAM_SURVEY] = $l;
        return $suid;
    }
    /* everything else failed */
    $surveys = new Surveys();
    $suid = $surveys->getFirstSurvey(true);
    if ($suid == "") {
        $display = new Display();
        echo $display->displayError(Language::messageSurveyUnavailable());
        doExit();
    }
    $_SESSION["PARAMS"][SESSION_PARAM_SURVEY] = $suid;
    return $suid;
}
开发者ID:nubissurveying,项目名称:nubis,代码行数:65,代码来源:functions.php

示例3: showEditRes

 function showEditRes($primkey)
 {
     $respondent = new Respondent($primkey);
     $respondent->setFirstName(loadvar('firstname'));
     $respondent->setLastName(loadvar('lastname'));
     $respondent->setAddress1(loadvar('address1'));
     $respondent->setAddress2(loadvar('address2'));
     $respondent->setZip(loadvar('zip'));
     $respondent->setCity(loadvar('city'));
     $respondent->setTelephone1(loadvar('telephone1'));
     $respondent->setTelephone2(loadvar('telephone2'));
     $respondent->setEmail(loadvar('email'));
     //log???
     $errorMessage = $respondent->saveChanges();
     $display = new Display();
     $messageEditError = $display->displaySuccess(Language::messageRespondentChanged($primkey));
     //'<div class="alert alert-info">Changes saved.</div>';
     if (sizeof($errorMessage) > 0) {
         $messageEditError = $display->displayError(implode('<br/>', $errorMessage));
     }
     $displayCatiInterviewer = new DisplayCatiInterviewer();
     return $displayCatiInterviewer->showInfo($respondent, $messageEditError);
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:23,代码来源:catiinterviewer.php

示例4: foreach

     foreach ($mods as $m) {
         $user->setLanguages($this->addtosuid, $m, $survey->getAllowedLanguages($m));
     }
     $user->saveChanges();
     // return result
     return "";
 }
 function importMMIC()
 {
     set_time_limit(0);
     $this->importdb = new Database();
     $server = loadvar(SETTING_IMPORT_SERVER);
     if ($server == "") {
         $server = "localhost";
     }
     if ($this->importdb->connect($server, loadvar(SETTING_IMPORT_DATABASE), loadvar(SETTING_IMPORT_USER), loadvar(SETTING_IMPORT_PASSWORD)) == false) {
         $display = new Display();
         return $display->displayError(Language::messageToolsImportDbFailure());
     }
     $this->sourcetable = loadvar(SETTING_IMPORT_TABLE);
     // add
     if (loadvar(SETTING_IMPORT_AS) == IMPORT_TARGET_ADD) {
         $surveys = new Surveys();
         $this->addtosuid = $surveys->getMaximumSuid();
     } else {
         if (loadvar(SETTING_IMPORT_AS) == IMPORT_TARGET_REPLACE) {
             $this->addtosuid = 0;
             /* delete existing content */
             $tables = Common::surveyTables();
             foreach ($tables as $table) {
                 $query = "delete from " . Config::dbSurvey() . $table;
                 $this->db->executeQuery($query);
             }
             /* delete existing data */
             $tables = Common::surveyDataTables();
             foreach ($tables as $table) {
                 if ($table == "_actions") {
                     $query = "delete from " . Config::dbSurvey() . $table . " where suid != ''";
                 } else {
                     $query = "delete from " . Config::dbSurvey() . $table;
                 }
                 $this->db->executeQuery($query);
             }
             /* delete test data */
             $tables = Common::surveyTestDataTables();
             foreach ($tables as $table) {
                 if ($table == "_actions") {
                     $query = "delete from " . Config::dbSurvey() . $table . " where suid != ''";
                 } else {
                     $query = "delete from " . Config::dbSurvey() . $table;
                 }
                 $this->db->executeQuery($query);
             }
开发者ID:nubissurveying,项目名称:nubis,代码行数:53,代码来源:importer.php

示例5: showEditRes

 function showEditRes($primkey, $type = 1)
 {
     if ($type == 1) {
         $respondent = new Respondent($primkey);
         $respondent->setFirstName(loadvar('firstname'));
         $respondent->setLastName(loadvar('lastname'));
     } else {
         $respondent = new Household($primkey);
         $respondent->setName(loadvar('name'));
         $respondent->setAddress1(loadvar('address1'));
         $respondent->setAddress2(loadvar('address2'));
         $respondent->setZip(loadvar('zip'));
         $respondent->setCity(loadvar('city'));
     }
     if (dbConfig::defaultPanel() == PANEL_RESPONDENT) {
         //only save for respondent panels
         $respondent->setAddress1(loadvar('address1'));
         $respondent->setAddress2(loadvar('address2'));
         $respondent->setZip(loadvar('zip'));
         $respondent->setCity(loadvar('city'));
     }
     $respondent->setTelephone1(loadvar('telephone1'));
     //$respondent->setTelephone2(loadvar('telephone2'));
     $respondent->setEmail(loadvar('email'));
     //log???
     $errorMessage = $respondent->saveChanges();
     $display = new Display();
     $messageEditError = $display->displaySuccess(Language::messageRespondentChanged($respondent));
     //'<div class="alert alert-info">Changes saved.</div>';
     if (sizeof($errorMessage) > 0) {
         $messageEditError = $display->displayError(implode('<br/>', $errorMessage));
     }
     $displayInterviewer = new DisplayInterviewer();
     return $displayInterviewer->showInfo($respondent, $messageEditError);
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:35,代码来源:interviewer.php


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