55ok

Mini

Direktori : /home/u307599615/domains/costumeonrent.in/public_html/admin/
Upload File :
Current File : /home/u307599615/domains/costumeonrent.in/public_html/admin/view_checkout_details.php

<?php
include("connection.php");
include("header.php");
?>
<div class="main-content">
    <div class="page-content">
        <div class="container-fluid">
            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                        <h4 class="mb-sm-0 font-size-18">View Checkout Details </h4>
                    </div>
                </div>
            </div>
            <!-- end page title -->

            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="row mb-2">
                                <div class="col-sm-6 mt-3">
                                    <div class="search-box me-2 d-inline-block">
                                        <div class="position-relative">
                                            <input type="text" class="form-control" autocomplete="off" id="searchInput" onkeyup="searchTable()" placeholder="Search...">
                                            <i class="bx bx-search-alt search-icon"></i>
                                        </div>
                                    </div>

                                </div>
                                <div class="col-sm-6 mt-3">
                                    <!-- <div class="text-sm-end">
                                        <a href="addInstagram.php"> <button type="button" data-bs-toggle="modal" data-bs-target="#newContactModal" class="btn btn-success btn-rounded waves-effect waves-light addContact-modal mb-2">
                                                <i class="mdi mdi-plus me-1"></i> New Contact
                                            </button></a>
                                    </div> -->
                                </div>
                                <!-- end col-->
                            </div>
                            <!-- end row -->
                            <div class="table-responsive">
                                <table class="table align-middle table-nowrap table-hover dt-responsive nowrap w-100" id="userList-table">
                                    <thead class="table-light">
                                        <tr>
                                            <th scope="col">S.no</th>
                                            <th scope="col">Name</th>
                                            <th scope="col">Email</th>
                                            <th scope="col">Phone</th>
                                            <th scope="col">Country</th>
                                            <th scope="col">City</th>
                                            <th scope="col">Address</th>
                                            <th scope="col">Apartment</th>
                                            <th scope="col">PIN Code</th>
                                            <th scope="col">Payment</th>
                                            <th scope="col">Subtotal</th>
                                            <th scope="col">Discount</th>
                                            <th scope="col">Grand Total</th>
                                            <th scope="col">Created At</th>
                                            <th scope="col">Activity</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                        $query = "SELECT * FROM `checkout_orders` ORDER BY id DESC";
                                        $sql = mysqli_query($con, $query);
                                        $sn = 1;
                                        while ($row = mysqli_fetch_assoc($sql)) {
                                        ?>
                                            <tr>
                                                <td><?php echo $sn++; ?></td>
                                                <td><?php echo htmlspecialchars($row['name']); ?></td>
                                                <td><?php echo htmlspecialchars($row['email']); ?></td>
                                                <td><?php echo htmlspecialchars($row['phone']); ?></td>
                                                <td><?php echo htmlspecialchars($row['country']); ?></td>
                                                <td><?php echo htmlspecialchars($row['city']); ?></td>
                                                <td><?php echo htmlspecialchars($row['address']); ?></td>
                                                <td><?php echo htmlspecialchars($row['apartment']); ?></td>
                                                <td><?php echo htmlspecialchars($row['postal_code']); ?></td>
                                                <td><?php echo htmlspecialchars($row['payment']); ?></td>
                                                <td>₹<?php echo number_format($row['subtotal'], 2); ?></td>
                                                <td>₹<?php echo number_format($row['discount'], 2); ?></td>
                                                <td>₹<?php echo number_format($row['grand_total'], 2); ?></td>
                                                <td><?php echo htmlspecialchars($row['created_at']); ?></td>
                                                <td>
                                                    <a href="view.php?id=<?php echo $row['id']; ?>" class="btn btn-sm btn-soft-primary">
                                                        <i class="bx bx-show">view</i>
                                                    </a>

                                                    <select class="form-select activity-select" data-id="<?php echo $row['id']; ?>">
                                                        <option value="Yes" <?php if ($row['activity'] == 'Yes') echo 'selected'; ?>>✔️</option>
                                                        <option value="No" <?php if ($row['activity'] == 'No') echo 'selected'; ?>>❌</option>
                                                    </select>
                                                </td>
                                            </tr>
                                        <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>


                                <!-- end table -->
                            </div>
                            <!-- end table responsive -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- container-fluid -->
    </div>
    <!-- End Page-content -->




    <?php
    include("footer.php");
    ?>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script>
        $(document).ready(function() {
            $('.activity-select').on('change', function() {
                var activity = $(this).val();
                var id = $(this).data('id');

                $.ajax({
                    url: 'update_activity.php',
                    type: 'POST',
                    data: {
                        id: id,
                        activity: activity
                    },
                    success: function(response) {
                        // alert('Activity updated successfully');
                    },
                    error: function() {
                        alert('Failed to update activity');
                    }
                });
            });
        });
    </script>

</div>

Zerion Mini 1.0