<?php

require_once __DIR__ . '/../includes/auth.php';
require_once __DIR__ . '/../config/app.php';

if ($_SESSION['role'] != 'admin') {
    die("Access Denied");
}

include '../includes/header.php';
include '../includes/navbar.php';
?>

<div class="container-fluid mt-4">

    <div class="row mb-4">

        <div class="col-12">

            <div class="card shadow border-0">

                <div class="card-body">

                    <h2 class="mb-1">
                        <i class="fa-solid fa-user-shield"></i>
                        Admin Control Panel
                    </h2>

                    <p class="text-muted mb-0">
                        Manage users, schools, survey fields, reports and exports.
                    </p>

                </div>

            </div>

        </div>

    </div>

    <div class="row g-4">

        <div class="col-md-4">

            <div class="card shadow h-100">

                <div class="card-body text-center">

                    <i class="fa-solid fa-users fa-3x mb-3 text-primary"></i>

                    <h5>User Management</h5>

                    <p class="text-muted">
                        Add, edit and manage system users.
                    </p>

                    <a href="<?= BASE_URL ?>/admin/users.php"
                       class="btn btn-primary">
                        Open
                    </a>

                </div>

            </div>

        </div>

        <div class="col-md-4">

            <div class="card shadow h-100">

                <div class="card-body text-center">

                    <i class="fa-solid fa-school fa-3x mb-3 text-info"></i>

                    <h5>School Data</h5>

                    <p class="text-muted">
                        Import and manage school master data.
                    </p>

                    <a href="<?= BASE_URL ?>/admin/upload_school_data.php"
                       class="btn btn-info">
                        Open
                    </a>

                </div>

            </div>

        </div>

        <div class="col-md-4">

            <div class="card shadow h-100">

                <div class="card-body text-center">

                    <i class="fa-solid fa-table-list fa-3x mb-3 text-warning"></i>

                    <h5>Custom Fields</h5>

                    <p class="text-muted">
                        Create additional survey fields.
                    </p>

                    <a href="<?= BASE_URL ?>/admin/manage_equipment.php"
                       class="btn btn-warning">
                        Open
                    </a>

                </div>

            </div>

        </div>

        <div class="col-md-4">

            <div class="card shadow h-100">

                <div class="card-body text-center">

                    <i class="fa-solid fa-file-excel fa-5x text-success"></i>

                    <h5>Export Reports</h5>

                    <p class="text-muted">
                        Download survey records as Excel, generate PDF reports, or print survey reports.
                    </p>

                    <a href="<?= BASE_URL ?>/admin/export_options.php"
                       class="btn btn-success">
                        Open
                    </a>

                </div>

            </div>

        </div>


        <div class="col-md-4">

            <div class="card shadow h-100">

                <div class="card-body text-center">

                    <i class="fa-solid fa-chart-column fa-3x mb-3 text-danger"></i>

                    <h5>Survey Records</h5>

                    <p class="text-muted">
                        View and manage submitted surveys.
                    </p>

                    <a href="<?= BASE_URL ?>/survey/view_surveys.php"
                       class="btn btn-danger">
                        Open
                    </a>

                </div>

            </div>

        </div>

    </div>

</div>

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