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


PHP limesurvey_lang类代码示例

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


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

示例1: die

    die("No QID provided.");
}
if (!isset($_GET['lang']) || $_GET['lang'] == "") {
    $language = GetBaseLanguageFromSurveyID($surveyid);
} else {
    $language = $_GET['lang'];
}
$_SESSION['s_lang'] = $language;
$_SESSION['fieldmap'] = createFieldMap($surveyid, 'full', true, $qid);
// Prefill question/answer from defaultvalues
foreach ($_SESSION['fieldmap'] as $field) {
    if (isset($field['defaultvalue'])) {
        $_SESSION[$field['fieldname']] = $field['defaultvalue'];
    }
}
$clang = new limesurvey_lang($language);
$thissurvey = getSurveyInfo($surveyid);
$_SESSION['dateformats'] = getDateFormatData($thissurvey['surveyls_dateformat']);
$qquery = 'SELECT * FROM ' . db_table_name('questions') . " WHERE sid='{$surveyid}' AND qid='{$qid}' AND language='{$language}'";
$qresult = db_execute_assoc($qquery);
$qrows = $qresult->FetchRow();
$ia = array(0 => $qid, 1 => $surveyid . 'X' . $qrows['gid'] . 'X' . $qid, 2 => $qrows['title'], 3 => $qrows['question'], 4 => $qrows['type'], 5 => $qrows['gid'], 6 => $qrows['mandatory'], 7 => 'N', 8 => 'N');
// ia[8] is usedinconditions
$answers = retrieveAnswers($ia);
if (!$thissurvey['template']) {
    $thistpl = sGetTemplatePath($defaulttemplate);
} else {
    $thistpl = sGetTemplatePath(validate_templatedir($thissurvey['template']));
}
doHeader();
$dummy_js = '
开发者ID:himanshu12k,项目名称:ce-www,代码行数:31,代码来源:preview.php

示例2: generate_statistics

