<?php

    if($_SESSION['user'] && $_SESSION['user']['connected']){

            ?>
  <!-- Bootstrap 5 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>



<div class="container-fluid">

    <div class="row">
<!-- TOP NAVBAR (MOBILE) -->
<nav class="navbar navbar-dark bg-dark d-md-none">
    <div class="container-fluid">
        <button class="btn btn-outline-light" data-bs-toggle="offcanvas" data-bs-target="#mobileMenu">
            ☰
        </button>
        <span class="navbar-brand mb-0 h6">Property Manager</span>
    </div>
</nav>

<!-- MOBILE OFFCANVAS MENU -->
<div class="offcanvas offcanvas-start bg-dark text-white" id="mobileMenu">
    <div class="offcanvas-header">
        <h5 class="offcanvas-title">Property Manager</h5>
        <button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvas"></button>
    </div>

    <div class="offcanvas-body p-0">
        <ul class="nav nav-pills flex-column p-3 gap-2">
            <li class="nav-item">
                <a href="index.php?p=propertymanager_dashboard" class="nav-link text-white">
                    📊 Dashboard
                </a>
            </li>
            <li class="nav-item">
                <a href="index.php?p=propertymanager_properties_list_my" class="nav-link text-white">
                    🏢 Manage Properties
                </a>
            </li>
            <li class="nav-item">
                <a href="#" class="nav-link text-white disabled">👤 Guests</a>
            </li>
            <li class="nav-item">
                <a href="#" class="nav-link text-white disabled">💳 Payments</a>
            </li>
            <li class="nav-item">
                <a href="#" class="nav-link text-white disabled">🛠️ Maintenance</a>
            </li>
        </ul>
    </div>
</div>

<div class="container-fluid">
    <div class="row">

        <!-- DESKTOP SIDEBAR -->
        <div class="col-md-3 col-lg-2 bg-dark text-white min-vh-100 p-3 d-none d-md-block">
            <h5 class="fw-bold mb-4">Property Manager</h5>

            <ul class="nav nav-pills flex-column gap-2">
                <li class="nav-item">
                    <a href="index.php?p=propertymanager_dashboard" class="nav-link text-white">
                        📊 Dashboard
                    </a>
                </li>
                <li class="nav-item">
                    <a href="index.php?p=propertymanager_properties_list_my" class="nav-link text-white">
                        🏢 Manage Properties
                    </a>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link text-white disabled">👤 Guests</a>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link text-white disabled">💳 Payments</a>
                </li>
                <li class="nav-item">
                    <a href="#" class="nav-link text-white disabled">🛠️ Maintenance</a>
                </li>
            </ul>
        </div>

        <!-- MAIN CONTENT -->
        <div class="col-md-9 col-lg-10 p-4">
            
        <?php if($_SESSION['propertymanager']['bopage'] == 'dashboard'){ ?>
            <h2 class="fw-bold mb-4">Dashboard</h2>

    
            <!-- STATS -->
            <div class="row g-4 mb-4">

                <div class="col-md-3">
                    <div class="card shadow-sm border-0">
                        <div class="card-body text-center">
                            <h6 class="text-muted">Properties</h6>
                            <h3 class="fw-bold">—</h3>
                        </div>
                    </div>
                </div>

                <div class="col-md-3">
                    <div class="card shadow-sm border-0">
                        <div class="card-body text-center">
                            <h6 class="text-muted">Apartments</h6>
                            <h3 class="fw-bold">—</h3>
                        </div>
                    </div>
                </div>

                <div class="col-md-3">
                    <div class="card shadow-sm border-0">
                        <div class="card-body text-center">
                            <h6 class="text-muted">Occupied</h6>
                            <h3 class="fw-bold">—</h3>
                        </div>
                    </div>
                </div>

                <div class="col-md-3">
                    <div class="card shadow-sm border-0">
                        <div class="card-body text-center">
                            <h6 class="text-muted">Available</h6>
                            <h3 class="fw-bold">—</h3>
                        </div>
                    </div>
                </div>

            </div>

            <!-- QUICK ACTIONS -->
            <div class="card shadow-sm border-0">
                <div class="card-body">
                    <h5 class="fw-semibold mb-3">Quick Actions</h5>

                    <a href="index.php?p=propertymanager_properties_list_my" class="btn btn-primary me-2 mb-2">
                        Manage Properties
                    </a>

                    <button class="btn btn-outline-secondary me-2 mb-2" disabled>
                        Add Guest
                    </button>

                    <button class="btn btn-outline-secondary me-2 mb-2" disabled>
                        Record Payment
                    </button>

                </div>
            </div>
<?php

}else{
    if(!empty($_SESSION['propertymanager']['bopage'])){
   $page_to_include =  $_SESSION['propertymanager']['bopage'].'inc.php';
    require_once  $page_to_include;
    }
 
    } 
?>
        

    </div>
</div>
<?php
    }
    ?>
   


