本文整理汇总了PHP中getExtendedAnswer函数的典型用法代码示例。如果您正苦于以下问题:PHP getExtendedAnswer函数的具体用法?PHP getExtendedAnswer怎么用?PHP getExtendedAnswer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getExtendedAnswer函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: view
//.........这里部分代码省略.........
}
}
$nfncount = count($fnames) - 1;
if ($iId < 1) {
$iId = 1;
}
$exist = SurveyDynamic::model($iSurveyID)->exist($iId);
$next = SurveyDynamic::model($iSurveyID)->next($iId, true);
$previous = SurveyDynamic::model($iSurveyID)->previous($iId, true);
$aData['exist'] = $exist;
$aData['next'] = $next;
$aData['previous'] = $previous;
$aData['id'] = $iId;
$aViewUrls[] = 'browseidheader_view';
if ($exist) {
$oPurifier = new CHtmlPurifier();
//SHOW INDIVIDUAL RECORD
$oCriteria = new CDbCriteria();
if ($bHaveToken) {
$oCriteria = SurveyDynamic::model($iSurveyID)->addTokenCriteria($oCriteria);
}
$oCriteria->addCondition("id = {$iId}");
$iIdresult = SurveyDynamic::model($iSurveyID)->findAllAsArray($oCriteria);
foreach ($iIdresult as $iIdrow) {
$iId = $iIdrow['id'];
$rlanguage = $iIdrow['startlanguage'];
}
$aData['bHasFile'] = false;
if (isset($rlanguage)) {
$aData['rlanguage'] = $rlanguage;
}
foreach ($iIdresult as $iIdrow) {
$highlight = false;
for ($i = 0; $i < $nfncount + 1; $i++) {
if ($fnames[$i][0] != 'completed' && is_null($iIdrow[$fnames[$i][0]])) {
continue;
// irrelevant, so don't show
}
$inserthighlight = '';
if ($highlight) {
$inserthighlight = "class='highlight'";
}
if ($fnames[$i][0] == 'completed') {
if ($iIdrow['submitdate'] == NULL || $iIdrow['submitdate'] == "N") {
$answervalue = "N";
} else {
$answervalue = "Y";
}
} else {
if (isset($fnames[$i]['type']) && $fnames[$i]['type'] == "|") {
$index = $fnames[$i]['index'];
$metadata = $fnames[$i]['metadata'];
$phparray = json_decode_ls($iIdrow[$fnames[$i][0]]);
if (isset($phparray[$index])) {
switch ($metadata) {
case "size":
$answervalue = sprintf(gT("%s KB"), intval($phparray[$index][$metadata]));
break;
case "name":
$answervalue = CHtml::link($oPurifier->purify(rawurldecode($phparray[$index][$metadata])), $this->getController()->createUrl("/admin/responses", array("sa" => "actionDownloadfile", "surveyid" => $surveyid, "iResponseId" => $iId, "sFileName" => $phparray[$index][$metadata])));
break;
default:
$answervalue = htmlspecialchars(strip_tags(stripJavaScript($phparray[$index][$metadata])));
}
$aData['bHasFile'] = true;
} else {
$answervalue = "";
}
} else {
$answervalue = htmlspecialchars(strip_tags(stripJavaScript(getExtendedAnswer($iSurveyID, $fnames[$i][0], $iIdrow[$fnames[$i][0]], $sBrowseLanguage))), ENT_QUOTES);
}
}
$aData['answervalue'] = $answervalue;
$aData['inserthighlight'] = $inserthighlight;
$aData['fnames'] = $fnames;
$aData['i'] = $i;
$aViewUrls['browseidrow_view'][] = $aData;
}
}
} else {
Yii::app()->session['flashmessage'] = gT("This response ID is invalid.");
}
$aViewUrls[] = 'browseidfooter_view';
$aData['sidemenu']['state'] = false;
$aData['menu']['edition'] = true;
$aData['menu']['view'] = true;
$aData['menu']['close'] = true;
// This resets the url on the close button to go to the upper view
$aData['menu']['closeurl'] = $this->getController()->createUrl("admin/responses/sa/browse/surveyid/" . $iSurveyId);
$this->_renderWrappedTemplate('', $aViewUrls, $aData);
} else {
$aData = array();
$aData['surveyid'] = $iSurveyID;
$message = array();
$message['title'] = gT('Access denied!');
$message['message'] = gT('You do not have permission to access this page.');
$message['class'] = "error";
$this->_renderWrappedTemplate('survey', array("message" => $message), $aData);
}
}
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:101,代码来源:responses.php
示例2: rawurldecode
{ ?>
<td><?php echo rawurldecode($phparray[$index][$metadata]); ?></td>
<?php
}
}
else
{
?>
<td> </td>
<?php
}
}
else
{
if (isset($fnames[$i][4]) && $fnames[$i][4] == 'D' && $fnames[$i][0] != '')
{
if ($dtrow[$fnames[$i][0]] == NULL)
$browsedatafield = "N";
else
$browsedatafield = "Y";
}
else
{
$browsedatafield = htmlspecialchars(strip_tags(stripJavaScript(getExtendedAnswer($surveyid, $fnames[$i][0], $dtrow[$fnames[$i][0]], $oBrowseLanguage))), ENT_QUOTES);
}
echo "<td><span>$browsedatafield</span></td>\n";
}
}
?>
</tr>
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:30,代码来源:browseallrow_view.php
示例3: getFullResponseTable
/**
* Creates an array with details on a particular response for display purposes
* Used in Print answers, Detailed response view and Detailed admin notification email
*
* @param mixed $iSurveyID
* @param mixed $iResponseID
* @param mixed $sLanguageCode
* @param boolean $bHonorConditions Apply conditions
*/
function getFullResponseTable($iSurveyID, $iResponseID, $sLanguageCode, $bHonorConditions = true)
{
$aFieldMap = createFieldMap($iSurveyID, 'full', false, false, $sLanguageCode);
//Get response data
$idrow = SurveyDynamic::model($iSurveyID)->findByAttributes(array('id' => $iResponseID));
// Create array of non-null values - those are the relevant ones
$aRelevantFields = array();
foreach ($aFieldMap as $sKey => $fname) {
if (LimeExpressionManager::QuestionIsRelevant($fname['qid']) || $bHonorConditions == false) {
$aRelevantFields[$sKey] = $fname;
}
}
$aResultTable = array();
$oldgid = 0;
$oldqid = 0;
foreach ($aRelevantFields as $sKey => $fname) {
if (!empty($fname['qid'])) {
$attributes = getQuestionAttributeValues($fname['qid']);
if (getQuestionAttributeValue($attributes, 'hidden') == 1) {
continue;
}
}
$question = $fname['question'];
$subquestion = '';
if (isset($fname['gid']) && !empty($fname['gid'])) {
//Check to see if gid is the same as before. if not show group name
if ($oldgid !== $fname['gid']) {
$oldgid = $fname['gid'];
if (LimeExpressionManager::GroupIsRelevant($fname['gid']) || $bHonorConditions == false) {
$aResultTable['gid_' . $fname['gid']] = array($fname['group_name'], QuestionGroup::model()->getGroupDescription($fname['gid'], $sLanguageCode));
}
}
}
if (!empty($fname['qid'])) {
if ($oldqid !== $fname['qid']) {
$oldqid = $fname['qid'];
if (isset($fname['subquestion']) || isset($fname['subquestion1']) || isset($fname['subquestion2'])) {
$aResultTable['qid_' . $fname['sid'] . 'X' . $fname['gid'] . 'X' . $fname['qid']] = array($fname['question'], '', '');
} else {
$answer = getExtendedAnswer($iSurveyID, $fname['fieldname'], $idrow[$fname['fieldname']], $sLanguageCode);
$aResultTable[$fname['fieldname']] = array($question, '', $answer);
continue;
}
}
} else {
$answer = getExtendedAnswer($iSurveyID, $fname['fieldname'], $idrow[$fname['fieldname']], $sLanguageCode);
$aResultTable[$fname['fieldname']] = array($question, '', $answer);
continue;
}
if (isset($fname['subquestion'])) {
$subquestion = "[{$fname['subquestion']}]";
}
if (isset($fname['subquestion1'])) {
$subquestion = "[{$fname['subquestion1']}]";
}
if (isset($fname['subquestion2'])) {
$subquestion .= "[{$fname['subquestion2']}]";
}
$answer = getExtendedAnswer($iSurveyID, $fname['fieldname'], $idrow[$fname['fieldname']], $sLanguageCode);
$aResultTable[$fname['fieldname']] = array($question, $subquestion, $answer);
}
return $aResultTable;
}
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:72,代码来源:common_helper.php
示例4: getResponses_json
//.........这里部分代码省略.........
$sFiltering = 'tokens.token';
}
$oCriteria->compare(Yii::app()->db->quoteColumnName($sFiltering), $value, true);
}
}
if ($sFilters = Yii::app()->request->getParam('filters')) {
$aFilters = json_decode($sFilters);
// TODO : groupOp and rules
}
}
// Elements for nav bar of jquery
$iCount = SurveyDynamic::model($iSurveyID)->count($oCriteria);
// or die("Couldn't get response data<br />");
$iLimit = (int) $iLimit > 0 ? (int) $iLimit : 50;
if (!$iLimit || $iLimit > $iCount) {
$iLimit = $iCount;
}
$iStart = (int) $iPage > 0 ? (int) $iPage * $iLimit - $iLimit : 0;
$aSurveyEntries = new stdClass();
$aSurveyEntries->page = $iPage;
// Did we need to fix page ?
$aSurveyEntries->total = $iCount > 0 ? ceil($iCount / $iLimit) : 0;
$aSurveyEntries->records = $iCount;
// Last criteria update
$oCriteria->offset = $iStart;
$oCriteria->limit = $iLimit;
// Get the rows
$dtresult = SurveyDynamic::model($iSurveyID)->findAllAsArray($oCriteria);
$all_rows = array();
foreach ($dtresult as $row) {
// View detail icon
$action_html = '<a href="' . Yii::app()->createUrl("admin/responses/view/surveyid/{$surveyid}/id/{$row['id']}") . '"><span class="glyphicon glyphicon-list-alt text-success" title="' . gT('View response details') . '"></span></a>';
// Edit icon
if (Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'update')) {
$action_html .= "<a href='" . Yii::app()->createUrl("admin/dataentry/editdata/subaction/edit/surveyid/{$surveyid}/id/{$row['id']}") . "'>\n <span class='glyphicon glyphicon-pencil text-success' title='" . gT('Edit this response') . "'></span></a>";
}
// Download icon
if (hasFileUploadQuestion($surveyid)) {
if (Response::model($surveyid)->findByPk($row['id'])->getFiles()) {
$action_url = Yii::app()->createUrl("admin/responses", array("sa" => "actionDownloadfiles", "surveyid" => $surveyid, "sResponseId" => $row['id']));
$action_html .= '<a title="' . gT('Download all files in this response as a zip file') . '" href="' . $action_url . '"><span class="glyphicon glyphicon-download-alt downloadfile"></span></a>';
}
}
// Delete icon
if (Permission::model()->hasSurveyPermission($iSurveyID, 'responses', 'delete')) {
$action_html .= "<a href='" . Yii::app()->createUrl("admin/responses", array("sa" => "actionDelete", "surveyid" => $surveyid, "sResponseId" => $row['id'])) . "' data-delete='" . $row['id'] . "'>\n <span title='" . sprintf(gT('Delete response %s'), $row['id']) . "' class='deleteresponse glyphicon glyphicon-trash text-warning'></span></a>";
}
$aSurveyEntry = array();
$aSurveyEntry[] = $action_html;
$aSurveyEntry[] = $row['id'];
$aSurveyEntry[] = $row['lastpage'];
// completed
$aSurveyEntry[] = empty($row['submitdate']) ? 'N' : 'Y';
if ($bHaveToken) {
if (is_null($row['tid'])) {
$aSurveyEntry[] = strip_tags($row['token']);
} else {
$aSurveyEntry[] = "<a href='" . Yii::app()->createUrl("admin/tokens", array("sa" => "edit", "surveyid" => $surveyid, "tokenid" => $row['tid'])) . "'>" . strip_tags($row['token']) . "</a>";
}
$aSurveyEntry[] = strip_tags($row['firstname']);
$aSurveyEntry[] = strip_tags($row['lastname']);
$aSurveyEntry[] = strip_tags($row['email']);
}
// startlanguage
//$aSurveyEntry[] = $row['startlanguage'];
foreach ($row as $aFieldName => $mFieldValue) {
if (in_array($aFieldName, $aSpecificColumns)) {
continue;
}
$sSurveyEntry = strip_tags(getExtendedAnswer($iSurveyID, $aFieldName, $mFieldValue, $sBrowseLanguage));
// This fix XSS and get the value
if ($aFieldmap[$aFieldName]['type'] == '|' && strpos($aFieldName, 'filecount') === false) {
$aQuestionAttributes = getQuestionAttributeValues($aFieldmap[$aFieldName]['qid']);
$aFilesInfo = json_decode_ls($mFieldValue);
for ($iFileIndex = 0; $iFileIndex < $aQuestionAttributes['max_num_of_files']; $iFileIndex++) {
if (isset($aFilesInfo[$iFileIndex])) {
$aSurveyEntry[] = htmlspecialchars($aFilesInfo[$iFileIndex]['title'], ENT_QUOTES, 'UTF-8');
$aSurveyEntry[] = htmlspecialchars($aFilesInfo[$iFileIndex]['comment'], ENT_QUOTES, 'UTF-8');
$aSurveyEntry[] = CHtml::link(rawurldecode($aFilesInfo[$iFileIndex]['name']), $this->getController()->createUrl("/admin/responses", array("sa" => "actionDownloadfile", "surveyid" => $surveyid, "iResponseId" => $row['id'], "sFileName" => $aFilesInfo[$iFileIndex]['name'])));
$aSurveyEntry[] = sprintf('%s Mb', round($aFilesInfo[$iFileIndex]['size'] / 1000, 2));
} else {
$aSurveyEntry[] = "";
$aSurveyEntry[] = "";
$aSurveyEntry[] = "";
$aSurveyEntry[] = "";
}
}
} else {
$aSurveyEntry[] = $sSurveyEntry;
}
}
$all_rows[] = array('id' => $row['id'], 'cell' => $aSurveyEntry);
}
$aSurveyEntries->rows = $all_rows;
viewHelper::disableHtmlLogging();
// It's better with but we need to fix error actually
header('Content-type: application/json');
echo json_encode($aSurveyEntries);
Yii::app()->end();
}
开发者ID:BertHankes,项目名称:LimeSurvey,代码行数:101,代码来源:responses.php
示例5: view
//.........这里部分代码省略.........
$fnames[] = array($field['fieldname'], $clang->gT("File count"));
}
}
$nfncount = count($fnames) - 1;
if ($iId < 1) {
$iId = 1;
}
$exist = SurveyDynamic::model($iSurveyID)->exist($iId);
$next = SurveyDynamic::model($iSurveyID)->next($iId, true);
$previous = SurveyDynamic::model($iSurveyID)->previous($iId, true);
$aData['exist'] = $exist;
$aData['next'] = $next;
$aData['previous'] = $previous;
$aData['id'] = $iId;
$aViewUrls[] = 'browseidheader_view';
if ($exist) {
$oPurifier = new CHtmlPurifier();
//SHOW INDIVIDUAL RECORD
$oCriteria = new CDbCriteria();
if ($aData['surveyinfo']['anonymized'] == 'N' && tableExists("{{tokens_{$iSurveyID}}}}") && Permission::model()->hasSurveyPermission($iSurveyID, 'tokens', 'read')) {
$oCriteria = SurveyDynamic::model($iSurveyID)->addTokenCriteria($oCriteria);
}
// If admin ask an specific response, then show it
// Don't add incompleteAnsFilterState
# if (incompleteAnsFilterState() == 'incomplete')
# $oCriteria->addCondition('submitdate = ' . mktime(0, 0, 0, 1, 1, 1980) . ' OR submitdate IS NULL');
# elseif (incompleteAnsFilterState() == 'complete')
# $oCriteria->addCondition('submitdate >= ' . mktime(0, 0, 0, 1, 1, 1980));
$oCriteria->addCondition("id = {$iId}");
$iIdresult = SurveyDynamic::model($iSurveyID)->findAllAsArray($oCriteria);
foreach ($iIdresult as $iIdrow) {
$iId = $iIdrow['id'];
$rlanguage = $iIdrow['startlanguage'];
}
$next = SurveyDynamic::model($iSurveyID)->next($iId);
$previous = SurveyDynamic::model($iSurveyID)->previous($iId);
if (isset($rlanguage)) {
$aData['rlanguage'] = $rlanguage;
}
foreach ($iIdresult as $iIdrow) {
$highlight = false;
for ($i = 0; $i < $nfncount + 1; $i++) {
if ($fnames[$i][0] != 'completed' && is_null($iIdrow[$fnames[$i][0]])) {
continue;
// irrelevant, so don't show
}
$inserthighlight = '';
if ($highlight) {
$inserthighlight = "class='highlight'";
}
if ($fnames[$i][0] == 'completed') {
if ($iIdrow['submitdate'] == NULL || $iIdrow['submitdate'] == "N") {
$answervalue = "N";
} else {
$answervalue = "Y";
}
} else {
if (isset($fnames[$i]['type']) && $fnames[$i]['type'] == "|") {
$index = $fnames[$i]['index'];
$metadata = $fnames[$i]['metadata'];
$phparray = json_decode_ls($iIdrow[$fnames[$i][0]]);
if (isset($phparray[$index])) {
if ($metadata === "size") {
$answervalue = rawurldecode((int) $phparray[$index][$metadata] . " KB");
} else {
if ($metadata === "name") {
$answervalue = CHtml::link($oPurifier->purify(rawurldecode($phparray[$index][$metadata])), $this->getController()->createUrl("/admin/responses/sa/browse/fieldname/{$fnames[$i][0]}/id/{$iId}/surveyid/{$iSurveyID}", array('downloadindividualfile' => $phparray[$index][$metadata])));
} else {
$answervalue = rawurldecode($phparray[$index][$metadata]);
}
}
} else {
$answervalue = "";
}
} else {
$answervalue = htmlspecialchars(strip_tags(stripJavaScript(getExtendedAnswer($iSurveyID, $fnames[$i][0], $iIdrow[$fnames[$i][0]], $oBrowseLanguage))), ENT_QUOTES);
}
}
$aData['answervalue'] = $answervalue;
$aData['inserthighlight'] = $inserthighlight;
$aData['fnames'] = $fnames;
$aData['i'] = $i;
$aViewUrls['browseidrow_view'][] = $aData;
}
}
} else {
Yii::app()->session['flashmessage'] = $clang->gT("This response ID is invalid.");
}
$aViewUrls[] = 'browseidfooter_view';
$this->_renderWrappedTemplate('', $aViewUrls, $aData);
} else {
$clang = $this->getController()->lang;
$aData['surveyid'] = $iSurveyID;
App()->getClientScript()->registerPackage('jquery-superfish');
$message['title'] = $clang->gT('Access denied!');
$message['message'] = $clang->gT('You do not have sufficient rights to access this page.');
$message['class'] = "error";
$this->_renderWrappedTemplate('survey', array("message" => $message), $aData);
}
}
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:101,代码来源:responses.php
示例6: getExtendedData
public function getExtendedData($colName, $sLanguage, $base64jsonFieldMap)
{
$oFieldMap = json_decode(base64_decode($base64jsonFieldMap));
$value = $this->{$colName};
$sFullValue = strip_tags(getExtendedAnswer(self::$sid, $oFieldMap->fieldname, $value, $sLanguage));
if (strlen($sFullValue) > 50) {
$sElipsizedValue = ellipsize($sFullValue, $this->ellipsize_question_value);
$sValue = '<span data-toggle="tooltip" data-placement="left" title="' . quoteText($sFullValue) . '">' . $sElipsizedValue . '</span>';
} else {
$sValue = $sFullValue;
}
// Upload question
if ($oFieldMap->type == '|' && strpos($oFieldMap->fieldname, 'filecount') === false) {
$sSurveyEntry = "<table class='table table-condensed upload-question'><tr>";
$aQuestionAttributes = getQuestionAttributeValues($oFieldMap->qid);
$aFilesInfo = json_decode_ls($this->{$colName});
for ($iFileIndex = 0; $iFileIndex < $aQuestionAttributes['max_num_of_files']; $iFileIndex++) {
$sSurveyEntry .= '<tr>';
if (isset($aFilesInfo[$iFileIndex])) {
$sSurveyEntry .= '<td>' . CHtml::link(rawurldecode($aFilesInfo[$iFileIndex]['name']), App()->createUrl("/admin/responses", array("sa" => "actionDownloadfile", "surveyid" => self::$sid, "iResponseId" => $this->id, "sFileName" => $aFilesInfo[$iFileIndex]['name']))) . '</td>';
$sSurveyEntry .= '<td>' . sprintf('%s Mb', round($aFilesInfo[$iFileIndex]['size'] / 1000, 2)) . '</td>';
if ($aQuestionAttributes['show_title']) {
if (!isset($aFilesInfo[$iFileIndex]['title'])) {
$aFilesInfo[$iFileIndex]['title'] = '';
}
$sSurveyEntry .= '<td>' . htmlspecialchars($aFilesInfo[$iFileIndex]['title'], ENT_QUOTES, 'UTF-8') . '</td>';
}
if ($aQuestionAttributes['show_comment']) {
if (!isset($aFilesInfo[$iFileIndex]['comment'])) {
$aFilesInfo[$iFileIndex]['comment'] = '';
}
$sSurveyEntry .= '<td>' . htmlspecialchars($aFilesInfo[$iFileIndex]['comment'], ENT_QUOTES, 'UTF-8') . '</td>';
}
}
$sSurveyEntry .= '</tr>';
}
$sSurveyEntry .= '</table>';
$sValue = $sSurveyEntry;
}
return $sValue;
}
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:41,代码来源:SurveyDynamic.php
示例7: view
//.........这里部分代码省略.........
$question .= '[' . $field['scale'] . ']';
}
$fnames[] = array($field['fieldname'], $question);
} else {
if ($field['aid'] !== 'filecount') {
$qidattributes = getQuestionAttributeValues($field['qid']);
for ($i = 0; $i < $qidattributes['max_num_of_files']; $i++) {
if ($qidattributes['show_title'] == 1) {
$fnames[] = array($field['fieldname'], "File " . ($i + 1) . " - " . $field['question'] . " (Title)", "type" => "|", "metadata" => "title", "index" => $i);
}
if ($qidattributes['show_comment'] == 1) {
$fnames[] = array($field['fieldname'], "File " . ($i + 1) . " - " . $field['question'] . " (Comment)", "type" => "|", "metadata" => "comment", "index" => $i);
}
$fnames[] = array($field['fieldname'], "File " . ($i + 1) . " - " . $field['question'] . " (File name)", "type" => "|", "metadata" => "name", "index" => $i);
$fnames[] = array($field['fieldname'], "File " . ($i + 1) . " - " . $field['question'] . " (File size)", "type" => "|", "metadata" => "size", "index" => $i);
//$fnames[] = array($field['fieldname'], "File ".($i+1)." - ".$field['question']." (extension)", "type"=>"|", "metadata"=>"ext", "index"=>$i);
}
} else {
$fnames[] = array($field['fieldname'], "File count");
}
}
}
$nfncount = count($fnames) - 1;
//SHOW INDIVIDUAL RECORD
$oCriteria = new CDbCriteria();
if ($aData['surveyinfo']['anonymized'] == 'N' && tableExists("{{tokens_{$iSurveyID}}}}")) {
$oCriteria = Survey_dynamic::model($iSurveyID)->addTokenCriteria($oCriteria);
}
if (incompleteAnsFilterState() == 'incomplete') {
$oCriteria->addCondition('submitdate = ' . mktime(0, 0, 0, 1, 1, 1980) . ' OR submitdate IS NULL');
} elseif (incompleteAnsFilterState() == 'complete') {
$oCriteria->addCondition('submitdate >= ' . mktime(0, 0, 0, 1, 1, 1980));
}
if ($iId < 1) {
$iId = 1;
}
$oCriteria->addCondition("id = {$iId}");
$iIdresult = Survey_dynamic::model($iSurveyID)->findAllAsArray($oCriteria) or die("Couldn't get entry");
foreach ($iIdresult as $iIdrow) {
$iId = $iIdrow['id'];
$rlanguage = $iIdrow['startlanguage'];
}
$next = $iId + 1;
$last = $iId - 1;
$aData['id'] = $iId;
if (isset($rlanguage)) {
$aData['rlanguage'] = $rlanguage;
}
$aData['next'] = $next;
$aData['last'] = $last;
$aViewUrls[] = 'browseidheader_view';
foreach ($iIdresult as $iIdrow) {
$highlight = false;
for ($i = 0; $i < $nfncount + 1; $i++) {
if ($fnames[$i][0] != 'completed' && is_null($iIdrow[$fnames[$i][0]])) {
continue;
// irrelevant, so don't show
}
$inserthighlight = '';
if ($highlight) {
$inserthighlight = "class='highlight'";
}
if ($fnames[$i][0] == 'completed') {
if ($iIdrow['submitdate'] == NULL || $iIdrow['submitdate'] == "N") {
$answervalue = "N";
} else {
$answervalue = "Y";
}
} else {
if (isset($fnames[$i]['type']) && $fnames[$i]['type'] == "|") {
$index = $fnames[$i]['index'];
$metadata = $fnames[$i]['metadata'];
$phparray = json_decode_ls($iIdrow[$fnames[$i][0]]);
if (isset($phparray[$index])) {
if ($metadata === "size") {
$answervalue = rawurldecode((int) $phparray[$index][$metadata] . " KB");
} else {
if ($metadata === "name") {
$answervalue = CHtml::link(rawurldecode($phparray[$index][$metadata]), $this->getController()->createUrl("/admin/responses/index/downloadindividualfile/{$phparray[$index][$metadata]}/fieldname/{$fnames[$i][0]}/id/{$iId}/surveyid/{$iSurveyID}"));
} else {
$answervalue = rawurldecode($phparray[$index][$metadata]);
}
}
} else {
$answervalue = "";
}
} else {
$answervalue = htmlspecialchars(strip_tags(stripJavaScript(getExtendedAnswer($iSurveyID, $fnames[$i][0], $iIdrow[$fnames[$i][0]], $oBrowseLanguage))), ENT_QUOTES);
}
}
$aData['answervalue'] = $answervalue;
$aData['inserthighlight'] = $inserthighlight;
$aData['fnames'] = $fnames;
$aData['i'] = $i;
$aViewUrls['browseidrow_view'][] = $aData;
}
}
$aViewUrls[] = 'browseidfooter_view';
$this->_renderWrappedTemplate('', $aViewUrls, $aData);
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:101,代码来源:responses.php
注:本文中的getExtendedAnswer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论