55ok

Mini

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

<?php
include("connection.php");
include("header.php");

?>
<style>
    .status-yes {
        background-color: green;
        color: white;
        padding: 5px 10px;
        border-radius: 5px;
    }

    .status-no {
        background-color: red;
        color: white;
        padding: 5px 10px;
        border-radius: 5px;
    }
</style>
<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 Product</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="addproduct.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">Image</th>
                                            <!-- <th scope="col">Sub heading</th> -->
                                            <th scope="col">Product Name</th>
                                            <th scope="col">Rent</th>
                                            <th scope="col">Buy</th>
                                            <th scope="col">Quantity</th>
                                            <th scope="col">Activity</th>
                                            <!-- <th scope="col">Variant</th> -->
                                            <th scope="col" style="width: 200px">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                        $query = "SELECT * FROM `product` ORDER BY p_id DESC";
                                        $sql = mysqli_query($con, $query);
                                        $serial = 1;
                                        while ($row = mysqli_fetch_assoc($sql)) {
                                        ?>
                                            <tr>
                                                <td><?php echo $serial++; ?></td> <!-- Serial Number -->

                                                <td>
                                                    <?php
                                                    $images = json_decode($row['Image']); // JSON ko array me convert karo
                                                    if (!empty($images)) {
                                                        foreach ($images as $img) {
                                                            echo '<img src="./assets/images/categorie/' . htmlspecialchars($img) . '" height="60" width="60" style="margin-right: 5px; border-radius:5px;" />';
                                                        }
                                                    }
                                                    ?>
                                                </td>


                                                <td><?php echo $row['pro_name'] ?></td>
                                                <td><?php echo $row['rent'] ?>/-</td>
                                                <td><?php echo $row['buy'] ?>/-</td>
                                                <td><?php echo $row['pquantity'] ?></td>
                                                <td>
                                                    <span class="<?= ($row['activity'] == 'yes') ? 'status-yes' : 'status-no' ?>">
                                                        <?= htmlspecialchars($row['activity']) ?>
                                                    </span>
                                                </td>
                                                <!-- <td> 
                                                    <a href="variant.php?id=<?php echo $row['id'] ?>"><button type="button" class="btn btn-primary btn-rounded mb-2" style="width: 100px;">
                                                            <i class="far fa-edit"></i> Variant
                                                        </button></a>
                                                    </td> -->

                                                <td>
                                                    <a href="editproduct.php?p_id=<?php echo $row['p_id'] ?>">
                                                        <button type="button" class="btn btn-primary btn-rounded mb-2">
                                                            <i class="far fa-edit"></i> Edit
                                                        </button>
                                                    </a>
                                                    <a onclick="return confirm('Are you sure you want to delete this product?')" href="deleteproduct.php?p_id=<?php echo $row['p_id'] ?>">
                                                        <button type="button" class="btn btn-danger btn-rounded mb-2">
                                                            <i class="fas fa-trash"></i> Delete
                                                        </button>
                                                    </a>
                                                </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");
    ?>
</div>

Zerion Mini 1.0