<?php include('dbcon.php'); //include('config/dbcon.php'); //include('authentication.php'); //session_start(); include('include/header.php'); //include('../all/config.php'); ?> <div class="container-fluid px-4"> <div class="row mt-4"> <div class="col-md-12"> <?php include('message.php'); ?> <div class="card"> <div class="card-header"> <h4>View Post<a href="post-add.php" class="btn btn-primary float-end">Add Post</a></h4> </div> <div class="card-body"> <div class="table-responsive"> <table class="table bordered table-striped" id="example"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Category</th> <th>Image</th> <th>Status</th> <th>View</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php // $post = "SELECT * FROM posts WHERE status!='2'"; $post = "SELECT p.*, c.name AS cname FROM posts p,categories c WHERE c.id = p.category_id"; $post_run = mysqli_query($con, $post); if(mysqli_num_rows($post_run)>0) { foreach($post_run as $post) { ?> <tr> <td><?= $post['id'] ?></td> <td><?= $post['name'] ?></td> <td><?= $post['cname'] ?></td> <td> <img src="../<?= $post['image'] ?>" width="60px" height="60px" /> </td> <td> <?= $post['status'] == '1' ? 'Hidden':'Visible' ?> </td> <td> <a href="<?= "https://bdemarketing247.com/blog-details.php?title=".$post['slug']; ?>" class="btn btn-primary" target="new">View </a> </td> <td> <a href="post-edit.php?id=<?= $post['id'] ?>" class="btn btn-success">Edit</a> </td> <td> <form action="code.php" method="POST"> <button type="submit" name="post_detete_btn" value="<?= $post['id'] ?>" class="btn btn-danger">Delete</button> </form> </td> </tr> <?php } }else{ ?> <tr> <td colspan="7">No Record Found</td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <?php include('include/footer.php'); include('include/script.php'); ?>