Skip to content
Snippets Groups Projects
export.php 877 B
Newer Older
Giovannoni Laurent's avatar
Giovannoni Laurent committed
<?php
if ($_REQUEST['origin'] != 'graph') {
Alex ORLUC's avatar
Alex ORLUC committed
    require_once('core/class/ExportControler.php');
    $export = new ExportControler();
}
Giovannoni Laurent's avatar
Giovannoni Laurent committed
if (!empty($_SESSION['error'])) {
Giovannoni Laurent's avatar
Giovannoni Laurent committed
    <script language="javascript" >
        window.opener.location.reload();
        window.close();
    </script>
Giovannoni Laurent's avatar
Giovannoni Laurent committed
    <?php
} else {
    header('Pragma: public');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    //header('Cache-Control: public');
    //header('Content-Description: File Transfer');
    header('Content-Type: application/vnd.ms-excel');
    header('Content-Disposition: inline; filename=export_maarch.csv;');
    //header('Content-Transfer-Encoding: binary');
    readfile($_SESSION['config']['tmppath'] . $_SESSION['export']['filename']);
    unlink($_SESSION['config']['tmppath'] . $_SESSION['export']['filename']);
    exit;
}