Exemple #1
0
if ($admin_routine == 'download_reports' && $admin_action == 'ftp') {
    set_common_file_download_header('reports.sql');
    $pony_db->export_reports(false);
    die;
}
if ($admin_routine == 'download_nonparsed_reports' && $admin_action == 'ftp') {
    set_common_file_download_header('non_parsed_reports.sql');
    $pony_db->export_reports(true);
    die;
}
if ($admin_routine == 'download_log' && $admin_action == 'log') {
    if ($use_zip) {
        set_common_file_download_header('log.zip', 'application/zip');
        ob_start();
        $null_list = array();
        $pony_db->get_log_list($null_list, 0, 0, true);
        $log_list_data = ob_get_contents();
        ob_end_clean();
        create_zip_and_send('log.txt', $log_list_data);
    } else {
        set_common_file_download_header('log.txt');
        $null_list = array();
        $pony_db->get_log_list($null_list, 0, 0, true);
    }
    die;
}
if ($admin_routine == 'download_report' && $admin_action == 'reports') {
    $report_id = trim(assign($_REQUEST['report_id']));
    $report_item_result = $pony_db->get_report_item($report_id);
    if ($pony_db->state && is_array($report_item_result)) {
        set_common_file_download_header('report_' . strval(intval($report_id)) . '.bin', 'application/octet-stream');