/limesurvey/admin/statistics.php
PHP | 1680 lines | 1081 code | 275 blank | 324 comment | 173 complexity | d266707484116d47e06f65a3907e2864 MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, LGPL-2.1, LGPL-3.0, GPL-2.0, Apache-2.0
Large files files are truncated, but you can click here to view the full file
- <?php
- /*
- * LimeSurvey
- * Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
- * All rights reserved.
- * License: GNU/GPL License v2 or later, see LICENSE.php
- * LimeSurvey is free software. This version may have been modified pursuant
- * 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: statistics.php 9648 2011-01-07 13:06:39Z c_schmitz $
- *
- */
- /*
- * We need this later:
- * 1 - Array Dual Scale
- * 5 - 5 Point Choice
- * A - Array (5 Point Choice)
- * B - Array (10 Point Choice)
- * C - Array (Yes/No/Uncertain)
- * D - Date
- * E - Array (Increase, Same, Decrease)
- * F - Array (Flexible Labels)
- * G - Gender
- * H - Array (Flexible Labels) by Column
- * I - Language Switch
- * K - Multiple Numerical Input
- * L - List (Radio)
- * M - Multiple choice
- * N - Numerical Input
- * O - List With Comment
- * P - Multiple choice with comments
- * Q - Multiple Short Text
- * R - Ranking
- * S - Short Free Text
- * T - Long Free Text
- * U - Huge Free Text
- * X - Boilerplate Question
- * Y - Yes/No
- * ! - List (Dropdown)
- * : - Array (Flexible Labels) multiple drop down
- * ; - Array (Flexible Labels) multiple texts
- * | - File Upload
- Debugging help:
- echo '<script language="javascript" type="text/javascript">alert("HI");</script>';
- */
- //split up results to extend statistics -> NOT WORKING YET! DO NOT ENABLE THIS!
- $showcombinedresults = 0;
- /*
- * this variable is used in the function shortencode() which cuts off a question/answer title
- * after $maxchars and shows the rest as tooltip
- */
- $maxchars = 50;
- //don't call this script directly!
- if (isset($_REQUEST['homedir'])) {die('You cannot start this script directly');}
- //some includes, the progressbar is used to show a progressbar while generating the graphs
- //include_once("login_check.php");
- require_once('classes/core/class.progressbar.php');
- //we collect all the output within this variable
- $statisticsoutput ='';
- //output for chosing questions to cross query
- $cr_statisticsoutput = '';
- // This gets all the 'to be shown questions' from the POST and puts these into an array
- $summary=returnglobal('summary');
- $statlang=returnglobal('statlang');
- //if $summary isn't an array we create one
- if (isset($summary) && !is_array($summary)) {
- $summary = explode("+", $summary);
- }
- //no survey ID? -> come and get one
- if (!isset($surveyid)) {$surveyid=returnglobal('sid');}
- //still no survey ID -> error
- if (!$surveyid)
- {
- //need to have a survey id
- $statisticsoutput .= "<center>You have not selected a survey!</center>";
- exit;
- }
- // Set language for questions and answers to base language of this survey
- $language = GetBaseLanguageFromSurveyID($surveyid);
- //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';
- }
- elseif ($language=='el' )
- {
- $chartfontfile='DejaVuLGCSans.ttf';
- }
- elseif ($language=='zh-Hant-HK' || $language=='zh-Hant-TW' || $language=='zh-Hans')
- {
- $chartfontfile='fireflysung.ttf';
- }
- }
- //$statisticsoutput .= "
- //<script type='text/javascript'' >
- //<!--
- //function selectAll(name){
- // //var name=name;
- //
- // alert(name);
- //
- // temp = document.+name+.elements.length;
- //
- // for (i=0; i < temp; i++) {
- // if(document.+name+.elements[i].checked == 1)
- // {document.+name+.elements[i].checked = 0;
- // document.+name+.+name+_btn.value = 'Select All'; }
- // else {document.+name.elements[i].checked = 1;
- // document.+name+.+name+_btn.value = 'Deselect All'; }
- // }
- //}
- ////-->
- //</script>";
- //hide/show the filter
- //filtersettings by default aren't shown when showing the results
- $statisticsoutput .= '<script type="text/javascript" src="scripts/statistics.js"></script>';
- //headline with all icons for available statistic options
- //Get the menubar
- $statisticsoutput .= browsemenubar($clang->gT("Quick statistics"))
- //we need a form which can pass the selected data later
- ."<form method='post' name='formbuilder' action='$scriptname?action=statistics#start'>\n";
- //Select public language file
- $query = "SELECT datestamp FROM {$dbprefix}surveys WHERE sid=$surveyid";
- $result = db_execute_assoc($query) or safe_die("Error selecting language: <br />".$query."<br />".$connect->ErrorMsg());
- /*
- * check if there is a datestamp available for this survey
- * yes -> $datestamp="Y"
- * no -> $datestamp="N"
- */
- while ($row=$result->FetchRow()) {$datestamp=$row['datestamp'];}
- // 1: Get list of questions from survey
- /*
- * We want to have the following data
- * a) "questions" -> all table namens, e.g.
- * qid
- * sid
- * gid
- * type
- * title
- * question
- * preg
- * help
- * other
- * mandatory
- * lid
- * lid1
- * question_order
- * language
- *
- * b) "groups" -> group_name + group_order *
- */
- $query = "SELECT questions.*, groups.group_name, groups.group_order\n"
- ." FROM ".db_table_name("questions") ." as questions, ".db_table_name("groups")." as groups\n"
- ." WHERE groups.gid=questions.gid\n"
- ." AND groups.language='".$language."'\n"
- ." AND questions.language='".$language."'\n"
- ." AND questions.parent_qid=0\n"
- ." AND questions.sid=$surveyid";
- $result = db_execute_assoc($query) or safe_die("Couldn't do it!<br />$query<br />".$connect->ErrorMsg());
- //store all the data in $rows
- $rows = $result->GetRows();
- //SORT IN NATURAL ORDER!
- usort($rows, 'GroupOrderThenQuestionOrder');
- //put the question information into the filter array
- foreach ($rows as $row)
- {
- //store some column names in $filters array
- $filters[]=array($row['qid'],
- $row['gid'],
- $row['type'],
- $row['title'],
- $row['group_name'],
- FlattenText($row['question']));
- }
- //var_dump($filters);
- // SHOW ID FIELD
- $statisticsoutput .= "<div class='header ui-widget-header'>".$clang->gT("General filters")."</div><div id='statistics_general_filter'>";
- $grapherror='';
- if (!function_exists("gd_info")) {
- $grapherror.='<br />'.$clang->gT('You do not have the GD Library installed. Showing charts requires the GD library to function properly.');
- $grapherror.='<br />'.$clang->gT('visit http://us2.php.net/manual/en/ref.image.php for more information').'<br />';
- }
- elseif (!function_exists("imageftbbox")) {
- $grapherror.='<br />'.$clang->gT('You do not have the Freetype Library installed. Showing charts requires the Freetype library to function properly.');
- $grapherror.='<br />'.$clang->gT('visit http://us2.php.net/manual/en/ref.image.php for more information').'<br />';
- }
- if ($grapherror!='')
- {
- unset($_POST['usegraph']);
- }
- //pre-selection of filter forms
- if (incompleteAnsFilterstate() == "filter")
- {
- $selecthide="selected='selected'";
- $selectshow="";
- $selectinc="";
- }
- elseif (incompleteAnsFilterstate() == "inc")
- {
- $selecthide="";
- $selectshow="";
- $selectinc="selected='selected'";
- }
- else
- {
- $selecthide="";
- $selectshow="selected='selected'";
- $selectinc="";
- }
- $statisticsoutput .="<fieldset style='clear:both;'><legend>".$clang->gT("Data selection")."</legend><ul>";
- $statisticsoutput .="<li><label for='filterinc'>".$clang->gT("Include:")."</label><select name='filterinc' id='filterinc'>\n"
- ."<option value='show' $selectshow>".$clang->gT("All responses")."</option>\n"
- ."<option value='filter' $selecthide>".$clang->gT("Completed responses only")."</option>\n"
- ."<option value='incomplete' $selectinc>".$clang->gT("Incomplete responses only")."</option>\n"
- ."</select></li>\n"
- ."<li><label for='viewsummaryall'>".$clang->gT("View summary of all available fields")."</label>
- <input type='checkbox' id='viewsummaryall' name='viewsummaryall' ";
- if (isset($_POST['viewsummaryall'])) {$statisticsoutput .= "checked='checked'";}
- $statisticsoutput.="/></li>";
- $statisticsoutput .="<li id='vertical_slide'";
- //if ($selecthide!='')
- //{
- // $statisticsoutput .= " style='display:none' ";
- //}
- $statisticsoutput.=" ><label id='noncompletedlbl' for='noncompleted' title='".$clang->gT("Count stats for each question based only on the total number of responses for which the question was displayed")."'>".$clang->gT("Subtotals based on displayed questions")."</label>
- <input type='checkbox' id='noncompleted' name='noncompleted' ";
- if (isset($_POST['noncompleted'])) {$statisticsoutput .= "checked='checked'";}
- $statisticsoutput.=" />\n</li>\n";
- $survlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
- $survlangs [] = GetBaseLanguageFromSurveyID($surveyid);
- $language_options="";
- foreach ($survlangs as $survlang)
- {
- $language_options .= "\t<option value=\"{$survlang}\"";
- if ($_SESSION['adminlang'] == $survlang)
- {
- $language_options .= "selected=\"selected\" " ;
- }
- $language_options .= ">".getLanguageNameFromCode($survlang,true)."</option>\n";
- }
- $statisticsoutput .="<li><label for='statlang'>".$clang->gT("Statistics report language")."</label>"
- . " <select name=\"statlang\" id=\"statlang\">".$language_options."</select>\n";
- $statisticsoutput.="\n</ul></fieldset>\n";
- $statisticsoutput .= "<fieldset id='left'><legend>".$clang->gT("Response ID")."</legend><ul><li>"
- ."<label for='idG'>".$clang->gT("Greater than:")."</label>\n"
- ."<input type='text' id='idG' name='idG' size='10' value='";
- if (isset($_POST['idG'])){$statisticsoutput .= sanitize_int($_POST['idG']);}
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789')\" /></li><li><label for='idL'>\n"
- .$clang->gT("Less than:")."</label>\n"
- ."<input type='text' id='idL' name='idL' size='10' value='";
- if (isset($_POST['idL'])) {$statisticsoutput .= sanitize_int($_POST['idL']);}
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789')\" /></li></ul></fieldset>\n";
- $statisticsoutput .= "<input type='hidden' name='summary[]' value='idG' />";
- $statisticsoutput .= "<input type='hidden' name='summary[]' value='idL' />";
- //if the survey contains timestamps you can filter by timestamp, too
- if (isset($datestamp) && $datestamp == "Y") {
- $statisticsoutput .= "<fieldset id='right'><legend>".$clang->gT("Submission date")."</legend><ul><li>"
- ."<label for='datestampE'>".$clang->gT("Equals:")."</label>\n"
- ."<input class='popupdate' id='datestampE' name='datestampE' type='text' value='";
- if (isset($_POST['datestampE'])) {$statisticsoutput .= $_POST['datestampE'];}
- $statisticsoutput .= "' /></li><li><label for='datestampG'>\n"
- ." ".$clang->gT("Later than:")."</label>\n"
- ."<input class='popupdatetime' id='datestampG' name='datestampG' value='";
- if (isset($_POST['datestampG'])) {$statisticsoutput .= $_POST['datestampG'];}
- $statisticsoutput .= "' type='text' /></li><li><label for='datestampL'> ".$clang->gT("Earlier than:")."</label><input class='popupdatetime' id='datestampL' name='datestampL' value='";
- if (isset($_POST['datestampL'])) {$statisticsoutput .= $_POST['datestampL'];}
- $statisticsoutput .= "' type='text' /></li></ul></fieldset>\n";
- $statisticsoutput .= "<input type='hidden' name='summary[]' value='datestampE' />";
- $statisticsoutput .= "<input type='hidden' name='summary[]' value='datestampG' />";
- $statisticsoutput .= "<input type='hidden' name='summary[]' value='datestampL' />";
- }
- $statisticsoutput .="<fieldset><legend>".$clang->gT("Output options")."</legend><ul>"
- ."<li><label for='usegraph'>".$clang->gT("Show graphs")."</label><input type='checkbox' id='usegraph' name='usegraph' ";
- if (isset($_POST['usegraph'])) {$statisticsoutput .= "checked='checked'";}
- $statisticsoutput .= "/><br />";
- if ($grapherror!='')
- {
- $statisticsoutput.="<span id='grapherror' style='display:none'>$grapherror<hr /></span>";
- }
- $statisticsoutput.="</li>\n";
- //Output selector
- $statisticsoutput .= "<li>"
- ."<label>"
- .$clang->gT("Select output format").":</label>"
- ."<input type='radio' name='outputtype' value='html' checked='checked' /><label for='outputtype'>HTML</label> <input type='radio' name='outputtype' value='pdf' /><label for='outputtype'>PDF</label> <input type='radio' onclick='nographs();' name='outputtype' value='xls' /><label for='outputtype'>Excel</label>";
- $statisticsoutput .= "</ul></fieldset></div><p>"
- ."<input type='submit' value='".$clang->gT("View stats")."' />\n"
- ."<input type='button' value='".$clang->gT("Clear")."' onclick=\"window.open('$scriptname?action=statistics&sid=$surveyid', '_top')\" />\n";
- //second row below options -> filter settings headline
- $statisticsoutput.="<div class='header header_statistics'>"
- ."<img src='$imageurl/plus.gif' align='right' id='showfilter' /><img src='$imageurl/minus.gif' align='right' id='hidefilter' />"
- .$clang->gT("Response filters")
- ."</div>\n";
- $filterchoice_state=returnglobal('filterchoice_state');
- $statisticsoutput.="<input type='hidden' id='filterchoice_state' name='filterchoice_state' value='{$filterchoice_state}' />\n";
- $statisticsoutput .="<table cellspacing='0' cellpadding='0' width='100%' id='filterchoices' ";
- if ($filterchoice_state!='')
- {
- $statisticsoutput .= " style='display:none' ";
- }
- $statisticsoutput .=">";
- /*
- * let's go through the filter array which contains
- * ['qid'],
- ['gid'],
- ['type'],
- ['title'],
- ['group_name'],
- ['question'],
- ['lid'],
- ['lid1']);
- */
- $currentgroup='';
- foreach ($filters as $flt)
- {
- //is there a previous question type set?
- if (!isset($previousquestiontype)) {$previousquestiontype="";}
- //does gid equal $currentgroup?
- if ($flt[1] != $currentgroup)
- {
- //If the groupname has changed, start a new row
- if ($currentgroup!='')
- {
- //if we've already drawn a table for a group, and we're changing - close off table
- $statisticsoutput .= "<!-- Close filter group --></tr>\n</table></div></td></tr>\n";
- }
- $statisticsoutput .= "\t\t<tr><td><div class='header ui-widget-header'>\n"
-
- ."<input type=\"checkbox\" id='btn_$flt[1]' onclick=\"selectCheckboxes('grp_$flt[1]', 'summary[]', 'btn_$flt[1]');\" />"
- //use current groupname and groupid as heading
- ."<font size='1'><strong>$flt[4]</strong> (".$clang->gT("Question group")." $flt[1])</font></div></td></tr>\n\t\t"
- ."<tr><td align='center'>\n"
- ."<div id='grp_$flt[1]'><table class='filtertable'><tr>\n";
- //counter which is used to adapt layout depending on counter #
- $counter=0;
- }
- //we don't want more than 4 questions in a row
- //and we need a new row after each multiple/array question
- if (isset($counter) && $counter == 4 ||
- ($previousquestiontype == "1" ||
- $previousquestiontype == "A" ||
- $previousquestiontype == "B" ||
- $previousquestiontype == "C" ||
- $previousquestiontype == "E" ||
- $previousquestiontype == "F" ||
- $previousquestiontype == "H" ||
- $previousquestiontype == "K" ||
- $previousquestiontype == "Q" ||
- $previousquestiontype == "R" ||
- $previousquestiontype == ":" ||
- $previousquestiontype == ";"))
- {
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>"; $counter=0;
- }
- /*
- * remember: $flt is structured like this
- * ['qid'],
- ['gid'],
- ['type'],
- ['title'],
- ['group_name'],
- ['question'],
- ['lid'],
- ['lid1']);
- */
- //SGQ identifier
- $myfield = "{$surveyid}X{$flt[1]}X{$flt[0]}";
- //full question title
- $niceqtext = FlattenText($flt[5]);
- /*
- * Check question type: This question types will be used (all others are separated in the if clause)
- * 5 - 5 Point Choice
- G - Gender
- I - Language Switch
- L - List (Radio)
- M - Multiple choice
- N - Numerical Input
- | - File Upload
- O - List With Comment
- P - Multiple choice with comments
- Y - Yes/No
- ! - List (Dropdown) )
- */
- if ($flt[2]=='M' || $flt[2]=='P' || $flt[2]=='N' || $flt[2]=='L' || $flt[2]=='5'
- || $flt[2]=='G' || $flt[2]=='I' || $flt[2]=='O' || $flt[2]=='Y' || $flt[2]=='!') //Have to make an exception for these types!
- {
- $statisticsoutput .= "\t\t\t\t<td align='center'>";
- //Multiple choice:
- if ($flt[2] == "M") {$myfield = "M$myfield";}
- if ($flt[2] == "P") {$myfield = "P$myfield";}
- // File Upload will need special filters in future, hence the special treatment
- if ($flt[2] == "|") {$myfield = "|$myfield";}
-
- //numerical input will get special treatment (arihtmetic mean, standard derivation, ...)
- if ($flt[2] == "N") {$myfield = "N$myfield";}
- $statisticsoutput .= "<input type='checkbox' id='filter$myfield' name='summary[]' value='$myfield'";
- /*
- * one of these conditions has to be true
- * 1. SGQ can be found within the summary array
- * 2. M-SGQ can be found within the summary array (M = Multiple choice)
- * 3. N-SGQ can be found within the summary array (N = numerical input)
- *
- * Always remember that we just have very few question types that are checked here
- * due to the if ouside this section!
- *
- * Auto-check the question types mentioned above
- */
- if (isset($summary) && (array_search("{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE
- || array_search("M{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE
- || array_search("P{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE
- || array_search("N{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
- {$statisticsoutput .= " checked='checked'";}
- //show speaker symbol which contains full question text
- $statisticsoutput .= " /><label for='filter$myfield'>".showspeaker(FlattenText($flt[5]))
- ."</label><br />\n";
- //numerical question type -> add some HTML to the output
- //if ($flt[2] == "N") {$statisticsoutput .= "</font>";} //removed to correct font error
- if ($flt[2] != "N" && $flt[2] != "|") {$statisticsoutput .= "\t\t\t\t<select name='";}
- //Multiple choice ("M"/"P") -> add "M" to output
- if ($flt[2] == "M" ) {$statisticsoutput .= "M";}
- if ($flt[2] == "P" ) {$statisticsoutput .= "P";}
- //numerical -> add SGQ to output
- if ($flt[2] != "N" && $flt[2] != "|") {$statisticsoutput .= "{$surveyid}X{$flt[1]}X{$flt[0]}[]' multiple='multiple'>\n";}
- } //end if -> filter certain question types
- $statisticsoutput .= "\t\t\t\t\t<!-- QUESTION TYPE = $flt[2] -->\n";
- /////////////////////////////////////////////////////////////////////////////////////////////////
- //This section presents the filter list, in various different ways depending on the question type
- /////////////////////////////////////////////////////////////////////////////////////////////////
- //let's switch through the question type for each question
- switch ($flt[2])
- {
- case "K": // Multiple Numerical
- $statisticsoutput .= "\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n";
- //get answers
- $query = "SELECT title as code, question as answer FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language = '{$language}' ORDER BY question_order";
- $result = db_execute_num($query) or safe_die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- //counter is used for layout
- $counter2=0;
- //go through all the (multiple) answers
- while ($row=$result->FetchRow())
- {
- /*
- * filter form for numerical input
- * - checkbox
- * - greater than
- * - less than
- */
- $myfield1="K".$myfield.$row[0];
- $myfield2="K{$myfield}".$row[0]."G";
- $myfield3="K{$myfield}".$row[0]."L";
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
-
- //start new TD
- $statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>";
-
- //checkbox
- $statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield1'";
-
- //check SGQA -> do we want to pre-check the checkbox?
- if (isset($summary) && (array_search("K{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}", $summary) !== FALSE))
- {$statisticsoutput .= " checked='checked'";}
- $statisticsoutput .= " /> ";
-
- //show speaker
- $statisticsoutput .= showSpeaker($flt[3]." - ".FlattenText($row[1]))."<br />\n";
- //input fields
- $statisticsoutput .= "\t\t\t\t\t<font size='1'>".$clang->gT("Number greater than").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield2' value='";
- if (isset($_POST[$myfield2])){$statisticsoutput .= $_POST[$myfield2];}
- //check number input using JS
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789.,')\" /><br />\n"
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Number less than").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield3' value='";
- if (isset($_POST[$myfield3])) {$statisticsoutput .= $_POST[$myfield3];}
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789.,')\" /><br />\n";
-
- //we added 1 form -> increase counter
- $counter2++;
-
- }
- break;
- case "Q": // Multiple Short Text
- //new section
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- //get subqestions
- $query = "SELECT title as code, question as answer FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' ORDER BY question_order";
- $result = db_execute_num($query) or safe_die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- //loop through all answers
- while ($row = $result->FetchRow())
- {
- //collecting data for output, for details see above (question type "N")
-
- //we have one input field for each answer
- $myfield2 = "Q".$myfield."$row[0]";
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
-
- $statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>";
- $statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield2'";
- if (isset($summary) && (array_search("Q{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}", $summary) !== FALSE))
- {$statisticsoutput .= " checked='checked'";}
-
- $statisticsoutput .= " /> ";
- $statisticsoutput .= showSpeaker($flt[3]." - ".FlattenText($row[1]))
- ."<br />\n"
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Responses containing").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield2' value='";
- if (isset($_POST[$myfield2]))
- {$statisticsoutput .= $_POST[$myfield2];}
-
- $statisticsoutput .= "' />";
- $counter2++;
- }
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $counter=0;
- break;
- /*
- * all "free text" types (T, U, S) get the same prefix ("T")
- */
- case "T": // Long free text
- case "U": // Huge free text
- $myfield2="T$myfield";
- $statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>";
- $statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield2'";
- if (isset($summary) && (array_search("T{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
- {$statisticsoutput .= " checked='checked'";}
- $statisticsoutput .= " /> "
- ." ".showSpeaker($niceqtext)
- ."<br />\n"
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Responses containing").":</font><br />\n"
- ."\t\t\t\t\t<textarea name='$myfield2' rows='3' cols='80'>";
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= "</textarea>";
- break;
- case "S": // Short free text
- $myfield2="T$myfield";
- $statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>";
- $statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield2'";
- if (isset($summary) && (array_search("T{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
- {$statisticsoutput .= " checked='checked'";}
- $statisticsoutput .= " /> "
- ." ".showSpeaker($niceqtext)
- ."<br />\n"
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Responses containing").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield2' value='";
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= "' />";
- $statisticsoutput .= "\t\t\t\t</td>\n";
- break;
- case "N": // Numerical
- //textfields for greater and less than X
- $myfield2="{$myfield}G";
- $myfield3="{$myfield}L";
- $statisticsoutput .= "\t\t\t\t\t<font size='1'>".$clang->gT("Number greater than").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield2' value='";
- if (isset($_POST[$myfield2])){$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789.,')\" /><br />\n"
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Number less than").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield3' value='";
- if (isset($_POST[$myfield3])) {$statisticsoutput .= $_POST[$myfield3];}
- //only numeriacl input allowed -> check using JS
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789.,')\" /><br />\n";
- //put field names into array
- break;
- case "|": // File Upload
- // Number of files uploaded for greater and less than X
- $myfield2 = "{$myfield}G";
- $myfield3 = "{$myfield}L";
- $statisticsoutput .= "\t\t\t\t\t<font size='1'>".$clang->gT("Number of files greater than").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield2' value='";
- if (isset($_POST[$myfield2])){$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789.,')\" /><br />\n"
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Number of files less than").":</font><br />\n"
- ."\t\t\t\t\t<input type='text' name='$myfield3' value='";
- if (isset($_POST[$myfield3])) {$statisticsoutput .= $_POST[$myfield3];}
- //only numeriacl input allowed -> check using JS
- $statisticsoutput .= "' onkeypress=\"return goodchars(event,'0123456789.,')\" /><br />\n";
- //put field names into array
- break;
- /*
- * DON'T show any statistics for date questions
- * because there aren't any statistics implemented yet!
- *
- * Only filtering by date is possible.
- *
- * See bug report #2539 and
- * feature request #2620
- */
- case "D": // Date
- /*
- * - input name
- * - date equals
- * - date less than
- * - date greater than
- */
- $myfield2="D$myfield";
- $myfield3="$myfield2=";
- $myfield4="$myfield2<";
- $myfield5="$myfield2>";
- $statisticsoutput .= "\t\t\t\t<td align='center' valign='top'>";
- $statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield2'";
- if (isset($summary) && (array_search("D{$surveyid}X{$flt[1]}X{$flt[0]}", $summary) !== FALSE))
- {$statisticsoutput .= " checked='checked'";}
- $statisticsoutput .= " /><strong>";
- $statisticsoutput .= showSpeaker($niceqtext)
- ."<br />\n"
-
- ."\t\t\t\t\t<font size='1'>".$clang->gT("Date (YYYY-MM-DD) equals").":<br />\n"
- ."\t\t\t\t\t<input name='$myfield3' type='text' value='";
- if (isset($_POST[$myfield3])) {$statisticsoutput .= $_POST[$myfield3];}
- $statisticsoutput .= "' /><br />\n"
- ."\t\t\t\t\t ".$clang->gT("Date is")." >=<br />\n"
- ."\t\t\t\t\t<input name='$myfield4' value='";
- if (isset($_POST[$myfield4])) {$statisticsoutput .= $_POST[$myfield4];}
- $statisticsoutput .= "' type='text' /> <br />"
- .$clang->gT("AND/OR Date is")." <= <br /> <input name='$myfield5' value='";
- if (isset($_POST[$myfield5])) {$statisticsoutput .= $_POST[$myfield5];}
- $statisticsoutput .= "' type='text' /></font>\n";
- break;
- case "5": // 5 point choice
- //we need a list of 5 entries
- for ($i=1; $i<=5; $i++)
- {
- $statisticsoutput .= "\t\t\t\t\t<option value='$i'";
-
- //pre-select values which were marked before
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array($i, $_POST[$myfield]))
- {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">$i</option>\n";
- }
- //End the select which starts before the CASE statement (around line 411)
- $statisticsoutput .="\t\t\t\t</select>\n";
- break;
- case "G": // Gender
- $statisticsoutput .= "\t\t\t\t\t<option value='F'";
- //pre-select values which were marked before
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array("F", $_POST[$myfield])) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">".$clang->gT("Female")."</option>\n";
- $statisticsoutput .= "\t\t\t\t\t<option value='M'";
- //pre-select values which were marked before
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array("M", $_POST[$myfield])) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">".$clang->gT("Male")."</option>\n\t\t\t\t</select>\n";
- $statisticsoutput .= "\t\t\t\t</td>\n";
- break;
- case "Y": // Yes\No
- $statisticsoutput .= "\t\t\t\t\t<option value='Y'";
- //pre-select values which were marked before
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array("Y", $_POST[$myfield])) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">".$clang->gT("Yes")."</option>\n"
- ."\t\t\t\t\t<option value='N'";
- //pre-select values which were marked before
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array("N", $_POST[$myfield])) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">".$clang->gT("No")."</option></select>\n";
- break;
- case "I": // Language
- $survlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
- $survlangs[] = GetBaseLanguageFromSurveyID($surveyid);
- foreach ($survlangs as $availlang)
- {
- $statisticsoutput .= "\t\t\t\t\t<option value='".$availlang."'";
-
- //pre-select values which were marked before
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield]) && in_array($availlang, $_POST[$myfield]))
- {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">".getLanguageNameFromCode($availlang,false)."</option>\n";
- }
- break;
- //----------------------- ARRAYS --------------------------
- case "A": // ARRAY OF 5 POINT CHOICE QUESTIONS
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- //get answers
- $query = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' ORDER BY question_order";
- $result = db_execute_num($query) or safe_die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- //check all the results
- while ($row=$result->FetchRow())
- {
- $myfield2 = $myfield.$row[0];
- $statisticsoutput .= "<!-- $myfield2 - ";
-
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
-
- $statisticsoutput .= " -->\n";
-
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
- $statisticsoutput .= "\t\t\t\t<td align='center'>"
- ."<input type='checkbox' name='summary[]' value='$myfield2'";
-
- //pre-check
- if (isset($summary) && array_search($myfield2, $summary)!== FALSE) {$statisticsoutput .= " checked='checked'";}
-
- $statisticsoutput .= " /> "
- .showSpeaker($niceqtext." ".str_replace("'", "`", $row[1])." - # ".$flt[3])
- ."<br />\n"
- ."\t\t\t\t<select name='{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}[]' multiple='multiple'>\n";
-
- //there are always exactly 5 values which have to be listed
- for ($i=1; $i<=5; $i++)
- {
- $statisticsoutput .= "\t\t\t\t\t<option value='$i'";
- //pre-select
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array($i, $_POST[$myfield2])) {$statisticsoutput .= " selected";}
- if (isset($_POST[$myfield2]) && $_POST[$myfield2] == $i) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">$i</option>\n";
- }
-
- $statisticsoutput .= "\t\t\t\t</select>\n\t\t\t\t</td>\n";
- $counter2++;
-
- //add this to all the other fields
- }
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $counter=0;
- break;
- //just like above only a different loop
- case "B": // ARRAY OF 10 POINT CHOICE QUESTIONS
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $query = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' ORDER BY question_order";
- $result = db_execute_num($query) or safe_die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- while ($row=$result->FetchRow())
- {
- $myfield2 = $myfield . "$row[0]";
- $statisticsoutput .= "<!-- $myfield2 - ";
-
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
-
- $statisticsoutput .= " -->\n";
-
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
- $statisticsoutput .= "\t\t\t\t<td align='center'>"; //heading
- $statisticsoutput .= "<input type='checkbox' name='summary[]' value='$myfield2'";
-
- if (isset($summary) && array_search($myfield2, $summary)!== FALSE) {$statisticsoutput .= " checked='checked'";}
-
- $statisticsoutput .= " /> "
- .showSpeaker($niceqtext." ".str_replace("'", "`", $row[1])." - # ".$flt[3])
- ."<br />\n"
- ."\t\t\t\t<select name='{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}[]' multiple='multiple'>\n";
-
- //here wo loop through 10 entries to create a larger output form
- for ($i=1; $i<=10; $i++)
- {
- $statisticsoutput .= "\t\t\t\t\t<option value='$i'";
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array($i, $_POST[$myfield2])) {$statisticsoutput .= " selected";}
- if (isset($_POST[$myfield2]) && $_POST[$myfield2] == $i) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">$i</option>\n";
- }
-
- $statisticsoutput .= "\t\t\t\t</select>\n\t\t\t\t</td>\n";
- $counter2++;
- }
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $counter=0;
- break;
- case "C": // ARRAY OF YES\No\$clang->gT("Uncertain") QUESTIONS
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- //get answers
- $query = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' ORDER BY question_order";
- $result = db_execute_num($query) or safe_die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- //loop answers
- while ($row=$result->FetchRow())
- {
- $myfield2 = $myfield . "$row[0]";
- $statisticsoutput .= "<!-- $myfield2 - ";
-
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
-
- $statisticsoutput .= " -->\n";
-
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
-
- $statisticsoutput .= "\t\t\t\t<td align='center'>"
- ."<input type='checkbox' name='summary[]' value='$myfield2'";
-
- if (isset($summary) && array_search($myfield2, $summary)!== FALSE)
- {$statisticsoutput .= " checked='checked'";}
-
- $statisticsoutput .= " /> <strong>"
- .showSpeaker($niceqtext." ".str_replace("'", "`", $row[1])." - # ".$flt[3])
- ."</strong><br />\n"
- ."\t\t\t\t<select name='{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}[]' multiple='multiple'>\n"
- ."\t\t\t\t\t<option value='Y'";
-
- //pre-select "yes"
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array("Y", $_POST[$myfield2])) {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">".$clang->gT("Yes")."</option>\n"
- ."\t\t\t\t\t<option value='U'";
-
- //pre-select "uncertain"
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array("U", $_POST[$myfield2])) {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">".$clang->gT("Uncertain")."</option>\n"
- ."\t\t\t\t\t<option value='N'";
-
- //pre-select "no"
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array("N", $_POST[$myfield2])) {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">".$clang->gT("No")."</option>\n"
- ."\t\t\t\t</select>\n\t\t\t\t</td>\n";
- $counter2++;
-
- //add to array
- }
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $counter=0;
- break;
- //similiar to the above one
- case "E": // ARRAY OF Increase/Same/Decrease QUESTIONS
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $query = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' ORDER BY question_order";
- $result = db_execute_num($query) or safe_die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- while ($row=$result->FetchRow())
- {
- $myfield2 = $myfield . "$row[0]";
- $statisticsoutput .= "<!-- $myfield2 - ";
-
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
-
- $statisticsoutput .= " -->\n";
-
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
-
- $statisticsoutput .= "\t\t\t\t<td align='center'>"
- ."<input type='checkbox' name='summary[]' value='$myfield2'";
-
- if (isset($summary) && array_search($myfield2, $summary)!== FALSE) {$statisticsoutput .= " checked='checked'";}
-
- $statisticsoutput .= " /> <strong>"
- .showSpeaker($niceqtext." ".str_replace("'", "`", $row[1])." - # ".$flt[3])
- ."</strong><br />\n"
- ."\t\t\t\t<select name='{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}[]' multiple='multiple'>\n"
- ."\t\t\t\t\t<option value='I'";
-
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array("I", $_POST[$myfield2])) {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">".$clang->gT("Increase")."</option>\n"
- ."\t\t\t\t\t<option value='S'";
-
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield2]) && in_array("S", $_POST[$myfield2])) {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">".$clang->gT("Same")."</option>\n"
- ."\t\t\t\t\t<option value='D'";
-
- if (isset($_POST[$myfield]) && is_array($_POST[$myfield2]) && in_array("D", $_POST[$myfield2])) {$statisticsoutput .= " selected";}
-
- $statisticsoutput .= ">".$clang->gT("Decrease")."</option>\n"
- ."\t\t\t\t</select>\n\t\t\t\t</td>\n";
- $counter2++;
- }
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $counter=0;
- break;
- case ";": //ARRAY (Multi Flex) (Text)
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $query = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' AND scale_id=0 ORDER BY question_order";
- $result = db_execute_num($query) or die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- while ($row=$result->FetchRow())
- {
- $fquery = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language='{$language}' AND scale_id=1 ORDER BY question_order";
- $fresult = db_execute_assoc($fquery);
- while ($frow = $fresult->FetchRow())
- {
- $myfield2 = "T".$myfield . $row[0] . "_" . $frow['title'];
- $statisticsoutput .= "<!-- $myfield2 - ";
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= " -->\n";
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
- $statisticsoutput .= "\t\t\t\t<td align='center'>"
- ."<input type='checkbox' name='summary[]' value='$myfield2'";
- if (isset($summary) && array_search($myfield2, $summary)!== FALSE) {$statisticsoutput .= " checked='checked'";}
- $statisticsoutput .= " /> <strong>"
- .showSpeaker($niceqtext." ".str_replace("'", "`", $row[1]." [".$frow['question']."]")." - ".$row[0]."/".$frow['title'])
- ."</strong><br />\n";
- //$statisticsoutput .= $fquery;
- $statisticsoutput .= "\t\t\t\t\t<font size='1'>".$clang->gT("Responses containing").":</font><br />\n";
- $statisticsoutput .= "\t\t\t\t<input type='text' name='{$myfield2}' value='";
- if(isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= "' />\n\t\t\t\t</td>\n";
- $counter2++;
- }
- }
- $statisticsoutput .= "\t\t\t\t<td>\n";
- $counter=0;
- break;
- case ":": //ARRAY (Multi Flex) (Numbers)
- $statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- $query = "SELECT title, question FROM ".db_table_name("questions")." WHERE parent_qid='$flt[0]' AND language = '{$language}' AND scale_id=0 ORDER BY question_order";
- $result = db_execute_num($query) or die ("Couldn't get answers!<br />$query<br />".$connect->ErrorMsg());
- $counter2=0;
- //Get qidattributes for this question
- $qidattributes=getQuestionAttributes($flt[0]);
- if (trim($qidattributes['multiflexible_max'])!='' && trim($qidattributes['multiflexible_min']) ==''){
- $maxvalue=$qidattributes['multiflexible_max'];
- $minvalue=1;
- }
- if (trim($qidattributes['multiflexible_min'])!='' && trim($qidattributes['multiflexible_max']) ==''){
- $minvalue=$qidattributes['multiflexible_min'];
- $maxvalue=$qidattributes['multiflexible_min'] + 10;
- }
- if (trim($qidattributes['multiflexible_min'])=='' && trim($qidattributes['multiflexible_max']) ==''){
- $minvalue=1;
- $maxvalue=10;
- }
- if (trim($qidattributes['multiflexible_min']) !='' && trim($qidattributes['multiflexible_max']) !=''){
- if($qidattributes['multiflexible_min'] < $qidattributes['multiflexible_max']){
- $minvalue=$qidattributes['multiflexible_min'];
- $maxvalue=$qidattributes['multiflexible_max'];
- }
- }
- if (trim($qidattributes['multiflexible_step'])!='') {
- $stepvalue=$qidattributes['multiflexible_step'];
- } else {
- $stepvalue=1;
- }
- if ($qidattributes['multiflexible_checkbox']!=0)
- {
- $minvalue=0;
- $maxvalue=1;
- $stepvalue=1;
- }
- while ($row=$result->FetchRow())
- {
- $fquery = "SELECT * FROM ".db_table_name("questions")." WHERE parent_qid={$flt[0]} AND language='{$language}' AND scale_id=1 ORDER BY question_order, title";
- $fresult = db_execute_assoc($fquery);
- while ($frow = $fresult->FetchRow())
- {
- $myfield2 = $myfield . $row[0] . "_" . $frow['title'];
- $statisticsoutput .= "<!-- $myfield2 - ";
- if (isset($_POST[$myfield2])) {$statisticsoutput .= $_POST[$myfield2];}
- $statisticsoutput .= " -->\n";
- if ($counter2 == 4) {$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n"; $counter2=0;}
- $statisticsoutput .= "\t\t\t\t<td align='center'>"
- ."<input type='checkbox' name='summary[]' value='$myfield2'";
- if (isset($summary) && array_search($myfield2, $summary)!== FALSE) {$statisticsoutput .= " checked='checked'";}
- $statisticsoutput .= " /> <strong>"
- .showSpeaker($niceqtext." ".str_replace("'", "`", $row[1]." [".$frow['question']."]")." - ".$row[0]."/".$frow['title'])
- ."</strong><br />\n";
- //$statisticsoutput .= $fquery;
- $statisticsoutput .= "\t\t\t\t<select name='{$myfield2}[]' multiple='multiple' rows='5' cols='5'>\n";
- for($ii=$minvalue; $ii<=$maxvalue; $ii+=$stepvalue)
- {
- $statisticsoutput .= "\t\t\t\t\t<option value='$ii'";
- if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array($frow['code'], $_POST[$myfield2])) {$statisticsoutput .= " selected";}
- $statisticsoutput .= ">$ii</option>\n";
- }
- $statisticsoutput .= "\t\t\t\t</select>\n\t\t\t\t</td>\n";
- $counter2++;
- }
- }
- $statisticsoutput .= "\t\t\t\t<td>\n";
- $counter=0;
- break;
- /*
- * For question type "F" and "H" you can use labels.
- * The only difference is that the labels are applied to column heading
- * or rows respectively
- */
- case "F": // FlEXIBLE ARRAY
- case "H": // ARRAY (By Column)
- //$statisticsoutput .= "\t\t\t\t</tr>\n\t\t\t\t<tr>\n";
- //Get answers. We always use the answer code because the label might be too long elsewise
- $query =…
Large files files are truncated, but you can click here to view the full file