• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP incompleteAnsFilterstate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: safe_die

    //NOCOLUMN
    exit;
}
$aColumnNames = $connect->MetaColumnNames("{$dbprefix}survey_{$surveyid}");
if (!isset($aColumnNames[strtoupper($column)])) {
    safe_die('Invalid column name');
}
if ($connect->databaseType == 'odbc_mssql' || $connect->databaseType == 'odbtp' || $connect->databaseType == 'mssql_n' || $connect->databaseType == 'mssqlnative') {
    $query = "SELECT id, " . db_quote_id($column) . " FROM {$dbprefix}survey_{$surveyid} WHERE (" . db_quote_id($column) . " NOT LIKE '')";
} else {
    $query = "SELECT id, " . db_quote_id($column) . " FROM {$dbprefix}survey_{$surveyid} WHERE (" . db_quote_id($column) . " != '')";
}
if ($sql && $sql != "NULL") {
    $query .= " AND " . auto_unescape(urldecode($sql));
}
switch (incompleteAnsFilterstate()) {
    case 'inc':
        //Inclomplete answers only
        $query .= ' AND submitdate is null ';
        break;
    case 'filter':
        //Inclomplete answers only
        $query .= ' AND submitdate is not null ';
        break;
}
if ($order == "alpha") {
    $query .= " ORDER BY " . db_quote_id($column);
} else {
    $query .= " ORDER BY id";
}
$result = db_execute_assoc($query) or safe_die("Error with query: " . $query . "<br />" . $connect->ErrorMsg());
开发者ID:rkaldung,项目名称:LimeSurvey,代码行数:31,代码来源:listcolumn.php


示例2: generate_statistics


