Skip to content

Commit

Permalink
Finalised date handling capabilities and added link to help/instructions
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@50 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 17, 2003
1 parent c0a6775 commit 3a31f09
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions admin/statistics.php
Expand Up @@ -131,9 +131,11 @@
echo "&nbsp;<img src='speaker.jpg' align='bottom' alt='$flt[5] [$row[1]]' onClick=\"alert('QUESTION: $flt[5] [$row[1]]')\">";
echo "<br />\n";
echo "\t\t\t\t\t<font size='1'>Date (YYYY-MM-DD) equals:<br />\n";
echo "\t\t\t\t\t<input type='text' ".substr($slstyle2, 0, -13) ."; width:80'><br />\n";
$myfield3="$myfield2=";
echo "\t\t\t\t\t<input name='$myfield3' type='text' value='$_POST[$myfield3]' ".substr($slstyle2, 0, -13) ."; width:80'><br />\n";
echo "\t\t\t\t\t&nbsp;&nbsp;OR between:<br />\n";
echo "\t\t\t\t\t<input type='text' ".substr($slstyle2, 0, -13) ."; width:65'> & <input type='text' ".substr($slstyle2, 0, -13) ."; width:65'>\n";
$myfield4="$myfield2<"; $myfield5="$myfield2>";
echo "\t\t\t\t\t<input name='$myfield4' value='$_POST[$myfield4]' type='text' ".substr($slstyle2, 0, -13) ."; width:65'> & <input name='$myfield5' value='$_POST[$myfield5]' type='text' ".substr($slstyle2, 0, -13) ."; width:65'>\n";
break;
case "5": // 5 point choice
for ($i=1; $i<=5; $i++)
Expand Down Expand Up @@ -265,6 +267,8 @@
echo "\n\t\t\t\t</td></tr>\n\t\t\t</table>\n";
echo "\t\t</td></tr>\n";
echo "\t\t<tr><td align='center' bgcolor='#CCCCCC'>\n\t\t\t<br />\n";
echo "\t\t\t<img src='help.gif' align='left' alt='Statistics Help' onClick=\"window.open('instructions.html#statistics', '_blank')\">\n";
echo "\t\t\t<img src='help.gif' align='right' alt='Statistics Help' onClick=\"window.open('instructions.html#statistics', '_blank')\">\n";
echo "\t\t\t<input $btstyle type='submit' value='View Stats'>\n";
echo "\t\t\t<input $btstyle type='button' value='Clear' onClick=\"window.open('statistics.php?sid=$sid', '_top')\">\n";
echo "\t\t<br />&nbsp;\n\t\t</td></tr>\n";
Expand All @@ -284,7 +288,7 @@
foreach ($postvars as $pv)
{
$firstletter=substr($pv,0,1);
if ($pv != "sid" && $pv != "display" && $firstletter != "M" && $firstletter != "T" && $pv != "summary") //pull out just the fieldnames
if ($pv != "sid" && $pv != "display" && $firstletter != "M" && $firstletter != "T" && $firstletter != "D" && $pv != "summary") //pull out just the fieldnames
{
$thisquestion = "$pv IN (";
foreach ($$pv as $condition)
Expand Down Expand Up @@ -317,6 +321,25 @@
{
$selects[]=substr($pv, 1, strlen($pv))." like '%".$_POST[$pv]."%'";
}
elseif (substr($pv, 0, 1) == "D" && $_POST[$pv] != "")
{
if (substr($pv, -1, 1) == "=")
{
$selects[] = substr($pv, 1, strlen($pv)-2)." = '".$_POST[$pv]."'";
}
else
{
if (substr($pv, -1, 1) == "<")
{
$selects[]=substr($pv, 1, strlen($pv)-2) . " > '".$_POST[$pv]."'";
}
if (substr($pv, -1, 1) == ">")
{
$selects[]=substr($pv, 1, strlen($pv)-2) . " < '".$_POST[$pv]."'";
}
}

}
}
// 2: Do SQL query
$query = "SELECT count(*) FROM survey_$sid";
Expand Down

0 comments on commit 3a31f09

Please sign in to comment.