D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
tresboutique.in
/
tresadmin
/
Filename :
testimonials.php
back
Copy
<?php include 'config.php'; // Fetch all testimonials from the database $query = "SELECT * FROM testimonial"; $result = mysqli_query($conn, $query); ?> <!DOCTYPE html> <html lang="en"> <head> <?php require('style.php'); ?> </head> <body> <div class="page-wrapper compact-wrapper" id="pageWrapper"> <div class="page-body-wrapper"> <?php require('sidebar.php'); ?> <div class="page-body"> <div class="container-fluid"> <div class="page-title"> <h3>Manage Testimonials</h3> </div> <div class="container"> <a href="add_testimonial.php" class="btn btn-success mb-3">Add Testimonial</a> <div class="table-responsive"> <table class="table table-bordered"> <thead> <tr> <th>Testimonial Name</th> <th>Testimonial Designation</th> <th>Testimonial Comment</th> <th>Testimonial Image</th> <th>Actions</th> </tr> </thead> <tbody> <?php if (mysqli_num_rows($result) > 0) { while ($testimonial = mysqli_fetch_assoc($result)) { echo '<tr>'; echo '<td>' . $testimonial['testimonial_name'] . '</td>'; echo '<td>' . $testimonial['testimonial_designation'] . '</td>'; echo '<td>' . substr($testimonial['testimonial_comment'], 0, 100) . '...</td>'; echo '<td>'; if ($testimonial['testimonial_image']) { echo '<img src="uploads/testimonials/' . $testimonial['testimonial_image'] . '" alt="Testimonial Image" width="100">'; } else { echo 'No Image'; } echo '</td>'; echo '<td>'; echo '<a href="edit_testimonial.php?testimonial_id=' . $testimonial['testimonial_id'] . '" class="btn btn-primary btn-sm">Edit</a>'; echo ' <a href="delete_testimonial.php?testimonial_id=' . $testimonial['testimonial_id'] . '" class="btn btn-danger btn-sm" onclick="return confirm(\'Are you sure you want to delete this testimonial?\');">Delete</a>'; echo '</td>'; echo '</tr>'; } } else { echo '<tr><td colspan="5">No testimonials found</td></tr>'; } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <?php require('footer.php'); ?> </body> </html>