//.........这里部分代码省略.........
                    $selects[] = db_quote_id('datestamp')." >= '".$_POST[$pv]." 00:00:00' and ".db_quote_id('datestamp')." <= '".$_POST[$pv]." 23:59:59'";
                }
                else
                {
                    //timestamp less than
                    if (substr($pv, -1, 1) == "L" && !empty($_POST[$pv]))
                    {
                        $datetimeobj = new Date_Time_Converter($_POST[$pv], $formatdata['phpdate'].' H:i');
                        $_POST[$pv]=$datetimeobj->convert("Y-m-d H:i:s");
                        $selects[]= db_quote_id('datestamp')." < '".$_POST[$pv]."'";
                    }

                    //timestamp greater than
                    if (substr($pv, -1, 1) == "G" && !empty($_POST[$pv]))
                    {
                        $datetimeobj = new Date_Time_Converter($_POST[$pv], $formatdata['phpdate'].' H:i');
                        $_POST[$pv]=$datetimeobj->convert("Y-m-d H:i:s");
                        $selects[]= db_quote_id('datestamp')." > '".$_POST[$pv]."'";
                    }
                }
            }
        }
        else
        {
            $statisticsoutput .= "<!-- $pv DOES NOT EXIST IN ARRAY -->";
        }

    }	//end foreach -> loop through filter options to create SQL

    //count number of answers
    $query = "SELECT count(*) FROM ".db_table_name("survey_$surveyid");

    //if incompleted answers should be filtert submitdate has to be not null
    if (incompleteAnsFilterstate() == "inc") {$query .= " WHERE submitdate is null";}
    elseif (incompleteAnsFilterstate() == "filter") {$query .= " WHERE submitdate is not null";}
    $result = db_execute_num($query) or safe_die ("Couldn't get total<br />$query<br />".$connect->ErrorMsg());

    //$total = total number of answers
    while ($row=$result->FetchRow()) {$total=$row[0];}

    //are there any filters that have to be taken care of?
    if (isset($selects) && $selects)
    {
        //filter incomplete answers?
        if (incompleteAnsFilterstate() == "filter" || incompleteAnsFilterstate() == "inc") {$query .= " AND ";}

        else {$query .= " WHERE ";}

        //add filter criteria to SQL
        $query .= implode(" AND ", $selects);
    }

    //$_POST['sql'] is a post field that is sent from the statistics script to the export script in order
    // to export just those results filtered by this statistics script. It can also be passed to the statistics
    // script to filter from external scripts.
    elseif (!empty($_POST['sql']) && !isset($_POST['id=']))
    {
        $newsql=substr($_POST['sql'], strpos($_POST['sql'], "WHERE")+5, strlen($_POST['sql']));

        //for debugging only
        //$query = $_POST['sql'];

        //filter incomplete answers?
        if (incompleteAnsFilterstate() == "inc") {$query .= " AND ".$newsql;}
        elseif (incompleteAnsFilterstate() == "filter") {$query .= " AND ".$newsql;}
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:66,代码来源:statistics_function.php


示例3: array

 * line becomes part of the next column.  Since we want to restrict this script to ONE scan of
 * the data (scan & output at same time), the information needed to construct the
 * DATA LIST is held in the $fields array, while the actual data is written to a
 * to a temporary location, updating length (size) values in the $fields array as
 * the tmp file is generated (uses @fwrite's return value rather than strlen).
 * Final output renders $fields to a DATA LIST, and then stitches in the tmp file data.
 *
 * Optimization opportunities remain in the VALUE LABELS section, which runs a query / column
 */
include_once 'login_check.php';
//for scale 1=nominal, 2=ordinal, 3=scale
$typeMap = array('5' => array('name' => '5 Point Choice', 'size' => 1, 'SPSStype' => 'F', 'Scale' => 3), 'B' => array('name' => 'Array (10 Point Choice)', 'size' => 1, 'SPSStype' => 'F', 'Scale' => 3), 'A' => array('name' => 'Array (5 Point Choice)', 'size' => 1, 'SPSStype' => 'F', 'Scale' => 3), 'F' => array('name' => 'Array (Flexible Labels)', 'size' => 1, 'SPSStype' => 'F'), '1' => array('name' => 'Array (Flexible Labels) Dual Scale', 'size' => 1, 'SPSStype' => 'F'), 'H' => array('name' => 'Array (Flexible Labels) by Column', 'size' => 1, 'SPSStype' => 'F'), 'E' => array('name' => 'Array (Increase, Same, Decrease)', 'size' => 1, 'SPSStype' => 'F', 'Scale' => 2), 'C' => array('name' => 'Array (Yes/No/Uncertain)', 'size' => 1, 'SPSStype' => 'F'), 'X' => array('name' => 'Boilerplate Question', 'size' => 1, 'SPSStype' => 'A', 'hide' => 1), 'D' => array('name' => 'Date', 'size' => 10, 'SPSStype' => 'SDATE'), 'G' => array('name' => 'Gender', 'size' => 1, 'SPSStype' => 'F'), 'U' => array('name' => 'Huge Free Text', 'size' => 1, 'SPSStype' => 'A'), 'I' => array('name' => 'Language Switch', 'size' => 1, 'SPSStype' => 'A'), '!' => array('name' => 'List (Dropdown)', 'size' => 1, 'SPSStype' => 'F'), 'W' => array('name' => 'List (Flexible Labels) (Dropdown)', 'size' => 1, 'SPSStype' => 'F'), 'Z' => array('name' => 'List (Flexible Labels) (Radio)', 'size' => 1, 'SPSStype' => 'F'), 'L' => array('name' => 'List (Radio)', 'size' => 1, 'SPSStype' => 'F'), 'O' => array('name' => 'List With Comment', 'size' => 1, 'SPSStype' => 'F'), 'T' => array('name' => 'Long free text', 'size' => 1, 'SPSStype' => 'A'), 'K' => array('name' => 'Multiple Numerical Input', 'size' => 1, 'SPSStype' => 'F'), 'M' => array('name' => 'Multiple choice', 'size' => 1, 'SPSStype' => 'F'), 'P' => array('name' => 'Multiple choice with comments', 'size' => 1, 'SPSStype' => 'F'), 'Q' => array('name' => 'Multiple Short Text', 'size' => 1, 'SPSStype' => 'F'), 'N' => array('name' => 'Numerical Input', 'size' => 3, 'SPSStype' => 'F', 'Scale' => 3), 'R' => array('name' => 'Ranking', 'size' => 1, 'SPSStype' => 'F'), 'S' => array('name' => 'Short free text', 'size' => 1, 'SPSStype' => 'F'), 'Y' => array('name' => 'Yes/No', 'size' => 1, 'SPSStype' => 'F'), ':' => array('name' => 'Multi flexi numbers', 'size' => 1, 'SPSStype' => 'F', 'Scale' => 3), ';' => array('name' => 'Multi flexi text', 'size' => 1, 'SPSStype' => 'A'), '|' => array('name' => 'File upload', 'size' => 1, 'SPSStype' => 'A'), '*' => array('name' => 'Equation', 'size' => 1, 'SPSStype' => 'A'));
if (!isset($surveyid)) {
    $surveyid = returnglobal('sid');
}
$filterstate = incompleteAnsFilterstate();
$quexsfilterstate = questionnaireSampleFilterstate();
$spssver = returnglobal('spssver');
if (is_null($spssver)) {
    if (!isset($_SESSION['spssversion'])) {
        $_SESSION['spssversion'] = 2;
        //Set default to 2, version 16 or up
    }
    $spssver = $_SESSION['spssversion'];
} else {
    $_SESSION['spssversion'] = $spssver;
}
$length_varlabel = '255';
// Set the max text length of Variable Labels
$length_vallabel = '120';
// Set the max text length of Value Labels
开发者ID:ddrmoscow,项目名称:queXS,代码行数:31,代码来源:export_data_spss.php


示例4: elseif

 if ($next >= $dtcount) {
     $next = $dtcount - $limit;
 }
 if ($end < 0) {
     $end = 0;
 }
 $browseoutput .= "<div class='menubar'>\n" . "\t<div class='menubar-title ui-widget-header'>\n" . "<strong>" . $clang->gT("Data view control") . "</strong></div>\n" . "\t<div class='menubar-main'>\n";
 if (!isset($_POST['sql'])) {
     $browseoutput .= "<a href='{$scriptname}?action=browse&amp;subaction=time&amp;sid={$surveyid}&amp;start=0&amp;limit={$limit}' " . "title='" . $clang->gTview("Show start...") . "' >" . "<img name='DataBegin' align='left' src='{$imageurl}/databegin.png' alt='" . $clang->gT("Show start...") . "' /></a>\n" . "<a href='{$scriptname}?action=browse&amp;subaction=time&amp;sid={$surveyid}&amp;start={$last}&amp;limit={$limit}' " . "title='" . $clang->gTview("Show previous..") . "' >" . "<img name='DataBack' align='left'  src='{$imageurl}/databack.png' alt='" . $clang->gT("Show previous..") . "' /></a>\n" . "<img src='{$imageurl}/blank.gif' width='13' height='20' border='0' hspace='0' align='left' alt='' />\n" . "<a href='{$scriptname}?action=browse&amp;subaction=time&amp;sid={$surveyid}&amp;start={$next}&amp;limit={$limit}' " . "title='" . $clang->gT("Show next...") . "' >" . "<img name='DataForward' align='left' src='{$imageurl}/dataforward.png' alt='" . $clang->gT("Show next..") . "' /></a>\n" . "<a href='{$scriptname}?action=browse&amp;subaction=time&amp;sid={$surveyid}&amp;start={$end}&amp;limit={$limit}' " . "title='" . $clang->gT("Show last...") . "' >" . "<img name='DataEnd' align='left' src='{$imageurl}/dataend.png' alt='" . $clang->gT("Show last..") . "' /></a>\n" . "<img src='{$imageurl}/seperator.gif' border='0' hspace='0' align='left' alt='' />\n";
 }
 $selectshow = '';
 $selectinc = '';
 $selecthide = '';
 if (incompleteAnsFilterstate() == "inc") {
     $selectinc = "selected='selected'";
 } elseif (incompleteAnsFilterstate() == "filter") {
     $selecthide = "selected='selected'";
 } else {
     $selectshow = "selected='selected'";
 }
 $browseoutput .= "<form action='{$scriptname}?action=browse' id='browseresults' method='post'><font size='1' face='verdana'>\n" . "<img src='{$imageurl}/blank.gif' width='31' height='20' border='0' hspace='0' align='right' alt='' />\n" . "" . $clang->gT("Records displayed:") . "<input type='text' size='4' value='{$dtcount2}' name='limit' id='limit' />\n" . "&nbsp;&nbsp; " . $clang->gT("Starting from:") . "<input type='text' size='4' value='{$start}' name='start' id='start' />\n" . "&nbsp;&nbsp;&nbsp;&nbsp;<input type='submit' value='" . $clang->gT("Show") . "' />\n" . "</font>\n" . "<input type='hidden' name='sid' value='{$surveyid}' />\n" . "<input type='hidden' name='action' value='browse' />\n" . "<input type='hidden' name='subaction' value='time' />\n";
 if (isset($_POST['sql'])) {
     $browseoutput .= "<input type='hidden' name='sql' value='" . html_escape($_POST['sql']) . "' />\n";
 }
 $browseoutput .= "</form></div>\n" . "\t</div><form action='{$scriptname}?action=browse' id='resulttableform' method='post'>\n";
 $browseoutput .= $tableheader;
 $dateformatdetails = getDateFormatData($_SESSION['dateformat']);
 while ($dtrow = $dtresult->FetchRow()) {
     if (!isset($bgcc)) {
         $bgcc = "evenrow";
     } else {
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:browse.php


示例5: spss_getquery

/**
 * Creates a query string with all fields for the export
 *
 * @return string
 */
function spss_getquery()
{
    global $surveyprivate, $dbprefix, $surveyid, $tokensexist;
    #See if tokens are being used
    if (isset($tokensexist) && $tokensexist == true && $surveyprivate == 'N') {
        $query = "SELECT case1.case_id as caseid, ";
        $tokenattributes = GetTokenFieldsAndNames($surveyid, false, false);
        foreach ($tokenattributes as $attributefield => $attributedescription) {
            //Drop the token field, since it is in the survey too
            if ($attributefield != 'token' && $attributefield != 'callattempts' && $attributefield != 'onappointment') {
                $query .= "{$dbprefix}tokens_{$surveyid}.{$attributefield}, ";
            }
        }
        $query .= "{$dbprefix}survey_{$surveyid}.*\n\t    FROM {$dbprefix}survey_{$surveyid}\n\t    JOIN `case` as case1 ON ({$dbprefix}survey_{$surveyid}.token = case1.token)\n\t    LEFT JOIN {$dbprefix}tokens_{$surveyid} ON {$dbprefix}survey_{$surveyid}.token = {$dbprefix}tokens_{$surveyid}.token";
    } else {
        $query = "SELECT *\n\t    FROM {$dbprefix}survey_{$surveyid}";
    }
    $qfs = questionnaireSampleFilterstate();
    if ($qfs != false) {
        //Limit responses by questionnaire and/or sample
        $query .= "\tJOIN `case` AS c ON ({$dbprefix}survey_{$surveyid}.token = c.token AND c.questionnaire_id = '{$qfs[0]}') ";
        if ($qfs[1] != 0) {
            //if a sample is selected
            $query .= "\tJOIN `sample` AS s ON (s.sample_id = c.sample_id AND s.import_id = '{$qfs[1]}') ";
        }
    }
    switch (incompleteAnsFilterstate()) {
        case 'inc':
            //Inclomplete answers only
            $query .= ' WHERE submitdate is null ';
            break;
        case 'filter':
            //Inclomplete answers only
            $query .= ' WHERE submitdate is not null ';
            break;
    }
    return $query;
}
开发者ID:ddrmoscow,项目名称:queXS,代码行数:43,代码来源:export_data_functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP increase_memory_limit_to函数代码示例发布时间:2022-05-15
下一篇:
PHP incompleteAnsFilterState函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap