" . _('Go back to Management Interface') . "\n"); ?>
". _('Testing Survey...') ." (". _('SID') ." = $sid)\n");
} else {
/* check ACL to see if user is allowed to export
* _this_ survey */
if($_SESSION['acl']['superuser'] != 'Y' &&
!auth_is_owner($sid, $_SESSION['acl']['username']) &&
!in_array($srealm, array_intersect(
$_SESSION['acl']['pdata'],
$_SESSION['acl']['pall'])) &&
!auth_no_access(_('to access this survey'))) {
return;
}
}
$type = isset($_GET['type']) ? $_GET['type'] : 'csv_full_header';
// prepare file name, default to csv_full_headers
switch ($type) {
case 'tab':
$file = $_SESSION['acl']['home'] . "/$name.txt";
break;
case 'xml':
//Not implemented yet
break;
case 'spss_csv':
$file = $_SESSION['acl']['home'] . "/$name.csv";
break;
case 'dbf':
$file = $_SESSION['acl']['home'] . "/$name.dbf";
if(extension_loaded('dbase')) {
$ret = survey_export_dbf($sid, $file);
} else {
$ret = 0;
echo("
| " . mkerror(_('The PHP dBase Extension is not installed.')) . " |
");
}
break;
default: //csv_full_header,csv_short_header
$file = $_SESSION['acl']['home'] . "/$name.csv";
}
$ret = survey_export_results($type, $sid, $file);
echo("
| ");
if(isset($_GET['test'])) {
echo(" ". _('Testing Survey...') ." (". _('SID') ." = $sid) \n");
}
if($ret) {
echo(_('Survey exported as:') . " $file");
} else {
echo(mkwarn(_('Error exporting survey as:') . " $file"));
}
echo(" |
\n");
echo("
" . _('Go back to Management Interface') . "\n");
?>