本文整理汇总了PHP中FlattenText函数的典型用法代码示例。如果您正苦于以下问题:PHP FlattenText函数的具体用法?PHP FlattenText怎么用?PHP FlattenText使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FlattenText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: returnglobal
if ($subaction == "deletegroup" && bHasSurveyPermission($surveyid, 'tokens', 'delete')) {
$_SESSION['metaHeader'] = "<meta http-equiv=\"refresh\" content=\"1;URL={$scriptname}?action=tokens&subaction=browsegroup&sid=" . returnglobal('sid') . "&start={$start}&limit={$limit}&order={$order}\" />";
}
// MAKE SURE THAT THERE IS A SID
if (!isset($surveyid) || !$surveyid) {
$tokenoutput .= "\t<div class='messagebox ui-corner-all'><div class='header ui-widget-header'>" . $clang->gT("Token control") . "</div>\n" . "\t<br /><div class='warningheader'>" . $clang->gT("Error") . "</div>" . "<br />" . $clang->gT("You have not selected a survey") . "<br /><br />" . "<input type='submit' value='" . $clang->gT("Main admin screen") . "' onclick=\"window.open('{$scriptname}', '_self')\" /><br />\n" . "</div>\n";
return;
}
// MAKE SURE THAT THE SURVEY EXISTS
$thissurvey = getSurveyInfo($surveyid);
if ($thissurvey === false) {
$tokenoutput .= "\t<div class='messagebox ui-corner-all'>\n<div class='header ui-widget-header'>\n" . $clang->gT("Token control") . "</div>\n" . "\t<br /><div class='warningheader'>" . $clang->gT("Error") . "</div>" . "<br />" . $clang->gT("The survey you selected does not exist") . "<br /><br />\n\t<input type='submit' value='" . $clang->gT("Main admin screen") . "' onclick=\"window.open('{$scriptname}', '_self')\" /><br />" . "</div>\n";
return;
} else {
if ($subaction != 'bounceprocessing') {
$tokenoutput .= "\t<div class='menubar'>" . "<div class='menubar-title ui-widget-header'>" . "<strong>" . $clang->gT("Token control") . " </strong> " . FlattenText($thissurvey['surveyls_title']) . "</div>\n";
$surveyprivate = $thissurvey['anonymized'];
}
}
// CHECK TO SEE IF A TOKEN TABLE EXISTS FOR THIS SURVEY
$tokenexists = tableExists('tokens_' . $surveyid);
if (!$tokenexists) {
if (isset($_POST['createtable']) && $_POST['createtable'] == "Y" && bHasSurveyPermission($surveyid, 'surveyactivation', 'update')) {
$createtokentable = "tid int I NOTNULL AUTO PRIMARY,\n " . "firstname C(40),\n " . "lastname C(40),\n ";
//MSSQL needs special treatment because of some strangeness in ADODB
if ($connect->databaseType == 'odbc_mssql' || $connect->databaseType == 'odbtp' || $connect->databaseType == 'mssql_n' || $connect->databaseType == 'mssqlnative') {
$createtokentable .= "email C(320),\n " . "emailstatus C(300) DEFAULT 'OK',\n ";
} else {
$createtokentable .= "email X(320),\n " . "emailstatus X(300) DEFAULT 'OK',\n ";
}
$createtokentable .= "token C(36) ,\n " . "language C(25) ,\n " . "sent C(17) DEFAULT 'N',\n " . "remindersent C(17) DEFAULT 'N',\n " . "remindercount int I DEFAULT 0,\n " . "completed C(17) DEFAULT 'N',\n " . "usesleft I DEFAULT 1,\n" . "validfrom T ,\n " . "validuntil T ,\n " . "mpid I ";
示例2: FlattenText
<tr>
<td colspan="6" style="background-color: #567081; height: 2px">
</td>
</tr>
<tr>
<td><?php
echo FlattenText($quotalisting['name']);
?>
</td>
<td>
<?php
if ($quotalisting['active'] == 1) {
echo '<font color="#48B150">' . gT("Active") . '</font>';
} else {
echo '<font color="#B73838">' . gT("Not active") . '</font>';
}
?>
</td>
<td>
<?php
if ($quotalisting['action'] == 1) {
eT("Terminate survey");
} elseif ($quotalisting['action'] == 2) {
eT("Terminate survey with warning");
}
?>
</td>
<td <?php
echo $highlight;
?>
><?php
示例3: array
?>
</td>
<td><?php
echo $assess['maximum'];
?>
</td>
<td><?php
$aReplacementData = array();
templatereplace($assess['name'], array(), $aReplacementData, 'Unspecified', false, $assess['sid']);
echo FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), true);
?>
</td>
<td><?php
$aReplacementData = array();
templatereplace($assess['message'], array(), $aReplacementData, 'Unspecified', false, $assess['sid']);
echo FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), true);
?>
</td>
</tr>
<?php
}
?>
</tbody></table>
<?php
if (Permission::model()->hasSurveyPermission($surveyid, 'assessments', 'update') && $actionvalue == "assessmentupdate" || Permission::model()->hasSurveyPermission($surveyid, 'assessments', 'create') && $actionvalue == "assessmentadd") {
?>
<br />
<?php
echo CHtml::form(array("admin/assessments/sa/index/surveyid/{$surveyid}"), 'post', array('class' => 'form30', 'id' => 'assessmentsform', 'name' => 'assessmentsform'));
示例4: FlattenText
//Alternate bgcolor for different groups
if (!isset($bgc)) {
$bgc = "even";
}
if ($bgc == "even") {
$bgc = "odd";
} else {
$bgc = "even";
}
$qid = $deqrow['qid'];
$fieldname = "{$surveyid}" . "X" . "{$gid}" . "X" . "{$qid}";
$dataentryoutput .= "\t<tr class='{$bgc}'>\n" . "<td class='data-entry-small-text' valign='top' width='1%'>{$deqrow['title']}</td>\n" . "<td valign='top' align='right' width='30%'>";
if ($deqrow['mandatory'] == "Y") {
$dataentryoutput .= "<font color='red'>*</font>";
}
$dataentryoutput .= "<strong>" . FlattenText($deqrow['question']) . "</strong></td>\n" . "<td valign='top' align='left' style='padding-left: 20px'>\n";
//DIFFERENT TYPES OF DATA FIELD HERE
if ($deqrow['help']) {
$hh = addcslashes($deqrow['help'], "..'\"");
//Escape ASCII decimal 0-32 plus single and double quotes to make JavaScript happy.
$hh = htmlspecialchars($hh, ENT_QUOTES);
//Change & " ' < > to HTML entities to make HTML happy.
$dataentryoutput .= "\t<img src='{$imageurl}/help.gif' alt='" . $blang->gT("Help about this question") . "' align='right' onclick=\"javascript:alert('Question {$deqrow['title']} Help: {$hh}')\" />\n";
}
switch ($deqrow['type']) {
case "5":
//5 POINT CHOICE radio-buttons
$dataentryoutput .= "\t<select name='{$fieldname}'>\n" . "<option value=''>" . $blang->gT("No answer") . "</option>\n";
for ($x = 1; $x <= 5; $x++) {
$dataentryoutput .= "<option value='{$x}'>{$x}</option>\n";
}
示例5: displayResults
//.........这里部分代码省略.........
case 'pdf':
$headPDF = array();
$headPDF[] = array(gT("Answer"), gT("Count"), gT("Percentage"));
break;
case 'html':
//three columns
$statisticsoutput .= "<strong>" . gT("Answer") . "</strong></th>\n" . "\t\t<th width='25%' align='center' >" . "<strong>" . gT("Count") . "</strong></th>\n" . "\t\t<th width='25%' align='center' >" . "<strong>" . gT("Percentage") . "</strong></th>\n" . "\t</tr></thead>\n";
break;
default:
break;
}
$showheadline = false;
}
//answer text
$fname = "{$al['1']} ({$al['0']})";
}
//are there some results to play with?
if ($results > 0) {
//calculate percentage
$gdata[] = $row / $results * 100;
} else {
//no data!
$gdata[] = "N/A";
}
//put absolute data into array
$grawdata[] = $row;
//put question title and code into array
$label[] = $fname;
//put only the code into the array
$justcode[] = $al[0];
//edit labels and put them into antoher array
//first check if $tempcount is > 0. If yes, $row has been modified and $tempcount has the original count.
if ($tempcount > -1) {
$lbl[wordwrap(FlattenText("{$al['1']}"), 25, "\n")] = $tempcount;
} else {
$lbl[wordwrap(FlattenText("{$al['1']}"), 25, "\n")] = $row;
}
}
//end foreach -> loop through answer data
//no filtering of incomplete answers and NO multiple option questions
//if ((incompleteAnsFilterState() != "complete") and ($outputs['qtype'] != "M") and ($outputs['qtype'] != "P"))
//error_log("TIBO ".print_r($showaggregated_indice_table,true));
if ($outputs['qtype'] != "M" and $outputs['qtype'] != "P") {
//is the checkbox "Don't consider NON completed responses (only works when Filter incomplete answers is Disable)" checked?
//if (isset($_POST[''noncompleted']) and ($_POST['noncompleted'] == "on") && (isset(Yii::app()->getConfig('showaggregateddata')) && Yii::app()->getConfig('showaggregateddata') == 0))
// TIBO: TODO WE MUST SKIP THE FOLLOWING SECTION FOR TYPE A and 5 when
// showaggreagated data is set and set to 1
if (isset($_POST['noncompleted']) and $_POST['noncompleted'] == "on") {
//counter
$i = 0;
while (isset($gdata[$i])) {
if (isset($showaggregated_indice_table[$i]) && $showaggregated_indice_table[$i] == "aggregated") {
// do nothing, we don't rewrite aggregated results
// or at least I don't know how !!! (lemeur)
} else {
//we want to have some "real" data here
if ($gdata[$i] != "N/A") {
//calculate percentage
$gdata[$i] = $grawdata[$i] / $TotalCompleted * 100;
}
}
//increase counter
$i++;
}
//end while (data available)
} else {
示例6: reset
}
}
reset($question_answers);
if (count($question_answers) == $x) {
$quotasoutput .= "<div class=\"header\">" . $clang->gT("Add Answer") . ": " . $clang->gT("Question Selection") . "</div><br />\n <div class=\"messagebox\">\n " . $clang->gT("All answers are already selected in this quota.") . "\n <br/><br/><input type=\"submit\" onclick=\"window.open('{$scriptname}?action=quotas&sid={$surveyid}', '_self')\" value=\"" . $clang->gT("Continue") . "\"/>\n </div>";
} else {
$quotasoutput .= '<div class="header ui-widget-header">' . $clang->gT("Survey Quota") . ': ' . $clang->gT("Add Answer") . '</div><br />
<div class="messagebox ui-corner-all">
<form action="' . $scriptname . '#quota_' . $_POST['quota_id'] . '" class="form30" method="post">
<div class="header">' . sprintf($clang->gt("New Answer for Quota '%s'"), $quota_name) . '</div>
<ul>
<li><label for="quota_anscode">' . $clang->gT("Select Answer") . ':</label>
<select id="quota_anscode" name="quota_anscode" size="15">';
while (list($key, $value) = each($question_answers)) {
if (!isset($value['rowexists'])) {
$quotasoutput .= '<option value="' . $key . '">' . $key . ':' . FlattenText(substr($value['Display'], 0, 40)) . '</option>';
}
}
$quotasoutput .= '
</select>
</li>
<li>
<label for="createanother">' . $clang->gT("Save this, then create another:") . '</label>
<input type="checkbox" id="createanother" name="createanother">
</li>
</ul><p>
<input name="submit" type="submit" class="submit" value="' . $clang->gT("Next") . '" />
<input type="hidden" name="sid" value="' . $surveyid . '" />
<input type="hidden" name="action" value="quotas" />
<input type="hidden" name="subaction" value="insertquotaanswer" />
<input type="hidden" name="quota_qid" value="' . $_POST['quota_qid'] . '" />
示例7: do_array_multitext
//.........这里部分代码省略.........
foreach ($labelans as $ld)
{
$answer .= "\t<th>".$ld."</th>\n";
}
$answer .= "</tr>\n</tbody>\n";
}
}
$myfname = $ia[1].$ansrow['title'];
$answertext=dTexts::run($ansrow['question']);
$answertextsave=$answertext;
/* Check if this item has not been answered: the 'notanswered' variable must be an array,
containing a list of unanswered questions, the current question must be in the array,
and there must be no answer available for the item in this session. */
if ((is_array($notanswered)) && (array_search($ia[1], $notanswered) !== FALSE))
{
//Go through each labelcode and check for a missing answer! If any are found, highlight this line
$emptyresult=0;
foreach($labelcode as $ld)
{
$myfname2=$myfname.'_'.$ld;
if($_SESSION[$myfname2] == '')
{
$emptyresult=1;
}
}
if ($emptyresult == 1)
{
$answertext = "<span class=\"errormandatory\">{$answertext}</span>";
}
}
// Get array_filter stuff
list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname);
$answer .= $htmltbody2;
if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));}
$trbc = alternation($trbc , 'row');
$answer .= "\t\t<tr class=\"$trbc\" id=\"$myfname\">\n"
. "\t\t\t<th class=\"answertext\">\n"
. "\t\t\t\t".$hiddenfield
. "$answertext\n"
. "\t\t\t\t<input type=\"hidden\" name=\"java$myfname\" id=\"java$myfname\" value=\"";
if (isset($_SESSION[$myfname])) {$answer .= $_SESSION[$myfname];}
$answer .= "\" />\n\t\t\t</th>\n";
$thiskey=0;
foreach ($labelcode as $ld)
{
$myfname2=$myfname."_$ld";
$myfname2value = isset($_SESSION[$myfname2]) ? $_SESSION[$myfname2] : "";
$answer .= "\t<td class=\"answer_cell_00$ld\">\n"
. "\t\t\t\t<label for=\"answer{$myfname2}\">\n"
. "\t\t\t\t<input type=\"hidden\" name=\"java{$myfname2}\" id=\"java{$myfname2}\" />\n"
. "\t\t\t\t<input type=\"text\" name=\"$myfname2\" id=\"answer{$myfname2}\" title=\""
. FlattenText($labelans[$thiskey]).'" '
. 'size="'.$inputwidth.'" '
. ' value="'.str_replace ('"', "'", str_replace('\\', '', $myfname2value))."\" />\n";
$inputnames[]=$myfname2;
$answer .= "\t\t\t\t</label>\n\t\t\t</td>\n";
$thiskey += 1;
}
if (strpos($answertextsave,'|'))
{
$answertext=substr($answertextsave,strpos($answertextsave,'|')+1);
$answer .= "\t\t\t<td class=\"answertextright\" style=\"text-align:left;\" width=\"$answerwidth%\">$answertext</td>\n";
}
elseif ($right_exists)
{
$answer .= "\t\t\t<td class=\"answertextright\" style='text-align:left;' width='$answerwidth%'> </td>\n";
}
$answer .= str_replace(array('[[ROW_NAME]]','[[INPUT_WIDTH]]') , array(strip_tags($answertext),$inputwidth) , $row_total);
$answer .= "\n\t\t</tr>\n";
$answer .= "</tbody>\n";
//IF a MULTIPLE of flexi-redisplay figure, repeat the headings
$fn++;
}
if($show_totals == 'col' || $show_totals = 'both' || $grand_total == true)
{
$answer .= "\t\t<tr class=\"total\">$row_head";
for( $a = 0; $a < count($labelcode) ; ++$a )
{
$answer .= str_replace(array('[[ROW_NAME]]','[[INPUT_WIDTH]]') , array(strip_tags($answertext),$inputwidth) , $col_total);
};
$answer .= str_replace(array('[[ROW_NAME]]','[[INPUT_WIDTH]]') , array(strip_tags($answertext),$inputwidth) , $grand_total)."\n\t\t</tr>\n";
};
$answer .= "\t</tbody>\n</table>\n";
if(!empty($q_table_id))
{
$answer .= "\n<script type=\"text/javascript\">new multi_set('$q_table_id');</script>\n";
};
}
else
{
$answer = "\n<p class=\"error\">".$clang->gT("Error: There are no answer options for this question and/or they don't exist in this language.")."</p>\n";
$inputnames='';
}
return array($answer, $inputnames);
}
示例8: strip_tags_full
function strip_tags_full($string)
{
$string = str_replace('-oth-', '', $string);
return FlattenText($string, true, 'UTF-8', false);
}
示例9: templatereplace
if ($qrrow['type'] != "X") {
if ($qrrow['mandatory'] == "Y") {
$questionsummary .= ": (<i>" . $clang->gT("Mandatory Question") . "</i>)";
} else {
$questionsummary .= ": (<i>" . $clang->gT("Optional Question") . "</i>)";
}
}
$questionsummary .= "</td></tr>\n" . "<tr><td align='right' valign='top'><strong>";
$questionsummary .= $clang->gT("Question:") . "</strong></td>\n<td align='left'>";
// Color code the question, help, and relevance
templatereplace($qrrow['question'], false, false, $qid);
$questionsummary .= FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), false, 'UTF-8', true, true);
$questionsummary .= "</td></tr>\n" . "<tr><td align='right' valign='top'><strong>" . $clang->gT("Help:") . "</strong></td>\n<td align='left'>";
if (trim($qrrow['help']) != '') {
templatereplace($qrrow['help'], false, false, $qid);
$questionsummary .= FlattenText(LimeExpressionManager::GetLastPrettyPrintExpression(), false, 'UTF-8', true, true);
}
$questionsummary .= "</td></tr>\n";
if ($qrrow['preg']) {
$questionsummary .= "<tr ><td align='right' valign='top'><strong>" . $clang->gT("Validation:") . "</strong></td>\n<td align='left'>{$qrrow['preg']}" . "</td></tr>\n";
}
$qtypes = getqtypelist("", "array");
//qtypes = array(type code=>type description)
$questionsummary .= "<tr><td align='right' valign='top'><strong>" . $clang->gT("Type:") . "</strong></td>\n<td align='left'>{$qtypes[$qrrow['type']]['description']}";
$questionsummary .= "</td></tr>\n";
if ($qct == 0 && $qtypes[$qrrow['type']]['answerscales'] > 0) {
$questionsummary .= "<tr ><td></td><td align='left'>" . "<span class='statusentryhighlight'>" . $clang->gT("Warning") . ": <a href='{$scriptname}?sid={$surveyid}&gid={$gid}&qid={$qid}&action=editansweroptions'>" . $clang->gT("You need to add answer options to this question") . " " . "<img src='{$imageurl}/answers_20.png' title='" . $clang->gT("Edit answer options for this question") . "' name='EditThisQuestionAnswers'/></span></td></tr>\n";
}
// EDIT SUBQUESTIONS FOR THIS QUESTION BUTTON
if ($sqct == 0 && $qtypes[$qrrow['type']]['subquestions'] > 0) {
$questionsummary .= "<tr ><td></td><td align='left'>" . "<span class='statusentryhighlight'>" . $clang->gT("Warning") . ": <a href='{$scriptname}?sid={$surveyid}&gid={$gid}&qid={$qid}&action=editsubquestions'>" . $clang->gT("You need to add subquestions to this question") . " " . "<img src='{$imageurl}/subquestions_20.png' title='" . $clang->gT("Edit subquestions for this question") . "' name='EditThisQuestionAnswers' /></span></td></tr>\n";
示例10: elseif
if (isset($_POST['printableexport'])) {
$pdf->intopdf(FlattenText($fname[0], true));
$pdf->ln(2);
} else {
$printoutput .= "\t<tr class='printanswersgroup'><td colspan='2'>{$fname[0]}</td></tr>\n";
}
} elseif (substr($sFieldname, 0, 4) == 'qid_') {
if (isset($_POST['printableexport'])) {
$pdf->intopdf(FlattenText($fname[0] . $fname[1], true) . ": " . $fname[2]);
$pdf->ln(2);
} else {
$printoutput .= "\t<tr class='printanswersquestionhead'><td colspan='2'>{$fname[0]}</td></tr>\n";
}
} else {
if (isset($_POST['printableexport'])) {
$pdf->intopdf(FlattenText($fname[0] . $fname[1], true) . ": " . $fname[2]);
$pdf->ln(2);
} else {
$printoutput .= "\t<tr class='printanswersquestion'><td>{$fname[0]} {$fname[1]}</td><td class='printanswersanswertext'>{$fname[2]}</td></tr>";
}
}
}
$printoutput .= "</table>\n";
if (isset($_POST['printableexport'])) {
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$sExportFileName = sanitize_filename($surveyname);
$pdf->Output($sExportFileName . "-" . $surveyid . ".pdf", "D");
}
//Display the page with user answers
if (!isset($_POST['printableexport'])) {
示例11: array_filter_help
function array_filter_help($qidattributes, $surveyprintlang, $surveyid)
{
global $clang;
$output = "";
if (!empty($qidattributes['array_filter'])) {
$newquery = "SELECT question FROM " . db_table_name("questions") . " WHERE title='{$qidattributes['array_filter']}' AND language='{$surveyprintlang}' AND sid = '{$surveyid}'";
$newresult = db_execute_assoc($newquery);
$newquestiontext = $newresult->fetchRow();
$output .= "\n<p class='extrahelp'>\n\t\t " . sprintf($clang->gT("Only answer this question for the items you selected in question *%s* ('%s')"), $qidattributes['array_filter'], FlattenText(br2nl($newquestiontext['question']))) . "\n\t\t</p>\n";
}
if (!empty($qidattributes['array_filter_exclude'])) {
$newquery = "SELECT question FROM " . db_table_name("questions") . " WHERE title='{$qidattributes['array_filter_exclude']}' AND language='{$surveyprintlang}' AND sid = '{$surveyid}'";
$newresult = db_execute_assoc($newquery);
$newquestiontext = $newresult->fetchRow();
$output .= "\n <p class='extrahelp'>\n\t\t " . sprintf($clang->gT("Only answer this question for the items you did not select in question *%s* ('%s')"), $qidattributes['array_filter_exclude'], br2nl($newquestiontext['question'])) . "\n\t\t</p>\n";
}
return $output;
}
示例12: while
".$clang->gT("All answers are already selected in this quota.")."
<br/><br/><input type=\"submit\" onclick=\"window.open('$scriptname?action=quotas&sid=$surveyid', '_top')\" value=\"".$clang->gT("Continue")."\"/>
</div>";
} else
{
$quotasoutput .='<div class="header ui-widget-header">'.$clang->gT("Survey Quota").': '.$clang->gT("Add Answer").'</div><br />
<div class="messagebox ui-corner-all">
<form action="'.$scriptname.'#quota_'.$_POST['quota_id'].'" class="form30" method="post">
<div class="header">'.sprintf($clang->gt("New Answer for Quota '%s'"), $quota_name).'</div>
<ul>
<li><label for="quota_anscode">'.$clang->gT("Select Answer").':</label>
<select id="quota_anscode" name="quota_anscode" size="15">';
while (list($key,$value) = each($question_answers))
{
if (!isset($value['rowexists'])) $quotasoutput .='<option value="'.$key.'">'.$key.':'.FlattenText(substr($value['Display'],0,40)).'</option>';
}
$quotasoutput .='
</select>
</li>
<li>
<label for="createanother">'.$clang->gT("Save this, then create another:").'</label>
<input type="checkbox" id="createanother" name="createanother">
</li>
</ul><p>
<input name="submit" type="submit" class="submit" value="'.$clang->gT("Next").'" />
<input type="hidden" name="sid" value="'.$surveyid.'" />
<input type="hidden" name="action" value="quotas" />
<input type="hidden" name="subaction" value="insertquotaanswer" />
示例13: displayResults
//.........这里部分代码省略.........
$bSum = false;
$bShowCount = true;
$bShowPercentage = true;
break;
default:
break;
}
$showheadline = false;
}
//answer text
$fname = "{$al['1']} ({$al['0']})";
}
//are there some results to play with?
if ($results > 0) {
//calculate percentage
$gdata[] = $row / $results * 100;
} else {
//no data!
$gdata[] = "N/A";
}
//put absolute data into array
$grawdata[] = $row;
if (!(in_array('is_comment', $al) || in_array('is_no_answer', $al))) {
$grawdata_percents[] = $row;
}
//var_dump($grawdata); die();
//put question title and code into array
$label[] = $fname;
//put only the code into the array
$justcode[] = $al[0];
//edit labels and put them into antoher array
//first check if $tempcount is > 0. If yes, $row has been modified and $tempcount has the original count.
if ($tempcount > -1) {
$flatLabel = wordwrap(FlattenText("{$al['1']}"), 25, "\n");
// If the flatten label is empty (like for picture, or HTML, etc.)
// We replace it by the subquestion code
if ($flatLabel == '') {
$flatLabel = $al[0];
}
// For legend
$lbl[$flatLabel] = $tempcount;
} else {
$flatLabel = wordwrap(FlattenText("{$al['1']}"), 25, "\n");
// If the flatten label is empty (like for picture, or HTML, etc.)
// We replace it by the subquestion code
if ($flatLabel == '') {
$flatLabel = $al[0];
}
$lbl[$flatLabel] = $row;
}
// For Graph labels
switch ($_POST['graph_labels']) {
case 'qtext':
$aGraphLabels[] = $sFlatLabel = $flatLabel;
break;
case 'both':
$aGraphLabels[] = $sFlatLabel = $al[0] . ': ' . $flatLabel;
break;
default:
$aGraphLabels[] = $sFlatLabel = $al[0];
break;
}
if (!(in_array('is_comment', $al) || in_array('is_no_answer', $al))) {
$aGraphLabelsPercent[] = $sFlatLabel;
$lblPercent[$flatLabel] = $lbl[$flatLabel];
}
示例14: browsemenubar
function browsemenubar($title = '')
{
global $surveyid, $scriptname, $imageurl, $homeurl, $clang, $sumrows5, $surrows;
$thissurvey = getSurveyInfo($surveyid);
//BROWSE MENU BAR
$browsemenubar = "<div class='menubar'>\n" . "<div class='menubar-title ui-widget-header'>\n" . "<strong>{$title}</strong>: " . FlattenText($thissurvey['name']) . "</div>" . "<div class='menubar-main'>\n" . "<div class='menubar-left'>\n" . "<a href='{$scriptname}?sid={$surveyid}' title=\"" . $clang->gTview("Return to survey administration") . "\" >" . "<img name='Administration' src='{$imageurl}/home.png' title='' alt='" . $clang->gT("Return to survey administration") . "' /></a>\n" . "<img src='{$imageurl}/blank.gif' alt='' width='11' />\n" . "<img src='{$imageurl}/seperator.gif' alt='' />\n";
//Show summary information
if (bHasSurveyPermission($surveyid, 'responses', 'read')) {
$browsemenubar .= "<a href='{$scriptname}?action=browse&sid={$surveyid}' title=\"" . $clang->gTview("Show summary information") . "\" >" . "<img name='SurveySummary' src='{$imageurl}/summary.png' title='' alt='" . $clang->gT("Show summary information") . "' /></a>\n";
//Display responses
if (count(GetAdditionalLanguagesFromSurveyID($surveyid)) == 0) {
$browsemenubar .= "<a href='{$scriptname}?action=browse&sid={$surveyid}&subaction=all' title=\"" . $clang->gTview("Display Responses") . "\" >" . "<img name='ViewAll' src='{$imageurl}/document.png' title='' alt='" . $clang->gT("Display Responses") . "' /></a>\n";
} else {
$browsemenubar .= "<a href=\"#\" accesskey='b' id='browseresponses'" . "title=\"" . $clang->gTview("Display Responses") . "\" >" . "<img src='{$imageurl}/document.png' alt='" . $clang->gT("Display Responses") . "' name='ViewAll' /></a>";
$tmp_survlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
$baselang = GetBaseLanguageFromSurveyID($surveyid);
$tmp_survlangs[] = $baselang;
rsort($tmp_survlangs);
$browsemenubar .= "<div class=\"langpopup\" id=\"browselangpopup\">" . $clang->gT("Please select a language:") . "<ul>";
foreach ($tmp_survlangs as $tmp_lang) {
$browsemenubar .= "<li><a href=\"{$scriptname}?action=browse&sid={$surveyid}&subaction=all&browselang={$tmp_lang}\" accesskey='b'>" . getLanguageNameFromCode($tmp_lang, false) . "</a></li>";
}
$browsemenubar .= "</ul></div>";
}
// Display last 50 responses
$browsemenubar .= "<a href='{$scriptname}?action=browse&sid={$surveyid}&subaction=all&limit=50&order=desc'" . " title=\"" . $clang->gTview("Display Last 50 Responses") . "\" >" . "<img name='ViewLast' src='{$imageurl}/viewlast.png' alt='" . $clang->gT("Display Last 50 Responses") . "' /></a>\n";
}
// Data entry
if (bHasSurveyPermission($surveyid, 'responses', 'create')) {
$browsemenubar .= "<a href='{$scriptname}?action=dataentry&sid={$surveyid}'" . " title=\"" . $clang->gTview("Dataentry Screen for Survey") . "\" >" . "<img name='DataEntry' src='{$imageurl}/dataentry.png' alt='" . $clang->gT("Dataentry Screen for Survey") . "' /></a>\n";
}
// Statistics
if (bHasSurveyPermission($surveyid, 'statistics', 'read')) {
$browsemenubar .= "<a href='{$scriptname}?action=statistics&sid={$surveyid}' " . "title=\"" . $clang->gTview("Get statistics from these responses") . "\" >" . "<img name='Statistics' src='{$imageurl}/statistics.png' alt='" . $clang->gT("Get statistics from these responses") . "' /></a>\n";
// Time Statistics
if ($thissurvey['savetimings'] == "Y") {
$browsemenubar .= "<a href='{$scriptname}?action=browse&sid={$surveyid}&subaction=time' " . "title=\"" . $clang->gTview("Get time statistics from these responses") . "\" >" . "<img name='timeStatistics' src='{$imageurl}/timeStatistics.png' alt='" . $clang->gT("Get time statistics from these responses") . "' /></a>\n";
}
}
$browsemenubar .= "<img src='{$imageurl}/seperator.gif' alt='' />\n";
if (bHasSurveyPermission($surveyid, 'responses', 'export')) {
// Export to application
$browsemenubar .= "<a href='{$scriptname}?action=exportresults&sid={$surveyid}' title=\"" . $clang->gTview("Export results to application") . "\" >" . "<img name='Export' src='{$imageurl}/export.png' " . "alt='" . $clang->gT("Export results to application") . "' /></a>\n" . "<a href='{$scriptname}?action=exportspss&sid={$surveyid}' title=\"" . $clang->gTview("Export results to a SPSS/PASW command file") . "\" >" . "<img src='{$imageurl}/exportspss.png' " . "alt='" . $clang->gT("Export results to a SPSS/PASW command file") . "' /></a>\n" . "<a href='{$scriptname}?action=exportr&sid={$surveyid}' title=\"" . $clang->gTview("Export results to a R data file") . "\" >" . "<img src='{$imageurl}/exportr.png' " . "alt='" . $clang->gT("Export results to a R data file") . "' /></a>\n";
}
//Import old response table
if (bHasSurveyPermission($surveyid, 'responses', 'create')) {
$browsemenubar .= "<a href='{$scriptname}?action=importoldresponses&sid={$surveyid}' title=\"" . $clang->gTview("Import responses from a deactivated survey table") . "\" >" . "<img name='ImportOldResponses' src='{$imageurl}/importold.png' alt='" . $clang->gT("Import responses from a deactivated survey table") . "' /></a>\n";
}
$browsemenubar .= "<img src='{$imageurl}/seperator.gif' alt='' />\n";
//browse saved responses
if (bHasSurveyPermission($surveyid, 'responses', 'read')) {
$browsemenubar .= "<a href='{$scriptname}?action=saved&sid={$surveyid}' title=\"" . $clang->gTview("View Saved but not submitted Responses") . "\" >" . "<img src='{$imageurl}/saved.png' title='' alt='" . $clang->gT("View Saved but not submitted Responses") . "' name='BrowseSaved' /></a>\n";
}
//Import VV
if (bHasSurveyPermission($surveyid, 'responses', 'import')) {
$browsemenubar .= "<a href='{$scriptname}?action=vvimport&sid={$surveyid}' title=\"" . $clang->gTview("Import a VV survey file") . "\" >" . "<img src='{$imageurl}/importvv.png' alt='" . $clang->gT("Import a VV survey file") . "' /></a>\n";
}
//Export VV
if (bHasSurveyPermission($surveyid, 'responses', 'export')) {
$browsemenubar .= "<a href='{$scriptname}?action=vvexport&sid={$surveyid}' title=\"" . $clang->gTview("Export a VV survey file") . "\" >" . "<img src='{$imageurl}/exportvv.png' title='' alt='" . $clang->gT("Export a VV survey file") . "' /></a>\n";
}
//Iterate survey
if (bHasSurveyPermission($surveyid, 'responses', 'delete') && $thissurvey['anonymized'] == 'N' && $thissurvey['tokenanswerspersistence'] == 'Y') {
$browsemenubar .= "<a href='{$scriptname}?action=iteratesurvey&sid={$surveyid}' title=\"" . $clang->gTview("Iterate survey") . "\" >" . "<img src='{$imageurl}/iterate.png' title='' alt='" . $clang->gT("Iterate survey") . "' /></a>\n";
}
$browsemenubar .= "</div>\n" . "\t</div>\n" . "</div>\n";
return $browsemenubar;
}
示例15: getQuestions
/**
* getQuestions() queries the database for an list of all questions matching the current survey and group id
*
* @global string $surveyid
* @global string $gid
* @global string $selectedqid
*
* @return This string is returned containing <option></option> formatted list of questions in the current survey and group
*/
function getQuestions($surveyid, $gid, $selectedqid)
{
global $scriptname, $clang;
$s_lang = GetBaseLanguageFromSurveyID($surveyid);
$qquery = 'SELECT * FROM ' . db_table_name('questions') . " WHERE sid={$surveyid} AND gid={$gid} AND language='{$s_lang}' and parent_qid=0 order by question_order";
$qresult = db_execute_assoc($qquery);
//checked
$qrows = $qresult->GetRows();
if (!isset($questionselecter)) {
$questionselecter = "";
}
foreach ($qrows as $qrow) {
$qrow['title'] = strip_tags($qrow['title']);
$questionselecter .= "<option value='{$scriptname}?sid={$surveyid}&gid={$gid}&qid={$qrow['qid']}'";
if ($selectedqid == $qrow['qid']) {
$questionselecter .= " selected='selected'";
$qexists = "Y";
}
$questionselecter .= ">{$qrow['title']}:";
$questionselecter .= " ";
$question = FlattenText($qrow['question']);
if (strlen($question) < 35) {
$questionselecter .= $question;
} else {
$questionselecter .= htmlspecialchars(mb_strcut(html_entity_decode($question, ENT_QUOTES, 'UTF-8'), 0, 35, 'UTF-8')) . "...";
}
$questionselecter .= "</option>\n";
}
if (!isset($qexists)) {
$questionselecter = "<option selected='selected'>" . $clang->gT("Please choose...") . "</option>\n" . $questionselecter;
}
return $questionselecter;
}