<?php

include "MyReport.php";
$report = new MyReport;
$report->run();

$type = isset($_GET['type']) ? $_GET['type'] : 'CSV';
if ($type === 'XLSX') {
    $report->exportToXLSX('ReportSpreadsheet')
    ->toBrowser("MyReport.xlsx");
} elseif ($type === 'ODS') {
    $report->exportToODS('ReportSpreadsheet')
    ->toBrowser("MyReport.ods");
} elseif ($type === 'CSV') {
    $report->exportToCSV('ReportSpreadsheet')
    ->toBrowser("MyReport.csv");
}
