header('HTTP/1.1 200 OK');
        header('Cache-Control: no-cache, must-revalidate');
        header("Pragma: no-cache");
        header("Expires: 0");
        header("Content-type: text/csv");
        header("Content-Disposition: attachment; filename=holiday.csv");
        readfile($target_file);
        exit;
    }
    die;
}
// end download section
// Handle uploads.
if (!empty($_POST['bn_upload'])) {
    //Upload and save the csv
    $saved = $holidays_controller->upload_csv($_FILES);
    if ($saved) {
        $csv_file_data = $holidays_controller->get_file_csv_data();
    }
}
if (!empty($_POST['import_holidays'])) {
    //Import from the csv file to the calendar external table
    $saved = $holidays_controller->import_holidays_from_csv();
}
if (!empty($_POST['sync'])) {
    //Upload and save the csv
    $saved = $holidays_controller->create_holiday_event();
}
?>

<html>