Skip to content

Commit

Permalink
Fixed merge error
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_dev@10151 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
mennodekker committed May 31, 2011
1 parent 9c1a07e commit 9059052
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions admin/exportresults.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,79 +243,6 @@
return;
}

<<<<<<< .working
=======




// ======================================================================
// Actual export routines start here !
// ======================================================================

$tokenTableExists=tableExists('tokens_'.$surveyid);
$aTokenFieldNames=array();

if ($tokenTableExists)
{
$aTokenFieldNames=GetTokenFieldsAndNames($surveyid);
$attributeFieldAndNames=GetTokenFieldsAndNames($surveyid,true);
$attributeFields=array_keys($attributeFieldAndNames);
}

switch ( $_POST["type"] ) {
case "doc":
header("Content-Disposition: attachment; filename=results-survey".$surveyid.".doc");
header("Content-type: application/vnd.ms-word");
$separator="\t";
break;
case "xls":
header("Content-Disposition: attachment; filename=results-survey".$surveyid.".xls");
header("Content-type: application/vnd.ms-excel");
$workbook = new PHPExcel();
// Creating the first worksheet

$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id=".$surveyid;
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
$row = $result->FetchRow();

$sheet = $workbook->getActiveSheet();
$row['surveyls_title']=str_replace(array('*', ':', '/', '\\', '?', '[', ']'),array(' '),$row['surveyls_title']); // Remove invalid characters
$sheet->setTitle(substr($row['surveyls_title'],0,31));
$separator="~|";
break;
case "csv":
header("Content-Disposition: attachment; filename=results-survey".$surveyid.".csv");
header("Content-type: text/comma-separated-values; charset=UTF-8");
$separator=",";
break;
case "pdf":
$pdf = new PDF($pdforientation,'mm','A4');
$pdf->SetFont($pdfdefaultfont,'',$pdffontsize);
$pdf->AddPage();
$pdf->intopdf("PDF Export ".date("Y.m.d-H:i",time()));
$query="SELECT * FROM {$dbprefix}surveys_languagesettings WHERE surveyls_survey_id=".$surveyid;
$result=db_execute_assoc($query) or safe_die("Couldn't get privacy data<br />$query<br />".$connect->ErrorMsg());
while ($row = $result->FetchRow())
{
$pdf->intopdf($clang->gT("General information in language: ").getLanguageNameFromCode($row['surveyls_language']),'B');
$pdf->ln();
$pdf->titleintopdf($row['surveyls_title'],$row['surveyls_description']);
$surveyname=$row['surveyls_title'];
}
$pdf->AddPage();
$separator="\t";
break;
default:
header("Content-Disposition: attachment; filename=results-survey".$surveyid.".csv");
header("Content-type: text/comma-separated-values; charset=UTF-8");
$separator=",";
break;
}
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");

>>>>>>> .merge-right.r10071
// Export Language is set by default to surveybaselang
// * the explang language code is used in SQL queries
// * the alang object is used to translate headers and hardcoded answers
Expand Down

0 comments on commit 9059052

Please sign in to comment.