����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 162.0.232.25 / Your IP : 3.147.67.237 Web Server : LiteSpeed System : Linux premium276.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : kwacuqig ( 988) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/kwacuqig/bm1holdings-ltd.com/ |
Upload File : |
<?php include './header.php'; include './assets/php/connect.php'; if (isset($_GET['pageno'])) { $pageno = $_GET['pageno']; } else { $pageno = 1; } $no_of_records_per_page = 10; $offset = (($pageno - 1) * $no_of_records_per_page); $total_pages_sql = "SELECT COUNT(*) FROM `clients`"; $result = mysqli_query($conn, $total_pages_sql); $total_rows = mysqli_fetch_array($result)[0]; $total_pages = ceil($total_rows / $no_of_records_per_page); if (!loggedin()) { header('location:./login'); } ?> <div class="breadcrumbs"> <div class="container"> <div class="row"> <div class="col-12"> <div class="bread-inner"> <ul class="bread-list"> <li><a href="home">Home<i class="ti-arrow-right"></i></a></li> <li class="active"><a href="client-list">Client List</a></li> </ul> </div> </div> </div> </div> </div> <?php if (isset($_POST['submit'])) { $cid = mysqli_real_escape_string($conn, $_POST['cid']); $name = mysqli_real_escape_string($conn, $_POST['name']); $biography = mysqli_real_escape_string($conn, $_POST['biography']); $location = mysqli_real_escape_string($conn, $_POST['location']); $sql = "UPDATE `clients` SET `name`='$name', `biography`='$biography', `location`='$location' WHERE `cid`=$cid"; //checking if the query has run successfully if (mysqli_query($conn, $sql)) { ?> <script type="text/javascript"> swal("SUCCESS", "<?php echo $name; ?> was successfully updated", "success"); </script> <?php } else { die(mysqli_error($conn)); } } ?> <section class="shop section"> <div class="container"> <div class="row"> <div class="col-lg-3 mb-4"> <div class="account-sidebar"> <div class="sidebar-list"> <a href="client-list" class="active"><i class="far fa-handshake"></i> Clients</a> <a href="add-client"><i class="far fa-upload"></i> Add New Client</a> <a href="logout"><i class="far fa-lock"></i> Logout</a> </div> </div> </div> <div class="col-lg-9"> <div class="account-content"> <h4 class="account-content-title"><i class="far fa-handshake"></i> Clients</h4> <div class="account-content-table"> <div class="table-responsive"> <table class="table table-borderless"> <tr> <th>Image</th> <th>Name</th> <th>Location</th> <th>Action</th> </tr> <?php $query = "SELECT * FROM `clients` ORDER BY `cid` DESC LIMIT $offset, $no_of_records_per_page"; $run = mysqli_query($conn, $query) or die(mysqli_error($conn)); while ($row = mysqli_fetch_array($run)) { ?> <tr class="account-order-list"> <td class="product-img"><img src="assets/clients/<?php echo $row['image']; ?>" alt=""></td> <td> <div class="product-info"><?php echo $row['name']; ?></div> </td> <td> <div class="product-info"><?php echo $row['location']; ?></div> </td> <td> <div class="product-info"> <a href="#" class="content-action content-action-mr" data-bs-toggle="modal" data-bs-target="#modal-<?php echo $row['cid']; ?>"><i class="far fa-pen"></i></a> <a href="client-delete.php?cid=<?php echo $row['cid']; ?>" class="content-action" onclick="return confirm('Delete <?php echo $row['name']; ?>?')"><i class="far fa-trash"></i></a> </div> </td> </tr> <!-- The Modal --> <div class="modal fade" id="modal-<?php echo $row['cid']; ?>"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <!-- Modal body --> <div class="modal-body"> <div class="account-content bg-white pt-0"> <div class="edit-profile"> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="POST" enctype="multipart/form-data"> <div class="row"> <div class="col-12"> <div class="mb-3"> <label for="name" class="form-label">Name</label> <input type="text" name="name" class="form-control" id="name" value="<?php echo $row['name'] ?>" required> </div> </div> <div class="col-12"> <div class="mb-3"> <label for="biography" class="form-label">Biography</label> <textarea class="form-control" name="biography" id="biography" rows="6" required><?php echo $row['biography'] ?></textarea> </div> </div> <div class="col-12"> <div class="mb-3"> <label for="price" class="form-label">Location</label> <input type="text" name="location" class="form-control" id="price" value="<?php echo $row['location'] ?>" required> </div> </div> <input type="hidden" name="cid" value="<?php echo $row['cid']; ?>"> </div> <button type="submit" name="submit" class="btn">Update Client</button> </form> </div> </div> </div> </div> </div> </div> <?php } ?> </table> </div> <div class="col-12"> <div class="pagination center mt-2"> <ul class="pagination-list"> <li><a href="<?php if ($pageno <= 1) { echo '#'; } else { echo "?pageno=" . ($pageno - 1); } ?>"><i class="ti-arrow-left"></i></a></li> <?php for ($i = 1; $i <= 3; $i++) { echo "<li><a href=\"?pageno=$i\">$i</a></li>"; } ?> <li><a href="<?php if ($pageno >= $total_pages) { echo '#'; } else { echo "?pageno=" . ($pageno + 1); } ?>"><i class="ti-arrow-right"></i></a></li> </ul> </div> </div> </div> </div> </div> </div> </div> </section> <?php include './footer.php'; include './scripts.php'; ?> <script> document.querySelector("title").innerText = "BM 1 HOLDINGS LTD - TEAM LIST"; document.querySelectorAll(".menu-area ul li")[7].classList.add("active"); document.querySelectorAll(".slicknav_nav li a")[8].style.color = "blue"; </script>