Ejemplo n.º 1
0
     $mySQL = "SELECT * FROM navigation_tab WHERE parent_id = '{$question_id}' ORDER BY usort ASC";
     $recSET = mysql_query($mySQL);
     while ($recROW = mysql_fetch_assoc($recSET)) {
         $i_count++;
         $question_id2 = $recROW['nav_tab_id'];
         $value = getAnswer($question_id2, $session_id, 1);
         if ($i_count == 1) {
             $csvline = $sep1 . $value;
         }
         if ($i_count != 1) {
             $csvline = $csvline . $sep2 . $value;
         }
     }
 }
 if (ChildHasChild($question_id) > 0) {
     $new_parent = ChildHasChild($question_id);
     $questionSQL2 = "SELECT * FROM navigation_tab JOIN question_type ON navigation_tab.nav_tab_id = question_type.nav_tab_id WHERE parent_id = '{$new_parent}' AND navigation_tab.status = 3 AND template_id = '20' ORDER BY usort ASC";
     $questionSET2 = mysql_query($questionSQL2);
     while ($questionROW2 = mysql_fetch_assoc($questionSET2)) {
         $question_id = $questionROW2['nav_tab_id'];
         $question_type = $questionROW2['question_type'];
         if ($question_type == '1') {
             $value = getAnswer($question_id, $session_id, 2);
             $csvline = $csvline . $sep2 . $value;
         }
         if ($question_type == '4') {
             $mySQL = "SELECT * FROM navigation_tab WHERE parent_id = '{$question_id}' ORDER BY usort ASC";
             $recSET = mysql_query($mySQL);
             while ($recROW = mysql_fetch_assoc($recSET)) {
                 $i_count++;
                 $question_id2 = $recROW['nav_tab_id'];
 }
 if ($_SESSION["a{$answer_itself}"] == '2') {
     $checked_status2 = 'checked';
 }
 if ($_SESSION["a{$answer_itself}"] == '3') {
     $checked_status3 = 'checked';
 }
 if ($_SESSION["a{$answer_itself}"] == '4') {
     $checked_status4 = 'checked';
 }
 if ($_SESSION["a{$answer_itself}"] == '5') {
     $checked_status5 = 'checked';
 }
 $scriptLI = '';
 if (ChildHasChild($parent_id) > 0) {
     $scriptLI = "onclick=\"javascript:boxHide('sub-answerLI" . ChildHasChild($parent_id) . "')\"";
 }
 if (ParentHasChild($checkAnswerROW['nav_tab_id']) > 0) {
     $scriptLI = "onclick=\"javascript:boxDisplay('sub-answerLI" . $checkAnswerROW['nav_tab_id'] . "')\"";
 }
 //decide which type of question it is and how to display the input box. Will it be radio or checkbox or textarea
 if ($question_type == '1') {
     $inputBOX = "<input {$checked_status} type='radio'      id='answer_id" . $checkAnswerROW['nav_tab_id'] . "' name='answer_name_" . $parent_id . "' value='" . $spss_value . "' {$scriptLI}/>";
 }
 if ($question_type == '2') {
     $inputBOX = "<input {$checked_statusx} type='checkbox'   id='answer_id" . $checkAnswerROW['nav_tab_id'] . "' name='answer_name_" . $checkAnswerROW['nav_tab_id'] . "' value='" . $spss_value . "' />";
 }
 if ($question_type == '3') {
     $inputBOX = "<textarea id='answer_id" . $checkAnswerROW['nav_tab_id'] . "' name='answer_name_" . $parent_id . "' cols='30' rows='5'>{$session_value}</textarea>";
 }
 if ($question_type == '4') {