if(!empty($_POST['sid'])) $sid = intval($_POST['sid']); elseif(!empty($_GET['sid'])) $sid = intval($_GET['sid']); else $sid = ''; $bg = ''; ?>

" . _('Go back to Management Interface') . "\n"); ?> MoveNext(); $stat = _('Editing'); if($status & STATUS_DELETED) { $stat = _('Archived'); } elseif($status & STATUS_DONE) { $stat = _('Ended'); } elseif($status & STATUS_ACTIVE) { $stat = _('Active'); } elseif($status & STATUS_TEST) { $stat = _('Testing'); } if($bg != $ESPCONFIG['bgalt_color1']) $bg = $ESPCONFIG['bgalt_color1']; else $bg = $ESPCONFIG['bgalt_color2']; ?>
' . _('Save On Server') . ''); echo("\n");?> | ' . _('Download') . ''); ?>
" . _('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"); ?>