%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_6ca89795/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_6ca89795/admin/productshow.php
<?php
session_start();

if (!isset($_SESSION["username"])) {
    header('location:../admin.php');
    exit;
}

include('header.php');
include('../dbcon.php');

$category_id = isset($_GET['category_id']) ? intval($_GET['category_id']) : 0;

/* CATEGORY LIST */
$catQuery = mysqli_query($conn, "SELECT * FROM arawecovercategory ORDER BY category ASC");
?>

<div class="container mt-4">

    <div class="d-flex justify-content-between align-items-center mb-3">
        <h2>Manage Products</h2>

        <a class="btn btn-success" href="product.php">
            Add New
        </a>
    </div>

    <!-- FILTER -->

    <form method="GET" class="mb-3">

        <select name="category_id"
                class="form-control"
                onchange="this.form.submit()">

            <option value="">All Categories</option>

            <?php while($cat=mysqli_fetch_assoc($catQuery)){ ?>

                <option value="<?= $cat['id']; ?>"
                    <?= ($category_id==$cat['id']) ? 'selected' : ''; ?>>

                    <?= $cat['category']; ?>

                </option>

            <?php } ?>

        </select>

    </form>

    <table class="table table-bordered table-striped">

        <thead class="thead-dark">

        <tr>

            <th width="60">#</th>
            <th>Image</th>
            <th>Title</th>
            <th>Price</th>
            <th>Stock</th>
            <th>Weight</th>
            <th>Featured</th>
            <th>Status</th>
            <th width="100">Edit</th>
            <th width="100">Delete</th>

        </tr>

        </thead>

        <tbody>

        <?php

        if($category_id > 0)
        {
            $sql = "
            SELECT *
            FROM areawecover
            WHERE category_id='$category_id'
            ORDER BY id DESC
            ";
        }
        else
        {
            $sql = "
            SELECT *
            FROM areawecover
            ORDER BY id DESC
            ";
        }

        $run = mysqli_query($conn, $sql);

        $count = 0;

        if(mysqli_num_rows($run) > 0)
        {
            while($row = mysqli_fetch_assoc($run))
            {
                $count++;
        ?>

        <tr>

            <td><?= $count; ?></td>

            <td>

                <?php if(!empty($row['image'])){ ?>

                    <img src="dataimg/<?= $row['image']; ?>"
                         width="100"
                         height="70"
                         style="object-fit:cover;">

                <?php } ?>

            </td>

            <td><?= htmlspecialchars($row['title']); ?></td>

            <td>₹ <?= $row['price']; ?></td>

            <td><?= $row['stock']; ?></td>

            <td><?= $row['weight']; ?></td>

            <td>

                <?php
                if($row['is_featured']==1)
                {
                    echo '<span class="badge badge-success">Yes</span>';
                }
                else
                {
                    echo '<span class="badge badge-secondary">No</span>';
                }
                ?>

            </td>

            <td>

                <?php
                if($row['status']==1)
                {
                    echo '<span class="badge badge-success">Active</span>';
                }
                else
                {
                    echo '<span class="badge badge-danger">Inactive</span>';
                }
                ?>

            </td>

            <td>

                <a class="btn btn-primary btn-sm"
                   href="productform.php?sid=<?= $row['id']; ?>">
                    Edit
                </a>

            </td>

            <td>

                <a class="btn btn-danger btn-sm"
                   onclick="return confirm('Are you sure?')"
                   href="productdelete.php?sid=<?= $row['id']; ?>">
                    Delete
                </a>

            </td>

        </tr>

        <?php
            }
        }
        else
        {
        ?>

        <tr>

            <td colspan="10" class="text-center">
                No Data Found
            </td>

        </tr>

        <?php } ?>

        </tbody>

    </table>

</div>

</div>

            <!-- / Content -->

            

            <div class="content-backdrop fade"></div>
          </div>
          <!-- Content wrapper -->
        </div>
        <!-- / Layout page -->
      </div>
    </div>
    <!-- / Layout wrapper -->

    
    <!-- Core JS -->
    <!-- build:js assets/vendor/js/core.js -->
    <script src="../assets/vendor/libs/jquery/jquery.js"></script>
    <script src="../assets/vendor/libs/popper/popper.js"></script>
    <script src="../assets/vendor/js/bootstrap.js"></script>
    <script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>

    <script src="../assets/vendor/js/menu.js"></script>
    <!-- endbuild -->

    <!-- Vendors JS -->

    <!-- Main JS -->
    <script src="../assets/js/main.js"></script>

    <!-- Page JS -->

    <!-- Place this tag in your head or just before your close body tag. -->
    <script async defer src="https://buttons.github.io/buttons.js"></script>
  </body>
</html>

VaKeR 2022