// }}}
// {{{ function handler_result() : show the results of the votes to a survey
- function handler_result($page, $id = -1, $qid = 'all')
+ function handler_result($page, $id = -1, $show = 'all')
{
$id = intval($id);
if ($id == -1) {
if (!$this->check_surveyPerms($page, $survey)) {
return;
}
- $page->assign('survey_resultmode', true);
- $this->show_survey($page, $survey);
+ if ($show == 'csv') {
+ header('Content-Type: text/csv; charset="UTF-8"');
+ echo $survey->toCSV();
+ exit;
+ } else {
+ $page->assign('survey_resultmode', true);
+ $this->show_survey($page, $survey);
+ }
}
// }}}
$page->assign('survey_old', Survey::retrieveList('o'));
$page->assign('survey_modes', Survey::getModes(false));
} else {
+ $id = intval($id);
$survey = Survey::retrieveSurvey($id); // retrieves all survey object structure
if ($survey == null) {
$this->show_error($page, "Sondage ".$id." introuvable.", 'admin');
if ($id == -1) {
return $this->show_error($page, "Un identifiant de sondage doit être précisé.", 'admin');
}
+ $id = intval($id);
require_once dirname(__FILE__).'/survey/survey.inc.php';
$survey = Survey::retrieveSurvey($id); // retrieves the survey in database
$this->clear_session(); // cleans session (in case there would have been a problem before)
if ($id == -1) {
return $this->show_error($page, "Un identifiant de sondage doit être précisé.", 'admin');
}
+ $id = intval($id);
require_once dirname(__FILE__).'/survey/survey.inc.php';
$surveyInfo = Survey::retrieveSurveyInfo($id); // retrieves information about the survey (does not retrieve and unserialize the object structure)
if ($surveyInfo == null) {
if ($id == -1) {
return $this->show_error($page, "Un identifiant de sondage doit être précisé.", 'admin');
}
+ $id = intval($id);
require_once dirname(__FILE__).'/survey/survey.inc.php';
$surveyInfo = Survey::retrieveSurveyInfo($id); // retrieves information about the survey (does not retrieve and unserialize the object structure)
if ($surveyInfo == null) {