$conditionsoutput_main_content .= "isAnonymousSurvey = false;"; } $conditionsoutput_main_content .= "//-->\n" . "</script>\n"; $conditionsoutput_main_content .= "</td></tr>\n"; //END: PREPARE JAVASCRIPT TO SHOW MATCHING ANSWERS TO SELECTED QUESTION //BEGIN DISPLAY CONDITIONS FOR THIS QUESTION if ($subaction == '' || $subaction == 'editconditionsform' || $subaction == 'insertcondition' || $subaction == "editthiscondition" || $subaction == "delete" || $subaction == "updatecondition" || $subaction == "deletescenario" || $subaction == "renumberscenarios" || $subaction == "deleteallconditions" || $subaction == "updatescenario" || $subaction == 'copyconditionsform' || $subaction == 'copyconditions') { $conditionsoutput_main_content .= "<tr><td>\n"; //3: Get other conditions currently set for this question $conditionscount = 0; $s = 0; $scenarioquery = "SELECT DISTINCT {$dbprefix}conditions.scenario " . "FROM {$dbprefix}conditions " . "WHERE {$dbprefix}conditions.qid={$qid}\n" . "ORDER BY {$dbprefix}conditions.scenario"; $scenarioresult = db_execute_assoc($scenarioquery) or safe_die("Couldn't get other (scenario) conditions for question {$qid}<br />{$query}<br />" . $connect->Error); $scenariocount = $scenarioresult->RecordCount(); $conditionsoutput_main_content .= "<table width='100%' align='center' cellspacing='0' cellpadding='0'>\n" . "\t<tr bgcolor='#E1FFE1'>\n" . "<td><table align='center' width='100%' cellspacing='0'><tr>\n"; $showreplace = "{$questiontitle}" . showSpeaker($questiontext); $onlyshow = str_replace("{QID}", $showreplace, $clang->gT("Only show question {QID} IF")); if ($subaction == "editconditionsform" || $subaction == 'insertcondition' || $subaction == "editthiscondition" || $subaction == "delete" || $subaction == "updatecondition" || $subaction == "deletescenario" || $subaction == "updatescenario" || $subaction == "renumberscenarios") { $conditionsoutput_main_content .= "\t<td align='center' width='90%'><strong>{$onlyshow}</strong>\n" . "</td>\n" . "<td width='10%' align='right' valign='middle'><form id='deleteallconditions' action='{$scriptname}?action=conditions' method='post' name='deleteallconditions' style='margin-bottom:0;'>\n" . "<input type='hidden' name='qid' value='{$qid}' />\n" . "<input type='hidden' name='gid' value='{$gid}' />\n" . "<input type='hidden' name='sid' value='{$surveyid}' />\n" . "<input type='hidden' id='toplevelsubaction' name='subaction' value='deleteallconditions' />\n"; if ($scenariocount > 0) { // show the Delete all conditions for this question button $conditionsoutput_main_content .= "<a href='#' " . " onclick=\"if ( confirm('" . $clang->gT("Are you sure you want to delete all conditions set to the questions you have selected?", "js") . "')) {document.getElementById('deleteallconditions').submit();}\"" . " title='" . $clang->gTview("Delete all conditions") . "' >" . " <img src='{$imageurl}/conditions_deleteall_16.png' alt='" . $clang->gT("Delete all conditions") . "' name='DeleteAllConditionsImage' /></a>\n"; } if ($scenariocount > 1) { // show the renumber scenario button for this question $conditionsoutput_main_content .= "<a href='#' " . " onclick=\"if ( confirm('" . $clang->gT("Are you sure you want to renumber the scenarios with incremented numbers beginning from 1?", "js") . "')) {document.getElementById('toplevelsubaction').value='renumberscenarios'; document.getElementById('deleteallconditions').submit();}\"" . " title='" . $clang->gTview("Renumber scenario automatically") . "' >" . " <img src='{$imageurl}/scenario_renumber.png' alt='" . $clang->gT("Renumber scenario automatically") . "' name='renumberscenarios' /></a>\n"; } } else { $conditionsoutput_main_content .= "\t<td align='center'><strong>{$onlyshow}</strong>\n" . "<form id='deleteallconditions' action='{$scriptname}?action=conditions' method='post' name='deleteallconditions' style='margin-bottom:0;'>\n" . "<input type='hidden' name='qid' value='{$qid}' />\n" . "<input type='hidden' name='sid' value='{$surveyid}' />\n" . "<input type='hidden' id='toplevelsubaction' name='subaction' value='deleteallconditions' />\n"; } $conditionsoutput_main_content .= "</form></td></tr></table>\n" . "\t</td></tr>\n";
$statisticsoutput .= " checked='checked'"; } //check if there is a dualsclae_headerA/B $dshquery2 = "SELECT value FROM " . db_table_name("question_attributes") . " WHERE qid={$flt[0]} AND attribute='dualscale_headerB'"; $dshresult2 = db_execute_num($dshquery2) or safe_die("Couldn't get dualscale header!<br />{$dshquery2}<br />" . $connect->ErrorMsg()); //get header while ($dshrow2 = $dshresult2->FetchRow()) { $dualscaleheaderb = $dshrow2[0]; } if (isset($dualscaleheaderb) && $dualscaleheaderb != "") { $labeltitle2 = $dualscaleheaderb; } else { //get label text $labeltitle2 = ''; } $statisticsoutput .= " /> <strong>" . showSpeaker($niceqtext . " [" . str_replace("'", "`", $row[1]) . "] - " . $clang->gT("Label") . ": " . $labeltitle2) . "</strong><br />\n"; $fquery = "SELECT * FROM " . db_table_name("answers") . " WHERE qid={$flt[0]} AND language='{$language}' and scale_id=1 ORDER BY sortorder, code"; $fresult = db_execute_assoc($fquery); //this is for debugging only //$statisticsoutput .= $fquery; $statisticsoutput .= "\t\t\t\t<select name='{$surveyid}X{$flt[1]}X{$flt[0]}{$row[0]}#{1}[]' multiple='multiple'>\n"; //list answers while ($frow = $fresult->FetchRow()) { $statisticsoutput .= "\t\t\t\t\t<option value='{$frow['code']}'"; //pre-check if (isset($_POST[$myfield2]) && is_array($_POST[$myfield2]) && in_array($frow['code'], $_POST[$myfield2])) { $statisticsoutput .= " selected"; } $statisticsoutput .= ">({$frow['code']}) " . FlattenText($frow['answer']) . "</option>\n"; } $statisticsoutput .= "\t\t\t\t</select>\n\t\t\t\t</td>\n";