📄 dlresults.php
字号:
<?php
$GLOBALS['inAdmin'] = 1;
require( "../inc/init.php" );
require( "../inc/mysql.php" );
require( "../inc/functions.php" );
require( "../inc/efunctions.php" );
isadmin( 1 );
setlanguage( "", "ADMIN" );
$error = false;
$type = $HTTP_GET_VARS['tp'] == "pex" || $HTTP_GET_VARS['tp'] == "csv" || $HTTP_GET_VARS['tp'] == "xml" || $HTTP_GET_VARS['tp'] == "sql" || $HTTP_GET_VARS['tp'] == "xml-c" || $HTTP_GET_VARS['tp'] == "phpQ" || $HTTP_GET_VARS['tp'] == "phpQS" ? $HTTP_GET_VARS['tp'] : "csv";
if ( $HTTP_GET_VARS['sid'] && $HTTP_GET_VARS['st'] )
{
$stattype = $HTTP_GET_VARS['st'] == "u" || $HTTP_GET_VARS['st'] == "v" ? $HTTP_GET_VARS['st'] : "a";
$mqsurvey = mysql_query( "select SID from phpQSurvey where SID = \"".protectmysql( $HTTP_GET_VARS['sid'] )."\"" );
if ( $masurvey = mysql_fetch_array( $mqsurvey ) )
{
$error = false;
}
else
{
$error = true;
}
}
else if ( $type != "phpQ" )
{
$error = true;
}
if ( !$error )
{
set_time_limit( 1200 );
header( "Pragma: no-cache" );
switch ( $type )
{
case "phpQS" :
case "phpQ" :
$swap = $type == "phpQS" ? 1 : 0;
$num = is_numeric( $HTTP_GET_VARS['sid'] ) && $HTTP_GET_VARS['sid'] ? "_".$HTTP_GET_VARS['sid'] : "";
$num .= "_".strftime( $phpQlang['PHPDateFormat'] );
$filename = $type == "phpQS" ? "surveyswap" : "backup";
header( "Content-Type: text/phpQ" );
header( "Content-Disposition: attachment; filename={$filename}{$num}.phpQ" );
backupalldata( $HTTP_GET_VARS['sid'], $swap );
break;
case "pex" :
$contents = grabstats( $HTTP_GET_VARS['sid'], $stattype, $type );
header( "Content-Type: application/vnd.ms-excel" );
header( "Content-Length: ".strlen( $contents ) );
echo $contents;
break;
case "xml" :
case "xml-c" :
case "sql" :
$ext = $type == "xml-c" ? "xml" : $type;
header( "Content-Type: text/{$ext}" );
header( "Content-Disposition: attachment; filename=results_".$HTTP_GET_VARS['sid'].".{$ext}" );
formatsurveydata( $HTTP_GET_VARS['sid'], $stattype, $type );
break;
case "csv" :
default :
header( "Content-Type: text/csv" );
header( "Content-Disposition: attachment; filename=results_".$HTTP_GET_VARS['sid'].".csv" );
formatsurveydata( $HTTP_GET_VARS['sid'], $stattype, "csv" );
break;
}
exit( );
}
else
{
header( "HTTP/1.0 204 No Response" );
exit( );
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -