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 switch ($spssver) { case 1: //<16 $length_data = '255'; // Set the max text length of the Value break; case 2: //>=16 $length_data = '16384'; // Set the max text length of the Value break; default: $length_data = '16384'; // Set the max text length of the Value } $headerComment = '*$Rev: 11664 $' . " $quexsfilterstate $filterstate $spssver.\n"; if (isset($_GET['dldata'])) $subaction = "dldata"; if (isset($_GET['dlstructure'])) $subaction = "dlstructure"; if (!isset($subaction)) { $exportspssoutput = browsemenubar($clang->gT('Export results')); $exportspssoutput .= "
\n"; $selecthide=""; $selectshow=""; $selectinc=""; switch ($filterstate) { case "inc": $selectinc="selected='selected'"; break; case "filter": $selecthide="selected='selected'"; break; default: $selectshow="selected='selected'"; } $exportspssoutput .= "\n"; $exportspssoutput .= "'; } else { // Get Base language: $language = GetBaseLanguageFromSurveyID($surveyid); $clang = new limesurvey_lang($language); require_once ("export_data_functions.php"); } if ($subaction=='dldata') { header("Content-Disposition: attachment; filename=survey_".$surveyid."_SPSS_data_file.dat"); header("Content-type: text/comma-separated-values; charset=UTF-8"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); if ($spssver == 2) echo "\xEF\xBB\xBF"; $na = ""; spss_export_data($na); exit; } if ($subaction=='dlstructure') { header("Content-Disposition: attachment; filename=survey_".$surveyid."_SPSS_syntax_file.sps"); header("Content-type: application/download; charset=UTF-8"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); // Build array that has to be returned $fields = spss_fieldmap(); //Now get the query string with all fields to export $query = spss_getquery(); $result=db_execute_num($query) or safe_die("Couldn't get results