<?php
include 'includes/auth.php';
include 'db.php';
$dashboard_title = 'Accounts Dashboard';
$dashboard_icon  = 'fa-money-bill-wave';
$module_cards = [

    
       
            ['link'=>'customer_statements.php', 'icon'=>'fa-history', 'title'=>'Guest History', 'color'=>'bg-warning'],
    ['link'=>'customer_statements.php', 'icon'=>'fa-file-invoice', 'title'=>'Guest Statements', 'color'=>'bg-success']
,
    ['link'=>'payments.php', 'icon'=>'fa-credit-card', 'title'=>'Payments', 'color'=>'bg-success'],
    ['link'=>'customer_statements.php', 'icon'=>'fa-file-invoice', 'title'=>'Guest Statements', 'color'=>'bg-primary'],
    ['link'=>'invoices.php', 'icon'=>'fa-file-invoice', 'title'=>'Invoices', 'color'=>'bg-primary'],
    ['link'=>'reconciliation.php', 'icon'=>'fa-file-invoice', 'title'=>'Reconciliation', 'color'=>'bg-primary'],
    ['link'=>'all_sales.php', 'icon'=>'fa-file-invoice', 'title'=>'Sales', 'color'=>'bg-primary'],
    ['link'=>'customer_bills.php', 'icon'=>'fa-file-invoice', 'title'=>'Bills', 'color'=>'bg-primary'],
    ['link'=>'walk_in_meals.php', 'icon'=>'fa-file-invoice', 'title'=>'Produce Walkin Meals', 'color'=>'bg-primary'],
    ['link'=>'kitchen_reports.php', 'icon'=>'fa-utensils', 'title'=>'Walkin Production Plans', 'color'=>'bg-danger'],
    ['link'=>'vew_production_plan.php', 'icon'=>'fa-file-invoice', 'title'=>'Conference Production Plans', 'color'=>'bg-danger'],
    ['link'=>'debtors_creditors.php', 'icon'=>'fa-file-invoice', 'title'=>'Debtors', 'color'=>'bg-primary'],
    ['link'=>'manager_reports.php', 'icon'=>'fa-chart-pie', 'title'=>'Reports', 'color'=>'bg-dark'],

    // ✅ New Petty Cash Module
    ['link'=>'petty_cash.php', 'icon'=>'fa-wallet', 'title'=>'Petty Cash', 'color'=>'bg-warning'],
];
// Include header
include 'includes/header.php';
?>

<style>
/* ================= STYLING CARDS ================= */
.card-module {
    width: 140px;
    text-align: center;
    display: inline-block;
    border-radius: 10px;
    transition: 0.2s;
    cursor: pointer;
}

.card-module:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.card-module a {
    text-decoration: none;
    color: inherit;
}

.icon-box {
    font-size: 28px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 10px auto;
    color: #fff;
}

.welcome-msg {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #1b4d32;
}

.flex-center {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}
</style>

<div class="container-fluid mt-4"><!-- ================= WELCOME MESSAGE ================= -->
    <div class="welcome-msg">
        <i class="fa fa-user-circle"></i> Welcome, <strong><?= htmlspecialchars($_SESSION['username'] ?? 'Guest') ?></strong>!
    </div>

    <h3 class="mb-3">
        <i class="fa <?= $dashboard_icon ?> text-success"></i> <?= $dashboard_title ?>
    </h3>
    <hr>

    <!-- ================= MODULE CARDS ================= -->
    <div class="flex-center">
        <?php foreach($module_cards as $card): ?>
            <div class="card card-module shadow-sm">
                <a href="<?= $card['link'] ?>">
                    <div class="card-body p-2">
                        <div class="icon-box <?= $card['color'] ?>">
                            <i class="fa <?= $card['icon'] ?>"></i>
                        </div>
                        <h6><?= $card['title'] ?></h6>
                    </div>
                </a>
            </div>
        <?php endforeach; ?>
    </div>
<div class="tips-box" align="center">
  <h4>💡Tips</h4>
  <ul>
    <li>✅ <strong>Confirm First:</strong> Click Invoice to Receive Payment  using the button below the invoice.</li>

  </ul>
</div>
</div>

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