Skip to content

Commit

Permalink
Now uses the public language file for the survey when exporting full …
Browse files Browse the repository at this point in the history
…answers.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@736 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Oct 18, 2003
1 parent 81449e0 commit 3ef3fa2
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions admin/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@

include ("config.php");

//Select public language file
$query = "SELECT language FROM {$dbprefix}surveys WHERE sid=$sid";
$result = mysql_query($query);
while ($row=mysql_fetch_array($result)) {$surveylanguage = $row['language'];}
$langdir="$publicdir/lang";
$langfilename="$langdir/$surveylanguage.lang.php";
if (!is_file($langfilename)) {$langfilename="$langdir/$defaultlang.lang.php";}
require($langfilename);

//STEP 1: First line is column headings
//$s = "\t";
$lq = "SELECT DISTINCT qid FROM {$dbprefix}questions WHERE sid=$sid"; //GET LIST OF LEGIT QIDs FOR TESTING LATER
Expand Down Expand Up @@ -242,7 +251,7 @@
case "M": //multioption
if ($faid == "other")
{
$fquest .= " [Other]";
$fquest .= " ["._OTHER."]";
}
else
{
Expand All @@ -262,7 +271,7 @@
}
if ($faid == "other")
{
$fquest .= " [Other]";
$fquest .= " ["._OTHER."]";
}
else
{
Expand Down Expand Up @@ -411,17 +420,17 @@
case "Y": //YES\NO
switch($drow[$i])
{
case "Y": echo "Yes"; break;
case "N": echo "No"; break;
default: echo "N/A"; break;
case "Y": echo _YES; break;
case "N": echo _NO; break;
default: echo _NOTAPPLICABLE; break;
}
break;
case "G": //GENDER
switch($drow[$i])
{
case "M": echo "Male"; break;
case "F": echo "Female"; break;
default: echo "N/A"; break;
case "M": echo _MALE; break;
case "F": echo _FEMALE; break;
default: echo _NOTAPPLICABLE; break;
}
break;
case "M": //multioption
Expand All @@ -438,9 +447,9 @@
{
switch($drow[$i])
{
case "Y": echo "Yes"; break;
case "N": echo "No"; break;
case "": echo "No"; break;
case "Y": echo _YES; break;
case "N": echo _NO; break;
case "": echo _NO; break;
default: echo $drow[$i]; break;
}
}
Expand All @@ -449,26 +458,26 @@
switch($drow[$i])
{
case "Y":
echo "Yes";
echo _YES;
break;
case "N":
echo "No";
echo _NO;
break;
case "U":
echo "Uncertain";
echo _UNCERTAIN;
break;
}
case "E":
switch($drow[$i])
{
case "I":
echo "Increase";
echo _INCREASE;
break;
case "S":
echo "Same";
echo _SAME;
break;
case "D":
echo "Decrease";
echo _DECREASE;
break;
}
break;
Expand Down

0 comments on commit 3ef3fa2

Please sign in to comment.