PK

ADDRLIN : C:/Inetpub/vhosts/dharmayatra.co.in/httpdocs/admin/packages/
FLL :
Current File : C:/Inetpub/vhosts/dharmayatra.co.in/httpdocs/admin/packages/index.php

<?php
include('../includes/auth.php');
include('../../includes/db.php');
include('../includes/header.php');
include('../includes/sidebar.php');


?>

<div class="container-fluid">
    <div class="row">
        <!-- <div class="col-md-2 bg-dark min-vh-100">
                <h4 class="text-white p-3">Admin Panel</h4>
                <a href="dashboard.php" class="text-white d-block p-2">Dashboard</a>
                <a href="add_package.php" class="text-white d-block p-2">Add Package</a>
                <a href="manage_packages.php" class="text-white d-block p-2">Manage Packages</a>
                <a href="bookings.php" class="text-white d-block p-2 bg-primary">Bookings</a>
                <a href="logout.php" class="text-white d-block p-2">Logout</a>
            </div> -->
        <div class="col-12 p-4">

<div class="container mt-4">
    <div class="row g-3">

        <div class="col-md-3">
            <a href="add_package.php" class="btn btn-primary w-100 py-3 d-flex align-items-center justify-content-center gap-2">
                <i class="fas fa-plus"></i> Add Package
            </a>
        </div>

        <div class="col-md-3">
            <a href="manage_packages.php" class="btn btn-success w-100 py-3 d-flex align-items-center justify-content-center gap-2">
                <i class="fas fa-list"></i> Manage Packages
            </a>
        </div>

        <div class="col-md-3">
            <a href="addons.php" class="btn btn-dark w-100 py-3 d-flex align-items-center justify-content-center gap-2">
                <i class="fas fa-calendar-check"></i> Add-on Packages
            </a>
        </div>

        <div class="col-md-3">
            <a href="categories.php" class="btn btn-warning w-100 py-3 d-flex align-items-center justify-content-center gap-2">
                <i class="fas fa-tags"></i> Categories
            </a>
        </div>

    </div>
</div>

            <h2>All Bookings</h2>
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Package</th>
                        <th>Customer Name</th>
                        <!-- <th>Phone</th> -->
                        <th>Start Date</th>
                        <th>Total Price</th>
                        <th>Status</th>
                        <th>Date</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $bookings = $conn->query("SELECT * FROM bookings ORDER BY created_at DESC");
                    while ($booking = $bookings->fetch_assoc()):
                    ?>
                        <tr>
    <td><?php echo $booking['id']; ?></td>
    <td><?php echo $booking['package_title']; ?></td>
    <td><?php echo $booking['customer_name']; ?></td>
    <!-- <td><//?php echo $booking['customer_phone']; ?></td> -->
    <td><?php echo $booking['start_date']; ?></td>

    <td>
        ₹ <?php echo number_format($booking['total_price']); ?>

        <?php
        $addons = $conn->query("SELECT * FROM booking_addons WHERE booking_id = ".$booking['id']);
        if($addons->num_rows > 0):
        ?>
            <div style="font-size: 12px; margin-top:5px;">
                <strong>Add-ons:</strong><br>
                <?php while($a = $addons->fetch_assoc()): ?>
                    • <?php echo $a['addon_name']; ?> (₹<?php echo number_format($a['price']); ?>)<br>
                <?php endwhile; ?>
            </div>
        <?php endif; ?>
    </td>

    <td>
        <span class="badge bg-<?php echo $booking['booking_status'] == 'pending' ? 'warning' : 'success'; ?>">
            <?php echo $booking['booking_status']; ?>
        </span>
    </td>

    <td><?php echo $booking['created_at']; ?></td>
</tr>
                    <?php endwhile; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>


PK 99