D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
jaipurpartyplanner.in
/
admin
/
Filename :
searchresult.php
back
Copy
<?php include('include/header.php'); // $sno = 1; ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <div class="container-full"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="d-flex align-items-center"> <div class="me-auto"> <h4 class="page-title">Add Products</h4> <!--<div class="d-inline-block align-items-center">--> <!-- <nav>--> <!-- <ol class="breadcrumb">--> <!-- <li class="breadcrumb-item"><a href="#"><i class="mdi mdi-home-outline"></i></a></li>--> <!-- <li class="breadcrumb-item" aria-current="page">Products</li>--> <!-- <li class="breadcrumb-item active" aria-current="page">Add Products</li>--> <!-- </ol>--> <!-- </nav>--> <!--</div>--> </div> </div> </div> <?php $per_page_record = 4; // Number of entries to show in a page. // Look for a GET variable page if not found default is 1. if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; } $start_from = ($page-1) * $per_page_record; $query = "SELECT * FROM products LIMIT $start_from, $per_page_record"; $proData = mysqli_query ($conn, $query); ?> <!-- Main content --> <section class="content"> <div class="box"> <div class="box-header with-border d-flex justify-content-between" > <h4 class="box-title" style="margin-left: 20px;margin-top: 10px;">Products List</h4> <button type="button" class="waves-effect waves-light btn btn-rounded btn-success mb-5 ed-btn text-right"><a href="product-form.php">Add New Product</a></button> </div> <!-- /.box-header --> <div class="box-body"> </div> <!-- /.box-body --> <div class="box-body no-padding"> <input type="hidden" id="deleteId"> <div class="table-responsive"> <table class="table table-hover"> <tbody id="showdata"> <tr> <th width="5%">Id</th> <th width="25%">Category</th> <th width="30%">Product</th> <th width="20%">Image</th> <th width="15%">Sku</th> <th colspan="2" width="5%" class="text-center">Action</th> </tr> <?php while ($row=mysqli_fetch_array($proData)) { ?> <tr > <td><?php echo $row['id']; ?></td> <td><?php echo $row['category']; ?></td> <td><?php echo $row['title']; ?></td> <td><?php echo "<img src='".$row['image']."' width='100' >"; ?></td> <td><span class="text-muted"><i class="fa fa-clock-o"></i> <?php echo $row['sku']; ?></span> </td> <td><button type="button" class="waves-effect waves-light btn btn-rounded btn-success mb-5 ed-btn"><?php echo "<a href='product_edit.php?eid=".$row['id']."'>Edit</a>";?></button></td> <td><button type="button" class="waves-effect waves-light btn btn-rounded btn-danger mb-5 ed-btn"><a onclick="openDeleteModal(<?php echo $row['id']; ?>)" href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#delete-item">Delete</a></button></td> </tr> <?php }?> </tbody></table> </div> <div class="pagination"> <?php $query = "SELECT COUNT(*) FROM products"; $ProData = mysqli_query($conn, $query); $row = mysqli_fetch_row($ProData); $total_records = $row[0]; echo "</br>"; // Number of pages required. $total_pages = ceil($total_records / $per_page_record); $pagLink = ""; if($page>=2){ echo "<a href='products.php?page=".($page-1)."'> Prev </a>"; } for ($i=1; $i<=$total_pages; $i++) { if ($i == $page) { $pagLink .= "<a class = 'active' href='products.php?page=" .$i."'>".$i." </a>"; } else { $pagLink .= "<a href='products.php?page=".$i."'> ".$i." </a>"; } }; echo $pagLink; if($page<$total_pages){ echo "<a href='products.php?page=".($page+1)."'> Next </a>"; } ?> </div> </div> </div> <!-- Delete --> <div class="modal fade" id="delete-item" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered "> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Delete Product</h5> <button type="button" class="btn-close close-modal" data-bs-dismiss="modal" aria-label="Close"> <i class="fe fe-x"></i> </button> </div> <div> <div class="modal-body py-0"> <div class="del-modal"> <p>Are you sure want to Delete?</p> </div> </div> <div class="modal-footer pt-0"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="submit" onclick="confirmDelete()" class="btn btn-primary">Yes</button> </div> </div> </div> </div> </div> <!-- /Delete --> <script> function openDeleteModal(id) { document.getElementById('deleteId').value = id; } function confirmDelete() { // Get the stored ID var id = document.getElementById('deleteId').value; window.location.href = 'product_delete.php?did=' + id; } </script> </section> <!-- /.content --> </div> </div> <!-- /.content-wrapper --> <?php include('include/footer.php') ?>