Skip to content

Commit

Permalink
Now displays count of short or long text fields that have been answer…
Browse files Browse the repository at this point in the history
…ed (ie not empty or null) and gives browse option.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@747 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Oct 26, 2003
1 parent f62deab commit 93679ff
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions admin/statistics.php
Expand Up @@ -132,6 +132,7 @@
."<br />\n"
."\t\t\t\t\t<font size='1'>Responses containing:</font><br />\n"
."\t\t\t\t\t<textarea $slstyle2 name='$myfield2' rows='3'>".$_POST[$myfield2]."</textarea>";
$allfields[]=$myfield2;
break;
case "S": // Short free text
$myfield2="T$myfield";
Expand All @@ -140,6 +141,7 @@
."<br />\n"
."\t\t\t\t\t<font size='1'>Responses containing:</font><br />\n"
."\t\t\t\t\t<input type='text' $slstyle2 name='$myfield2' value='".$_POST[$myfield2]."'>";
$allfields[]=$myfield2;
break;
case "N": // Numerical
$myfield2="{$myfield}G";
Expand Down Expand Up @@ -584,6 +586,19 @@
$alist[]=array(_OTHER, _OTHER, $mfield);
}
}
elseif (substr($rt, 0, 1) == "T" || substr($rt, 0, 1) == "S") //Short and long text
{
list($qsid, $qgid, $qqid) = explode("X", substr($rt, 1, strlen($rt)));
$nquery = "SELECT title, type, question FROM {$dbprefix}questions WHERE qid='$qqid'";
$nresult = mysql_query($nquery) or die("Couldn't get text question<br />$nquery<br />".mysql_error());
while ($nrow=mysql_fetch_row($nresult))
{
$qtitle=$nrow[0]; $qtype=$nrow[1];
$qquestion=strip_tags($nrow[2]);
}
$mfield=substr($rt, 1, strlen($rt));
$alist[]=array("Answers", "", $mfield);
}
elseif (substr($rt, 0, 1) == "R") //RANKING OPTION THEREFORE CONFUSING
{
$lengthofnumeral=substr($rt, strchr($rt, "-"), 1);
Expand Down Expand Up @@ -882,6 +897,10 @@
{
$query = "SELECT count(`$al[2]`) FROM {$dbprefix}survey_$sid WHERE `$al[2]` != ''";
}
elseif ($qtype == "T" || $qtype == "S")
{
$query = "SELECT count(`$al[2]`) FROM {$dbprefix}survey_$sid WHERE `$al[2]` != ''";
}
else
{
$query = "SELECT count(`$al[2]`) FROM {$dbprefix}survey_$sid WHERE `$al[2]` =";
Expand All @@ -902,13 +921,14 @@
if ($sql != "NULL") {$query .= " AND $sql";}
$result=mysql_query($query) or die ("Couldn't do count of values<br />$query<br />".mysql_error());
echo "\n<!-- ($sql): $query -->\n\n";
//echo $qtype;
while ($row=mysql_fetch_row($result))
{
if ($al[0] == "")
{$fname=_NOANSWER;}
elseif ($al[0] == _OTHER)
elseif ($al[0] == _OTHER || $al[0] == "Answers")
{$fname="$al[1] <input $btstyle type='submit' value='"._BROWSE."' onclick=\"window.open('listcolumn.php?sid=$sid&column=$al[2]', 'results', 'width=300, height=500, left=50, top=50, resizable=yes, scrollbars=yes, menubar=no, status=no, location=no, toolbar=no')\">";}
elseif ($qtype == "S" || $qtype == "T")
{$fname="$al[1] $qtype<input $btstyle type='submit' value='"._BROWSE."' onclick=\"window.open('listcolumn.php?sid=$sid&column=$al[2]', 'results', 'width=300, height=500, left=50, top=50, resizable=yes, scrollbars=yes, menubar=no, status=no, location=no, toolbar=no')\">";}
else
{$fname="$al[1] ($al[0])";}
echo "\t<tr>\n\t\t<td width='50%' align='center' bgcolor='#666666'>$setfont"
Expand Down

0 comments on commit 93679ff

Please sign in to comment.