<?php
require_once __DIR__ . '/../config.php';
requireRole(['admin', 'manager']);

$pageTitle = 'Reports';
include __DIR__ . '/../includes/admin-header.php';
?>

        <div class="row g-4 mb-4">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header"><h5 class="mb-0">Generate Reports</h5></div>
                    <div class="card-body">
                        <div class="row g-3">
                            <div class="col-md-3">
                                <div class="card bg-light">
                                    <div class="card-body text-center">
                                        <i class="bi bi-box-seam fs-1 text-primary"></i>
                                        <h6 class="mt-2">Inventory Report</h6>
                                        <p class="text-muted small">Current stock levels and values</p>
                                        <a href="../api/reports.php?report=inventory&format=csv" class="btn btn-sm btn-primary">Export CSV</a>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="card bg-light">
                                    <div class="card-body text-center">
                                        <i class="bi bi-cart fs-1 text-success"></i>
                                        <h6 class="mt-2">Procurement Report</h6>
                                        <p class="text-muted small">Purchase orders and GRV</p>
                                        <a href="../api/reports.php?report=procurement&format=csv" class="btn btn-sm btn-success">Export CSV</a>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="card bg-light">
                                    <div class="card-body text-center">
                                        <i class="bi bi-truck fs-1 text-info"></i>
                                        <h6 class="mt-2">Supplier Report</h6>
                                        <p class="text-muted small">Supplier performance metrics</p>
                                        <a href="../api/reports.php?report=suppliers&format=csv" class="btn btn-sm btn-info">Export CSV</a>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="card bg-light">
                                    <div class="card-body text-center">
                                        <i class="bi bi-arrow-left-right fs-1 text-warning"></i>
                                        <h6 class="mt-2">Transactions Report</h6>
                                        <p class="text-muted small">Inventory transactions history</p>
                                        <a href="../api/reports.php?report=transactions&format=csv" class="btn btn-sm btn-warning">Export CSV</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

<?php include __DIR__ . '/../includes/admin-footer.php'; ?>