<?php

$pageTitle = "Reports Dashboard";

require_once '../includes/auth.php';

require_login();

$user = current_user();

/*
|--------------------------------------------------------------------------
| SUMMARY COUNTS
|--------------------------------------------------------------------------
*/

$totalCorpsMembers = $db->query("

SELECT COUNT(*)

FROM corps_members

")->fetchColumn();

$totalPlatoons = $db->query("

SELECT COUNT(*)

FROM platoons

")->fetchColumn();

$totalHostels = $db->query("

SELECT COUNT(*)

FROM hostels

")->fetchColumn();

$totalCDSGroups = $db->query("

SELECT COUNT(*)

FROM cds_groups

")->fetchColumn();

$totalActivities = $db->query("

SELECT COUNT(*)

FROM camp_activities

")->fetchColumn();

$totalClearance = $db->query("

SELECT COUNT(*)

FROM monthly_clearance

")->fetchColumn();

require_once '../includes/header.php';

require_once '../includes/sidebar.php';

?>

<main class="dashboard-main">

    <?php require_once '../includes/topbar.php'; ?>

    <div class="dashboard-main-body">

        <div class="breadcrumb d-flex flex-wrap align-items-center justify-content-between gap-3 mb-24">

            <div>

                <h6 class="fw-semibold mb-0">

                    <?= $pageTitle ?>

                </h6>

                <p class="text-neutral-500">

                    <?= APP_SHORT_NAME ?>

                    >

                    Reports

                    >

                    Dashboard

                </p>

            </div>

        </div>

        <div class="row gy-4">

            <div class="col-xxl-4 col-lg-6">

                <div class="card h-100">

                    <div class="card-body">

                        <h5>

                            Corps Members Report

                        </h5>

                        <p>

                            Total Corps Members

                        </p>

                        <h2>

                            <?= $totalCorpsMembers ?>

                        </h2>

                        <a href="report-corps-members.php" class="btn btn-primary-600 mt-3">

                            Open Report

                        </a>

                    </div>

                </div>

            </div>

            <div class="col-xxl-4 col-lg-6">

                <div class="card h-100">

                    <div class="card-body">

                        <h5>

                            Platoons Report

                        </h5>

                        <p>

                            Total Platoons

                        </p>

                        <h2>

                            <?= $totalPlatoons ?>

                        </h2>

                        <a href="report-platoons.php" class="btn btn-primary-600 mt-3">

                            Open Report

                        </a>

                    </div>

                </div>

            </div>

            <div class="col-xxl-4 col-lg-6">

                <div class="card h-100">

                    <div class="card-body">

                        <h5>

                            Hostels Report

                        </h5>

                        <p>

                            Total Hostels

                        </p>

                        <h2>

                            <?= $totalHostels ?>

                        </h2>

                        <a href="report-hostels.php" class="btn btn-primary-600 mt-3">

                            Open Report

                        </a>

                    </div>

                </div>

            </div>

            <div class="col-xxl-4 col-lg-6">

                <div class="card h-100">

                    <div class="card-body">

                        <h5>

                            CDS Groups Report

                        </h5>

                        <p>

                            Total CDS Groups

                        </p>

                        <h2>

                            <?= $totalCDSGroups ?>

                        </h2>

                        <a href="report-cds-groups.php" class="btn btn-primary-600 mt-3">

                            Open Report

                        </a>

                    </div>

                </div>

            </div>

            <div class="col-xxl-4 col-lg-6">

                <div class="card h-100">

                    <div class="card-body">

                        <h5>

                            Camp Activities Report

                        </h5>

                        <p>

                            Total Camp Activities

                        </p>

                        <h2>

                            <?= $totalActivities ?>

                        </h2>

                        <a href="report-camp-activities.php" class="btn btn-primary-600 mt-3">

                            Open Report

                        </a>

                    </div>

                </div>

            </div>

            <div class="col-xxl-4 col-lg-6">

                <div class="card h-100">

                    <div class="card-body">

                        <h5>

                            Monthly Clearance Report

                        </h5>

                        <p>

                            Total Clearances

                        </p>

                        <h2>

                            <?= $totalClearance ?>

                        </h2>

                        <a href="report-monthly-clearance.php" class="btn btn-primary-600 mt-3">

                            Open Report

                        </a>

                    </div>

                </div>

            </div>

        </div>

    </div>

    <?php require_once '../includes/footer.php'; ?>