/**
* Generates statistics
*
* @param int $surveyid The survey id
* @param mixed $allfields
* @param mixed $q2show
* @param mixed $usegraph
* @param string $outputType Optional - Can be xls, html or pdf - Defaults to pdf
* @param string $pdfOutput Sets the target for the PDF output: DD=File download , F=Save file to local disk
* @param string $statlangcode Lamguage for statistics
* @param mixed $browse  Show browse buttons
* @return buffer
*/
function generate_statistics($surveyid, $allfields, $q2show='all', $usegraph=0, $outputType='pdf', $pdfOutput='I',$statlangcode=null, $browse = true)
{
    //$allfields ="";
    global $connect, $dbprefix, $clang,
    $rooturl, $rootdir, $homedir, $homeurl, $tempdir, $tempurl, $scriptname, $imagedir,
    $chartfontfile, $chartfontsize, $admintheme, $pdfdefaultfont, $pdffontsize;

    $fieldmap=createFieldMap($surveyid, "full");

    if (is_null($statlangcode))
    {
        $statlang=$clang;
    }
    else
    {
        $statlang = new limesurvey_lang($statlangcode);
    }

    /*
     * this variable is used in the function shortencode() which cuts off a question/answer title
     * after $maxchars and shows the rest as tooltip (in html mode)
     */
    $maxchars = 13;
    //we collect all the html-output within this variable
    $statisticsoutput ='';
    /**
     * $outputType: html || pdf ||
     */
    /**
     * get/set Survey Details
     */

    //no survey ID? -> come and get one
    if (!isset($surveyid)) {$surveyid=returnglobal('sid');}

    //Get an array of codes of all available languages in this survey
    $surveylanguagecodes = GetAdditionalLanguagesFromSurveyID($surveyid);
    $surveylanguagecodes[] = GetBaseLanguageFromSurveyID($surveyid);

    // Set language for questions and answers to base language of this survey
    $language=$statlangcode;

    if ($usegraph==1)
    {
        //for creating graphs we need some more scripts which are included here
        require_once(dirname(__FILE__).'/../classes/pchart/pchart/pChart.class');
        require_once(dirname(__FILE__).'/../classes/pchart/pchart/pData.class');
        require_once(dirname(__FILE__).'/../classes/pchart/pchart/pCache.class');
        $MyCache = new pCache($tempdir.'/');

        //pick the best font file if font setting is 'auto'
        if ($chartfontfile=='auto')
        {
            $chartfontfile='vera.ttf';
            if ( $language=='ar')
            {
                $chartfontfile='KacstOffice.ttf';
            }
            elseif  ($language=='fa' )
            {
                $chartfontfile='KacstFarsi.ttf';
            }

        }
    }

    if($q2show=='all' )
    {
        $summarySql=" SELECT gid, parent_qid, qid, type "
        ." FROM {$dbprefix}questions WHERE parent_qid=0"
        ." AND sid=$surveyid ";

        $summaryRs = db_execute_assoc($summarySql);

        foreach($summaryRs as $field)
        {
            $myField = $surveyid."X".$field['gid']."X".$field['qid'];

            // Multiple choice get special treatment
            if ($field['type'] == "M") {$myField = "M$myField";}
            if ($field['type'] == "P") {$myField = "P$myField";}
            //numerical input will get special treatment (arihtmetic mean, standard derivation, ...)
            if ($field['type'] == "N") {$myField = "N$myField";}

            if ($field['type'] == "|") {$myField = "|$myField";}

            if ($field['type'] == "Q") {$myField = "Q$myField";}
//.........这里部分代码省略.........
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:101,代码来源:statistics_function.php

示例3: PDF

if (isset($_POST['printableexport'])) {
    $pdf = new PDF($pdforientation, 'mm', 'A4');
    $pdf->SetFont($pdfdefaultfont, '', $pdffontsize);
    $pdf->AddPage();
}
// Set the language of the survey, either from GET parameter of session var
if (isset($_GET['lang'])) {
    $_GET['lang'] = preg_replace("/[^a-zA-Z0-9-]/", "", $_GET['lang']);
    if ($_GET['lang']) {
        $surveyprintlang = $_GET['lang'];
    }
} else {
    $surveyprintlang = GetbaseLanguageFromSurveyid($surveyid);
}
// Setting the selected language for printout
$clang = new limesurvey_lang($surveyprintlang);
$desquery = "SELECT * FROM " . db_table_name('surveys') . " inner join " . db_table_name('surveys_languagesettings') . " on (surveyls_survey_id=sid) WHERE sid={$surveyid} and surveyls_language=" . $connect->qstr($surveyprintlang);
//Getting data for this survey
$desrow = $connect->GetRow($desquery);
if ($desrow == false || count($desrow) == 0) {
    safe_die('Invalid survey ID');
}
//echo '<pre>'.print_r($desrow,true).'</pre>';
$template = $desrow['template'];
$welcome = $desrow['surveyls_welcometext'];
$end = $desrow['surveyls_endtext'];
$surveyname = $desrow['surveyls_title'];
$surveydesc = $desrow['surveyls_description'];
$surveyactive = $desrow['active'];
$surveytable = db_table_name("survey_" . $desrow['sid']);
$surveyexpirydate = $desrow['expires'];
开发者ID:karime7gezly,项目名称:OpenConextApps-LimeSurvey,代码行数:31,代码来源:printablesurvey.php

示例4: db_table_name

require_once $homedir . "/classes/core/sha256.php";
$adminoutput = "";
// just to avoid notices
include "database.php";
$query = "SELECT uid, password, lang FROM " . db_table_name('users') . " WHERE users_name=" . $connect->qstr($username);
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$result = $connect->SelectLimit($query, 1) or die($query . "\n" . $connect->ErrorMsg());
if ($result->RecordCount() < 1) {
    // wrong or unknown username and/or email
    echo "\n" . $clang->gT("User name invalid!") . "\n";
    exit;
} else {
    $fields = $result->FetchRow();
    if (SHA256::hashing($userpass) == $fields['password']) {
        $_SESSION['loginID'] = intval($fields['uid']);
        $clang = new limesurvey_lang($fields['lang']);
        GetSessionUserRights($_SESSION['loginID']);
        if (!$_SESSION['USER_RIGHT_CREATE_SURVEY']) {
            // no permission to create survey!
            echo "\n" . $clang->gT("You are not allowed to import a survey!") . "\n";
            exit;
        }
    } else {
        // password don't match username
        echo "\n" . $clang->gT("User name and password do not match!") . "\n";
        exit;
    }
}
echo "\n";
$importsurvey = "";
$importingfrom = "cmdline";
开发者ID:himanshu12k,项目名称:ce-www,代码行数:31,代码来源:cmdline_importsurvey.php

示例5: returnglobal

require_once $rootdir . '/classes/core/language.php';
$surveyid = returnglobal('sid');
$postlang = returnglobal('lang');
$token = returnglobal('token');
//Check that there is a SID
if (!isset($surveyid)) {
    //You must have an SID to use this
    include "index.php";
    exit;
}
// Get passed language from form, so that we dont loose this!
if (!isset($postlang) || $postlang == "") {
    $baselang = GetBaseLanguageFromSurveyID($surveyid);
    $clang = new limesurvey_lang($baselang);
} else {
    $clang = new limesurvey_lang($postlang);
    $baselang = $postlang;
}
$thissurvey = getSurveyInfo($surveyid, $baselang);
$html = '<div id="wrapper"><p id="optoutmessage">';
if ($thissurvey == false || !tableExists("tokens_{$surveyid}")) {
    $html .= $clang->gT('This survey does not seem to exist.');
} else {
    $usquery = "SELECT emailstatus from " . db_table_name("tokens_{$surveyid}") . " where token=" . db_quoteall($token, true);
    $usresult = $connect->GetOne($usquery);
    if ($usresult == false) {
        $html .= $clang->gT('You are not a participant in this survey.');
    } elseif ($usresult == 'OK') {
        $usquery = "Update " . db_table_name("tokens_{$surveyid}") . " set emailstatus='OptOut', usesleft=0 where token=" . db_quoteall($token, true);
        $usresult = $connect->Execute($usquery);
        $html .= $clang->gT('You have been successfully removed from this survey.');
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:optout.php

示例6: session_name

}
else
{
    session_name("LimeSurveyRuntime-$surveyid");
}

session_set_cookie_params(0,$relativeurl.'/');
session_start();

// Get passed language from form, so that we dont loose this!
if (!isset($postlang) || $postlang == "")
{
    $baselang = GetBaseLanguageFromSurveyID($surveyid);
    $clang = new limesurvey_lang($baselang);
} else {
    $clang = new limesurvey_lang($postlang);
    $baselang = $postlang;
}

$thissurvey=getSurveyInfo($surveyid,$baselang);

$register_errormsg = "";

// Check the security question's answer
if (function_exists("ImageCreate") && captcha_enabled('registrationscreen',$thissurvey['usecaptcha']) )
{
    if (!isset($_POST['loadsecurity']) ||
    !isset($_SESSION['secanswer']) ||
    $_POST['loadsecurity'] != $_SESSION['secanswer'])
    {
        $register_errormsg .= $clang->gT("The answer to the security question is incorrect.")."<br />\n";
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:register.php

示例7: index

 /**
  * Show printable survey
  */
 function index($surveyid, $lang = null)
 {
     $surveyid = sanitize_int($surveyid);
     if (!Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'read')) {
         $clang = $this->getController()->lang;
         $aData['surveyid'] = $surveyid;
         App()->getClientScript()->registerPackage('jquery-superfish');
         $message['title'] = $clang->gT('Access denied!');
         $message['message'] = $clang->gT('You do not have sufficient rights to access this page.');
         $message['class'] = "error";
         $this->_renderWrappedTemplate('survey', array("message" => $message), $aData);
     } else {
         $aSurveyInfo = getSurveyInfo($surveyid, $lang);
         if (!$aSurveyInfo) {
             $this->getController()->error('Invalid survey ID');
         }
         // Be sure to have a valid language
         $surveyprintlang = $aSurveyInfo['surveyls_language'];
         // Setting the selected language for printout
         $clang = new limesurvey_lang($surveyprintlang);
         $templatename = validateTemplateDir($aSurveyInfo['templatedir']);
         $welcome = $aSurveyInfo['surveyls_welcometext'];
         $end = $aSurveyInfo['surveyls_endtext'];
         $surveyname = $aSurveyInfo['surveyls_title'];
         $surveydesc = $aSurveyInfo['surveyls_description'];
         $surveyactive = $aSurveyInfo['active'];
         $surveytable = "{{survey_" . $aSurveyInfo['sid'] . "}}";
         $surveyexpirydate = $aSurveyInfo['expires'];
         $surveyfaxto = $aSurveyInfo['faxto'];
         $dateformattype = $aSurveyInfo['surveyls_dateformat'];
         Yii::app()->loadHelper('surveytranslator');
         if (!is_null($surveyexpirydate)) {
             $dformat = getDateFormatData($dateformattype);
             $dformat = $dformat['phpdate'];
             $expirytimestamp = strtotime($surveyexpirydate);
             $expirytimeofday_h = date('H', $expirytimestamp);
             $expirytimeofday_m = date('i', $expirytimestamp);
             $surveyexpirydate = date($dformat, $expirytimestamp);
             if (!empty($expirytimeofday_h) || !empty($expirytimeofday_m)) {
                 $surveyexpirydate .= ' &ndash; ' . $expirytimeofday_h . ':' . $expirytimeofday_m;
             }
             sprintf($clang->gT("Please submit by %s"), $surveyexpirydate);
         } else {
             $surveyexpirydate = '';
         }
         //Fix $templatename : control if print_survey.pstpl exist
         if (is_file(getTemplatePath($templatename) . DIRECTORY_SEPARATOR . 'print_survey.pstpl')) {
             $templatename = $templatename;
             // Change nothing
         } elseif (is_file(getTemplatePath(Yii::app()->getConfig("defaulttemplate")) . DIRECTORY_SEPARATOR . 'print_survey.pstpl')) {
             $templatename = Yii::app()->getConfig("defaulttemplate");
         } else {
             $templatename = "default";
         }
         $sFullTemplatePath = getTemplatePath($templatename) . DIRECTORY_SEPARATOR;
         $sFullTemplateUrl = getTemplateURL($templatename) . "/";
         define('PRINT_TEMPLATE_DIR', $sFullTemplatePath, true);
         define('PRINT_TEMPLATE_URL', $sFullTemplateUrl, true);
         LimeExpressionManager::StartSurvey($surveyid, 'survey', NULL, false, LEM_PRETTY_PRINT_ALL_SYNTAX);
         $moveResult = LimeExpressionManager::NavigateForwards();
         $condition = "sid = '{$surveyid}' AND language = '{$surveyprintlang}'";
         $degresult = QuestionGroup::model()->getAllGroups($condition, array('group_order'));
         //xiao,
         if (!isset($surveyfaxto) || !$surveyfaxto and isset($surveyfaxnumber)) {
             $surveyfaxto = $surveyfaxnumber;
             //Use system fax number if none is set in survey.
         }
         $headelements = getPrintableHeader();
         //if $showsgqacode is enabled at config.php show table name for reference
         $showsgqacode = Yii::app()->getConfig("showsgqacode");
         if (isset($showsgqacode) && $showsgqacode == true) {
             $surveyname = $surveyname . "<br />[" . $clang->gT('Database') . " " . $clang->gT('table') . ": {$surveytable}]";
         } else {
             $surveyname = $surveyname;
         }
         $survey_output = array('SITENAME' => Yii::app()->getConfig("sitename"), 'SURVEYNAME' => $surveyname, 'SURVEYDESCRIPTION' => $surveydesc, 'WELCOME' => $welcome, 'END' => $end, 'THEREAREXQUESTIONS' => 0, 'SUBMIT_TEXT' => $clang->gT("Submit Your Survey."), 'SUBMIT_BY' => $surveyexpirydate, 'THANKS' => $clang->gT("Thank you for completing this survey."), 'HEADELEMENTS' => $headelements, 'TEMPLATEURL' => PRINT_TEMPLATE_URL, 'FAXTO' => $surveyfaxto, 'PRIVACY' => '', 'GROUPS' => '');
         $survey_output['FAX_TO'] = '';
         if (!empty($surveyfaxto) && $surveyfaxto != '000-00000000') {
             $survey_output['FAX_TO'] = $clang->gT("Please fax your completed survey to:") . " {$surveyfaxto}";
         }
         $total_questions = 0;
         $mapquestionsNumbers = array();
         $answertext = '';
         // otherwise can throw an error on line 1617
         $fieldmap = createFieldMap($surveyid, 'full', false, false, $surveyprintlang);
         // =========================================================
         // START doin the business:
         foreach ($degresult->readAll() as $degrow) {
             // ---------------------------------------------------
             // START doing groups
             $deqresult = Question::model()->getQuestions($surveyid, $degrow['gid'], $surveyprintlang, 0, '"I"');
             $deqrows = array();
             //Create an empty array in case FetchRow does not return any rows
             foreach ($deqresult->readAll() as $deqrow) {
                 $deqrows[] = $deqrow;
             }
             // Get table output into array
//.........这里部分代码省略.........
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:101,代码来源:printablesurvey.php

示例8: init

 public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOptions)
 {
     parent::init($survey, $sLanguageCode, $oOptions);
     $pdfdefaultfont = Yii::app()->getConfig('pdfdefaultfont');
     $pdffontsize = Yii::app()->getConfig('pdffontsize');
     $pdforientation = Yii::app()->getConfig('pdforientation');
     $clang = new limesurvey_lang($sLanguageCode);
     if ($oOptions->output == 'file') {
         $this->pdfDestination = 'F';
     } else {
         $this->pdfDestination = 'D';
     }
     Yii::import('application.libraries.admin.pdf', true);
     if ($pdfdefaultfont == 'auto') {
         $pdfdefaultfont = PDF_FONT_NAME_DATA;
     }
     // Array of PDF core fonts: are replaced by according fonts according to the alternatepdffontfile array.Maybe just courier,helvetica and times but if a user want symbol: why not ....
     $pdfcorefont = array("courier", "helvetica", "symbol", "times", "zapfdingbats");
     $pdffontsize = Yii::app()->getConfig('pdffontsize');
     // create new PDF document
     $this->pdf = new pdf();
     if (in_array($pdfdefaultfont, $pdfcorefont)) {
         $alternatepdffontfile = Yii::app()->getConfig('alternatepdffontfile');
         if (array_key_exists($sLanguageCode, $alternatepdffontfile)) {
             $pdfdefaultfont = $alternatepdffontfile[$sLanguageCode];
             // Actually use only core font
         }
     }
     if ($pdffontsize == 'auto') {
         $pdffontsize = PDF_FONT_SIZE_MAIN;
     }
     $this->pdf = new pdf();
     $this->pdf->SetFont($pdfdefaultfont, '', $pdffontsize);
     $this->pdf->AddPage();
     $this->pdf->intopdf("PDF export " . date("Y.m.d-H:i", time()));
     //Set some pdf metadata
     Yii::app()->loadHelper('surveytranslator');
     $lg = array();
     $lg['a_meta_charset'] = 'UTF-8';
     if (getLanguageRTL($sLanguageCode)) {
         $lg['a_meta_dir'] = 'rtl';
     } else {
         $lg['a_meta_dir'] = 'ltr';
     }
     $lg['a_meta_language'] = $sLanguageCode;
     $lg['w_page'] = $clang->gT("page");
     $this->pdf->setLanguageArray($lg);
     $this->separator = "\t";
     $this->rowCounter = 0;
     $this->surveyName = $survey->languageSettings[0]['surveyls_title'];
     $this->pdf->titleintopdf($this->surveyName, $survey->languageSettings[0]['surveyls_description']);
 }
开发者ID:pmaonline,项目名称:limesurvey-quickstart,代码行数:52,代码来源:exportresults_helper.php

示例9: createFieldMap

/**
* This function generates an array containing the fieldcode, and matching data in the same order as the activate script
*
* @param string $surveyid The Survey ID
* @param mixed $style 'short' (default) or 'full' - full creates extra information like default values
* @param mixed $force_refresh - Forces to really refresh the array, not just take the session copy
* @param int $questionid Limit to a certain qid only (for question preview) - default is false
* @return array
*/
function createFieldMap($surveyid, $style = 'full', $force_refresh = false, $questionid = false, $sQuestionLanguage = null)
{
    global $dbprefix, $connect, $clang, $aDuplicateQIDs;
    $surveyid = sanitize_int($surveyid);
    //Get list of questions
    if (is_null($sQuestionLanguage)) {
        if (isset($_SESSION['s_lang']) && in_array($_SESSION['s_lang'], GetAdditionalLanguagesFromSurveyID($surveyid))) {
            $sQuestionLanguage = $_SESSION['s_lang'];
        } else {
            $sQuestionLanguage = GetBaseLanguageFromSurveyID($surveyid);
        }
    }
    $sQuestionLanguage = sanitize_languagecode($sQuestionLanguage);
    if ($clang->langcode != $sQuestionLanguage) {
        SetSurveyLanguage($surveyid, $sQuestionLanguage);
    }
    $s_lang = $clang->langcode;
    //checks to see if fieldmap has already been built for this page.
    if (isset($_SESSION['fieldmap-' . $surveyid . $s_lang]) && !$force_refresh && $questionid == false) {
        if (isset($_SESSION['adminlang']) && $clang->langcode != $_SESSION['adminlang']) {
            $clang = new limesurvey_lang($_SESSION['adminlang']);
        }
        return $_SESSION['fieldmap-' . $surveyid . $s_lang];
    }
    $fieldmap["id"] = array("fieldname" => "id", 'sid' => $surveyid, 'type' => "id", "gid" => "", "qid" => "", "aid" => "");
    if ($style == "full") {
        $fieldmap["id"]['title'] = "";
        $fieldmap["id"]['question'] = $clang->gT("Response ID");
        $fieldmap["id"]['group_name'] = "";
    }
    $fieldmap["submitdate"] = array("fieldname" => "submitdate", 'type' => "submitdate", 'sid' => $surveyid, "gid" => "", "qid" => "", "aid" => "");
    if ($style == "full") {
        $fieldmap["submitdate"]['title'] = "";
        $fieldmap["submitdate"]['question'] = $clang->gT("Date submitted");
        $fieldmap["submitdate"]['group_name'] = "";
    }
    $fieldmap["lastpage"] = array("fieldname" => "lastpage", 'sid' => $surveyid, 'type' => "lastpage", "gid" => "", "qid" => "", "aid" => "");
    if ($style == "full") {
        $fieldmap["lastpage"]['title'] = "";
        $fieldmap["lastpage"]['question'] = $clang->gT("Last page");
        $fieldmap["lastpage"]['group_name'] = "";
    }
    $fieldmap["startlanguage"] = array("fieldname" => "startlanguage", 'sid' => $surveyid, 'type' => "startlanguage", "gid" => "", "qid" => "", "aid" => "");
    if ($style == "full") {
        $fieldmap["startlanguage"]['title'] = "";
        $fieldmap["startlanguage"]['question'] = $clang->gT("Start language");
        $fieldmap["startlanguage"]['group_name'] = "";
    }
    //Check for any additional fields for this survey and create necessary fields (token and datestamp and ipaddr)
    $pquery = "SELECT anonymized, datestamp, ipaddr, refurl FROM " . db_table_name('surveys') . " WHERE sid={$surveyid}";
    $presult = db_execute_assoc($pquery);
    //Checked
    while ($prow = $presult->FetchRow()) {
        if ($prow['anonymized'] == "N") {
            $fieldmap["token"] = array("fieldname" => "token", 'sid' => $surveyid, 'type' => "token", "gid" => "", "qid" => "", "aid" => "");
            if ($style == "full") {
                $fieldmap["token"]['title'] = "";
                $fieldmap["token"]['question'] = $clang->gT("Token");
                $fieldmap["token"]['group_name'] = "";
            }
        }
        if ($prow['datestamp'] == "Y") {
            $fieldmap["datestamp"] = array("fieldname" => "datestamp", 'type' => "datestamp", 'sid' => $surveyid, "gid" => "", "qid" => "", "aid" => "");
            if ($style == "full") {
                $fieldmap["datestamp"]['title'] = "";
                $fieldmap["datestamp"]['question'] = $clang->gT("Date last action");
                $fieldmap["datestamp"]['group_name'] = "";
            }
            $fieldmap["startdate"] = array("fieldname" => "startdate", 'type' => "startdate", 'sid' => $surveyid, "gid" => "", "qid" => "", "aid" => "");
            if ($style == "full") {
                $fieldmap["startdate"]['title'] = "";
                $fieldmap["startdate"]['question'] = $clang->gT("Date started");
                $fieldmap["startdate"]['group_name'] = "";
            }
        }
        if ($prow['ipaddr'] == "Y") {
            $fieldmap["ipaddr"] = array("fieldname" => "ipaddr", 'type' => "ipaddress", 'sid' => $surveyid, "gid" => "", "qid" => "", "aid" => "");
            if ($style == "full") {
                $fieldmap["ipaddr"]['title'] = "";
                $fieldmap["ipaddr"]['question'] = $clang->gT("IP address");
                $fieldmap["ipaddr"]['group_name'] = "";
            }
        }
        // Add 'refurl' to fieldmap.
        if ($prow['refurl'] == "Y") {
            $fieldmap["refurl"] = array("fieldname" => "refurl", 'type' => "url", 'sid' => $surveyid, "gid" => "", "qid" => "", "aid" => "");
            if ($style == "full") {
                $fieldmap["refurl"]['title'] = "";
                $fieldmap["refurl"]['question'] = $clang->gT("Referrer URL");
                $fieldmap["refurl"]['group_name'] = "";
            }
//.........这里部分代码省略.........
开发者ID:ddrmoscow,项目名称:queXS,代码行数:101,代码来源:common_functions.php

示例10: die

 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 *
 * $Id: createdb.php 9622 2010-12-10 21:38:02Z c_schmitz $
 */
//Ensure script is not run directly, avoid path disclosure
if (isset($_REQUEST['rootdir'])) {
    die('You cannot start this script directly');
}
require_once dirname(__FILE__) . '/../../config-defaults.php';
require_once dirname(__FILE__) . '/../../common.php';
require_once $rootdir . '/classes/core/language.php';
require_once dirname(__FILE__) . '/../admin_functions.php';
$clang = new limesurvey_lang("en");
$dbname = $databasename;
sendcacheheaders();
echo getAdminHeader();
echo "<div class='messagebox ui-corner-all'><div class='header ui-widget-header' >" . $clang->gT("Create Database") . "</div><p>\n";
echo $clang->gT("Creating tables. This might take a moment...") . "<p>&nbsp;\n";
// In Step2 fill the database with data
if (returnglobal('createdbstep2') == $clang->gT("Populate Database")) {
    $createdbtype = $databasetype;
    if ($databasetype == 'mysql' || $databasetype == 'mysqli') {
        @$connect->Execute("ALTER DATABASE `{$dbname}` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;");
        $createdbtype = 'mysql';
    }
    if ($createdbtype == 'mssql_n' || $createdbtype == 'odbc_mssql' || $createdbtype == 'odbtp') {
        $createdbtype = 'mssql';
    }
开发者ID:rkaldung,项目名称:LimeSurvey,代码行数:31,代码来源:createdb.php

示例11: intval

            }
        } else {
            // User already exists
            $isAuthenticated = true;
        }
        if ($isAuthenticated === true) {
            // user exists and was authenticated by webserver
            $fields = $result->FetchRow();
            $_SESSION['loginID'] = intval($fields['uid']);
            $_SESSION['user'] = $fields['users_name'];
            $_SESSION['adminlang'] = $fields['lang'];
            $_SESSION['htmleditormode'] = $fields['htmleditormode'];
            $_SESSION['dateformat'] = $fields['dateformat'];
            $_SESSION['checksessionpost'] = sRandomChars(10);
            $_SESSION['pw_notify'] = false;
            $clang = new limesurvey_lang($_SESSION['adminlang']);
            $login = true;
            $loginsummary .= "<br /><span style='font-weight:bold;'>" . sprintf($clang->gT("Welcome %s!"), $_SESSION['user']) . "</span><br />";
            $loginsummary .= $clang->gT("You logged in successfully.");
            if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] && strpos($_SERVER['QUERY_STRING'], "action=logout") === FALSE) {
                $_SESSION['metaHeader'] = "<meta http-equiv=\"refresh\"" . " content=\"1;URL={$scriptname}?" . $_SERVER['QUERY_STRING'] . "\" />";
                $loginsummary .= "<p><font size='1'><i>" . $clang->gT("Reloading screen. Please wait.") . "</i></font>\n";
            }
            $loginsummary .= "<br /><br />\n";
            GetSessionUserRights($_SESSION['loginID']);
        }
    }
} elseif ($action == "logout") {
    killSession();
    $logoutsummary = '<p>' . $clang->gT("Logout successful.");
} elseif ($action == "adduser" && $_SESSION['USER_RIGHT_CREATE_USER']) {
开发者ID:himanshu12k,项目名称:ce-www,代码行数:31,代码来源:usercontrol.php

示例12: session_name

    }
} else {
    session_name("LimeSurveyRuntime-{$surveyid}");
}
session_set_cookie_params(0, $relativeurl . '/');
@session_start();
if (isset($_SESSION['sid'])) {
    $surveyid = $_SESSION['sid'];
} else {
    die('Invalid survey/session');
}
//Debut session time out
if (!isset($_SESSION['finished']) || !isset($_SESSION['srid'])) {
    require_once $rootdir . '/classes/core/language.php';
    $baselang = GetBaseLanguageFromSurveyID($surveyid);
    $clang = new limesurvey_lang($baselang);
    //A nice exit
    sendcacheheaders();
    doHeader();
    echo templatereplace(file_get_contents(sGetTemplatePath(validate_templatedir("default")) . "/startpage.pstpl"));
    echo "<center><br />\n" . "\t<font color='RED'><strong>" . $clang->gT("ERROR") . "</strong></font><br />\n" . "\t" . $clang->gT("We are sorry but your session has expired.") . "<br />" . $clang->gT("Either you have been inactive for too long, you have cookies disabled for your browser, or there were problems with your connection.") . "<br />\n" . "\t" . sprintf($clang->gT("Please contact %s ( %s ) for further assistance."), $siteadminname, $siteadminemail) . "\n" . "</center><br />\n";
    echo templatereplace(file_get_contents(sGetTemplatePath(validate_templatedir("default")) . "/endpage.pstpl"));
    doFooter();
    exit;
}
//Fin session time out
$id = $_SESSION['srid'];
//I want to see the answers with this id
$clang = $_SESSION['s_lang'];
//A little bit of debug to see in the noodles plate
/*if ($debug==2)
开发者ID:karime7gezly,项目名称:OpenConextApps-LimeSurvey,代码行数:31,代码来源:printanswers.php

示例13: GetAdditionalLanguagesFromSurveyID

        $dataentryoutput .= "<div class='successheader'>".$clang->gT("Record Deleted")." (ID: $id)</div><br /><br />\n"
        ."<input type='submit' value='".$clang->gT("Browse Responses")."' onclick=\"window.open('$scriptname?action=browse&amp;sid=$surveyid&amp;subaction=all', '_top')\" /><br /><br />\n"
        ."</div>\n";
    }
    else
    {
        $slangs = GetAdditionalLanguagesFromSurveyID($surveyid);
        $baselang = GetBaseLanguageFromSurveyID($surveyid);
        array_unshift($slangs,$baselang);

        if(!isset($_GET['language']) || !in_array($_GET['language'],$slangs))
        {
            $sDataEntryLanguage = $baselang;
            $blang = $clang;
        } else {
            $blang = new limesurvey_lang($_GET['language']);
            $sDataEntryLanguage = $_GET['language'];
        }

        $langlistbox = languageDropdown($surveyid,$sDataEntryLanguage);
        $thissurvey=getSurveyInfo($surveyid);
        //This is the default, presenting a blank dataentry form
        $fieldmap=createFieldMap($surveyid);
        // PRESENT SURVEY DATAENTRY SCREEN
        $dataentryoutput .= $surveyoptions;

        $dataentryoutput .= "<div class='header ui-widget-header'>".$clang->gT("Data entry")."</div>\n";

        $dataentryoutput .= "<form action='$scriptname?action=dataentry' enctype='multipart/form-data' name='addsurvey' method='post' id='addsurvey'>\n"
        ."<table class='data-entry-tbl' cellspacing='0'>\n"
        ."\t<tr>\n"
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:dataentry.php

示例14: session_name

        } else {
            @session_name($stg_SessionName . '-runtime-' . $surveyid);
        }
    } else {
        @session_name($stg_SessionName . '-runtime-publicportal');
    }
} else {
    session_name("LimeSurveyRuntime-{$surveyid}");
}
session_set_cookie_params(0, $relativeurl . '/admin/');
@session_start();
if (empty($_SESSION) || !isset($_SESSION['fieldname'])) {
    die("You don't have a valid session !");
}
$baselang = GetBaseLanguageFromSurveyID($surveyid);
$clang = new limesurvey_lang($baselang);
$randfilename = 'futmp_' . sRandomChars(15);
$sTempUploadDir = $tempdir . '/upload/';
$randfileloc = $sTempUploadDir . $randfilename;
$filename = $_FILES['uploadfile']['name'];
$size = 0.001 * $_FILES['uploadfile']['size'];
$valid_extensions = strtolower($_POST['valid_extensions']);
$maxfilesize = (int) $_POST['max_filesize'];
$preview = $_POST['preview'];
$fieldname = $_POST['fieldname'];
$aFieldMap = createFieldMap($surveyid);
if (!isset($aFieldMap[$fieldname])) {
    die;
}
$aAttributes = getQuestionAttributes($aFieldMap[$fieldname]['qid'], $aFieldMap[$fieldname]['type']);
$valid_extensions_array = explode(",", $aAttributes['allowed_filetypes']);
开发者ID:ddrmoscow,项目名称:queXS,代码行数:31,代码来源:upload.php

示例15: quexml_export

/**
* Export quexml survey.
*/
function quexml_export($surveyi, $quexmllan)
{
    global $dom, $quexmllang, $iSurveyID;
    $quexmllang = $quexmllan;
    $iSurveyID = $surveyi;
    $qlang = new limesurvey_lang($quexmllang);
    $dom = new DOMDocument('1.0', 'UTF-8');
    //Title and survey id
    $questionnaire = $dom->createElement("questionnaire");
    $Query = "SELECT * FROM {{surveys}},{{surveys_languagesettings}} WHERE sid={$iSurveyID} and surveyls_survey_id=sid and surveyls_language='" . $quexmllang . "'";
    $QueryResult = Yii::app()->db->createCommand($Query)->query();
    $Row = $QueryResult->read();
    $questionnaire->setAttribute("id", $Row['sid']);
    $title = $dom->createElement("title", QueXMLCleanup($Row['surveyls_title']));
    $questionnaire->appendChild($title);
    //investigator and datacollector
    $investigator = $dom->createElement("investigator");
    $name = $dom->createElement("name");
    $name = $dom->createElement("firstName");
    $name = $dom->createElement("lastName");
    $dataCollector = $dom->createElement("dataCollector");
    $questionnaire->appendChild($investigator);
    $questionnaire->appendChild($dataCollector);
    //questionnaireInfo == welcome
    if (!empty($Row['surveyls_welcometext'])) {
        $questionnaireInfo = $dom->createElement("questionnaireInfo");
        $position = $dom->createElement("position", "before");
        $text = $dom->createElement("text", QueXMLCleanup($Row['surveyls_welcometext']));
        $administration = $dom->createElement("administration", "self");
        $questionnaireInfo->appendChild($position);
        $questionnaireInfo->appendChild($text);
        $questionnaireInfo->appendChild($administration);
        $questionnaire->appendChild($questionnaireInfo);
    }
    if (!empty($Row['surveyls_endtext'])) {
        $questionnaireInfo = $dom->createElement("questionnaireInfo");
        $position = $dom->createElement("position", "after");
        $text = $dom->createElement("text", QueXMLCleanup($Row['surveyls_endtext']));
        $administration = $dom->createElement("administration", "self");
        $questionnaireInfo->appendChild($position);
        $questionnaireInfo->appendChild($text);
        $questionnaireInfo->appendChild($administration);
        $questionnaire->appendChild($questionnaireInfo);
    }
    //section == group
    $Query = "SELECT * FROM {{groups}} WHERE sid={$iSurveyID} AND language='{$quexmllang}' order by group_order ASC";
    $QueryResult = Yii::app()->db->createCommand($Query)->query();
    //for each section
    foreach ($QueryResult->readAll() as $Row) {
        $gid = $Row['gid'];
        $section = $dom->createElement("section");
        if (!empty($Row['group_name'])) {
            $sectionInfo = $dom->createElement("sectionInfo");
            $position = $dom->createElement("position", "title");
            $text = $dom->createElement("text", QueXMLCleanup($Row['group_name']));
            $administration = $dom->createElement("administration", "self");
            $sectionInfo->appendChild($position);
            $sectionInfo->appendChild($text);
            $sectionInfo->appendChild($administration);
            $section->appendChild($sectionInfo);
        }
        if (!empty($Row['description'])) {
            $sectionInfo = $dom->createElement("sectionInfo");
            $position = $dom->createElement("position", "before");
            $text = $dom->createElement("text", QueXMLCleanup($Row['description']));
            $administration = $dom->createElement("administration", "self");
            $sectionInfo->appendChild($position);
            $sectionInfo->appendChild($text);
            $sectionInfo->appendChild($administration);
            $section->appendChild($sectionInfo);
        }
        $section->setAttribute("id", $gid);
        //boilerplate questions convert to sectionInfo elements
        $Query = "SELECT * FROM {{questions}} WHERE sid={$iSurveyID} AND gid = {$gid} AND type LIKE 'X'  AND language='{$quexmllang}' ORDER BY question_order ASC";
        $QR = Yii::app()->db->createCommand($Query)->query();
        foreach ($QR->readAll() as $RowQ) {
            $sectionInfo = $dom->createElement("sectionInfo");
            $position = $dom->createElement("position", "before");
            $text = $dom->createElement("text", QueXMLCleanup($RowQ['question']));
            $administration = $dom->createElement("administration", "self");
            $sectionInfo->appendChild($position);
            $sectionInfo->appendChild($text);
            $sectionInfo->appendChild($administration);
            $section->appendChild($sectionInfo);
        }
        //foreach question
        $Query = "SELECT * FROM {{questions}} WHERE sid={$iSurveyID} AND gid = {$gid} AND parent_qid=0 AND language='{$quexmllang}' AND type NOT LIKE 'X' ORDER BY question_order ASC";
        $QR = Yii::app()->db->createCommand($Query)->query();
        foreach ($QR->readAll() as $RowQ) {
            $question = $dom->createElement("question");
            $type = $RowQ['type'];
            $qid = $RowQ['qid'];
            $other = false;
            if ($RowQ['other'] == 'Y') {
                $other = true;
            }
            //create a new text element for each new line
//.........这里部分代码省略.........
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:101,代码来源:export_helper.php


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