Skip to content

Commit

Permalink
bugfix: extrapolates full fieldnames for multiple option when passing…
Browse files Browse the repository at this point in the history
… selected columns to export.php

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1236 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Oct 8, 2004
1 parent d41c192 commit a3da021
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion admin/statistics.php
Expand Up @@ -671,7 +671,37 @@
{
foreach($_POST['summary'] as $viewfields)
{
echo "\t\t\t<input type='hidden' name='summary[]' value='$viewfields'>\n";
switch(substr($viewfields, 0, 1))
{
case "N":
case "T":
$field = substr($viewfields, 1, strlen($viewfields)-1);
echo "\t\t\t<input type='hidden' name='summary[]' value='$field'>\n";
break;
case "M":
list($lsid, $lgid, $lqid) = explode("X", substr($viewfields, 1, strlen($viewfields)-1));
$aquery="SELECT code FROM {$dbprefix}answers WHERE qid=$lqid ORDER BY sortorder, answer";
$aresult=mysql_query($aquery) or die ("Couldn't get answers<br />$aquery<br />".mysql_error());
while ($arow=mysql_fetch_row($aresult)) // go through every possible answer
{
$field = substr($viewfields, 1, strlen($viewfields)-1).$arow[0];
echo "\t\t\t<input type='hidden' name='summary[]' value='$field'>\n";
}
$aquery = "SELECT other FROM {$dbprefix}questions WHERE qid=$lqid";
$aresult = mysql_query($aquery);
while($arow = mysql_fetch_row($aresult)){
if ($arow[0] == "Y") {
echo $arow[0];
$field = substr($viewfields, 1, strlen($viewfields)-1)."other";
echo "\t\t\t<input type='hidden' name='summary[]' value='$field'>\n";
}
} // while
break;
default:
$field = $viewfields;
echo "\t\t\t<input type='hidden' name='summary[]' value='$field'>\n";
break;
}
}
}
echo "\t\t</td></form>\n\t</tr>\n";
Expand Down

0 comments on commit a3da021

Please sign in to comment.