exit;
}
if (isset($_GET["report-tab"])) {
    report_tab();
    exit;
}
if (isset($_GET["report-popup"])) {
    report_popup();
    exit;
}
if (isset($_GET["report-options"])) {
    report_options();
    exit;
}
if (isset($_POST["report"])) {
    report_save();
    exit;
}
if (isset($_POST["run"])) {
    report_run();
    exit;
}
if (isset($_POST["csv"])) {
    save_options_save();
    exit;
}
if (isset($_GET["csv"])) {
    csv_download();
    exit;
}
if (isset($_POST["certificate_center"])) {
function common_report_save()
{
    checkPerm('mod');
    $ref =& $_SESSION['report_tempdata'];
    $report_id = $ref['id_report'];
    $report_name = $ref['report_name'];
    $nosave = Get::req('nosave', DOTY_INT, 0);
    $show = Get::req('show', DOTY_INT, 0);
    $idrep = Get::req('modid', DOTY_INT, false);
    if ($nosave > 0) {
        Util::jump_to('index.php?modname=public_report_admin&op=view_report&nosave=1' . ($idrep ? '&modid=' . $idrep : ''));
    }
    if (isset($_SESSION['report_update']) || $idrep) {
        $save_ok = report_update($idrep, $report_name, $ref, true);
        if ($show) {
            Util::jump_to('index.php?modname=public_report_admin&op=view_report&idrep=' . $idrep);
        } else {
            Util::jump_to('index.php?modname=public_report_admin&op=reportlist&modrep=' . ($save_ok ? 'true' : 'false'));
        }
    } else {
        $save_ok = report_save($report_id, $report_name, $ref, true);
        if ($show) {
            Util::jump_to('index.php?modname=public_report_admin&op=view_report&idrep=' . $save_ok);
        } else {
            Util::jump_to('index.php?modname=public_report_admin&op=reportlist&saverep=' . ($save_ok ? 'true' : 'false'));
        }
    }
}