";}
$myfield = "{$sid}X{$flt[1]}X{$flt[0]}";
- if ($flt[2] != "A" && $flt[2] != "B" && $flt[2] != "C") //Have to make an exception for these types!
+ if ($flt[2] != "A" && $flt[2] != "B" && $flt[2] != "C" && $flt[2] != "T" && $flt[2] != "S" && $flt[2] != "D") //Have to make an exception for these types!
{
echo "\t\t\t\t";
echo "$setfont$flt[3] "; //Heading (Question No)
@@ -105,6 +105,36 @@
echo "\t\t\t\t\t\n";
switch ($flt[2])
{
+ case "T": // Long free text
+
+ $myfield2="T$myfield";
+
+ echo "\t\t\t\t | $setfont$flt[3]"; //heading
+ echo " ";
+ echo " \n";
+ echo "\t\t\t\t\tResponses containing: \n";
+ echo "\t\t\t\t\t";
+ break;
+ case "S": // Short free text
+
+ $myfield2="T$myfield";
+
+ echo "\t\t\t\t | $setfont$flt[3]"; //heading
+ echo " ";
+ echo " \n";
+ echo "\t\t\t\t\tResponses containing: \n";
+ echo "\t\t\t\t\t";
+ break;
+ case "D": // Date
+ $myfield2="D$myfield";
+ echo "\t\t\t\t | $setfont$flt[3]"; //heading
+ echo " ";
+ echo " \n";
+ echo "\t\t\t\t\tDate (YYYY-MM-DD) equals: \n";
+ echo "\t\t\t\t\t \n";
+ echo "\t\t\t\t\t OR between: \n";
+ echo "\t\t\t\t\t & \n";
+ break;
case "5": // 5 point choice
for ($i=1; $i<=5; $i++)
{
@@ -225,9 +255,9 @@
echo ">$row[1]\n";
}
}
- if ($flt[2] != "A" && $flt[2] != "B" && $flt[2] != "C") //Have to make an exception for these types!
+ if ($flt[2] != "A" && $flt[2] != "B" && $flt[2] != "C" && $flt[2] != "T" && $flt[2] != "S" && $flt[2] != "D") //Have to make an exception for these types!
{
- echo "\t\t\t\t\n\t\t\t\t | \n";
+ echo "\n\t\t\t\t\n";
}
$currentgroup=$flt[1];
$counter++;
@@ -253,7 +283,8 @@
for (reset($_POST); $key=key($_POST); next($_POST)) { $postvars[]=$key;} // creates array of post variable names
foreach ($postvars as $pv)
{
- if ($pv != "sid" && $pv != "display" && substr($pv, 0, 1) != "M" && $pv != "summary") //pull out just the fieldnames
+ $firstletter=substr($pv,0,1);
+ if ($pv != "sid" && $pv != "display" && $firstletter != "M" && $firstletter != "T" && $pv != "summary") //pull out just the fieldnames
{
$thisquestion = "$pv IN (";
foreach ($$pv as $condition)
@@ -282,6 +313,10 @@
$selects[]="($thismulti)";
}
}
+ elseif (substr($pv, 0, 1) == "T" && $_POST[$pv] != "")
+ {
+ $selects[]=substr($pv, 1, strlen($pv))." like '%".$_POST[$pv]."%'";
+ }
}
// 2: Do SQL query
$query = "SELECT count(*) FROM survey_$sid";