<?php
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

$user = new User($_SESSION['uid']);
if (!$user->hasPermission("HACHEPORTAL_VIEW")) {
    header("Location: ../app.php?msg=no_permission");
    die();
}
?>

<div class="card">
    <div class="card-body">
        <h3 class="card-title">
            <i class="fas fa-cloud-download-alt"></i>
            <?php $Strings->get("Download Reports"); ?>
        </h3>

        <div class="row">
            <div class="col-12 col-md-4">
                <h4><?php $Strings->get("Member Directory"); ?></h4>
                <p><?php $Strings->get("A formatted and up-to-date HACHE member directory."); ?></p>
                <a class="btn btn-primary mb-1" href="./lib/mkmemberdirectory.php?format=odt">
                    <i class="far fa-file-alt"></i> <?php $Strings->get("Office (ODT)"); ?>
                </a>
                <br />
                <a class="btn btn-orange btn-sm mr-1" href="./lib/mkmemberdirectory.php?format=html">
                    <i class="fas fa-globe"></i> <?php $Strings->get("HTML"); ?>
                </a>
                <a class="btn btn-secondary btn-sm" href="./lib/mkmemberdirectory.php?format=docx">
                    <i class="fas fa-file-word"></i> <?php $Strings->get("DOCX"); ?>
                </a>
            </div>

            <div class="col-12 col-md-4">
                <h4><?php $Strings->get("Family List"); ?></h4>
                <p><?php $Strings->get("All the data from the member directory in a spreadsheet."); ?></p>
                <a class="btn btn-success mb-1" href="./lib/reports.php?type=members&format=ods">
                    <i class="fas fa-table"></i> <?php $Strings->get("Spreadsheet (ODS)"); ?>
                </a>
                <br />
                <a class="btn btn-orange btn-sm mr-1" href="./lib/reports.php?type=members&format=html">
                    <i class="fas fa-globe"></i> <?php $Strings->get("HTML"); ?>
                </a>
                <a class="btn btn-secondary btn-sm" href="./lib/reports.php?type=members&format=csv">
                    <i class="fas fa-file-csv"></i> <?php $Strings->get("CSV"); ?>
                </a>
            </div>

            <div class="col-12 col-md-4">
                <h4><?php $Strings->get("Expiring Memberships"); ?></h4>
                <p><?php $Strings->get("All members expired or expiring within a month."); ?></p>
                <a class="btn btn-success mb-1" href="./lib/reports.php?type=expiring&format=ods">
                    <i class="fas fa-table"></i> <?php $Strings->get("Spreadsheet (ODS)"); ?>
                </a>
                <br />
                <a class="btn btn-orange btn-sm mr-1" href="./lib/reports.php?type=expiring&format=html">
                    <i class="fas fa-globe"></i> <?php $Strings->get("HTML"); ?>
                </a>
                <a class="btn btn-secondary btn-sm" href="./lib/reports.php?type=expiring&format=csv">
                    <i class="fas fa-file-csv"></i> <?php $Strings->get("CSV"); ?>
                </a>
            </div>
        </div>
    </div>
</div>