Skip to content

Commit

Permalink
Refined new function "checkgroupfordisplay" to deal with multiple opt…
Browse files Browse the repository at this point in the history
…ion type questions.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@974 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Mar 30, 2004
1 parent c61e2bb commit 8cb0136
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion index.php
Expand Up @@ -369,7 +369,24 @@ function checkgroupfordisplay($gid)
$result = mysql_query($query) or die("Couldn't check conditions<br />$query<br />".mysql_error());
while($row=mysql_fetch_array($result))
{
if ($_SESSION[$row['cfieldname']] == $row['value'])
$query2="SELECT type FROM {$dbprefix}questions WHERE qid={$row['cqid']}";
$result2=mysql_query($query2) or die ("Coudn't get type from questions<br />$ccquery<br />".mysql_error());
while($row2=mysql_fetch_array($result2))
{
$thistype=$row2['type'];
}
if ($thistype == "M" || $thistype == "P")
{
$fieldname=$row['cfieldname'].$row['value'];
$cfieldname=$_SESSION[$fieldname];
$cvalue="Y";
}
else
{
$cfieldname=$_SESSION[$row['cfieldname']];
$cvalue=$row['value'];
}
if ($cfieldname == $cvalue)
{
$distinctcqids[$row['cqid']]=1;
}
Expand Down

0 comments on commit 8cb0136

Please sign in to comment.