D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
epksuofuukz9
/
www
/
admin
/
Filename :
view_all_blogs.php
back
Copy
<?php include("includes/header.php"); ?> <body class="hold-transition sidebar-mini"> <div class="wrapper"> <!-- Navbar --> <?php include("includes/top_nav.php");?> <!-- /.navbar --> <!-- Main Sidebar Container --> <?php include("includes/side_nav.php");?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>Blog</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="dashboard.php" style="color:#111;">Dashboard</a></li> <li class="breadcrumb-item active">View All Blog</li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h3 class="card-title">View All Blog</h3> </div> <!-- /.card-header --> <div class="card-body table-responsive"> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>S.N.</th> <th>Meta Title</th> <th>Blog Title</th> <th>Blog Cover Image</th> <th>Status</th> <th>Date</th> <th>Action</th> </tr> </thead> <tbody> <?php $i=0; $get_all="SELECT * FROM blogs ORDER BY blogs_id DESC"; $run_all=query($get_all); while($row_all=fetch($run_all)) { $blogs_id =$row_all['blogs_id']; $meta_title =$row_all['meta_title']; $slug_url =$row_all['slug_url']; $title =$row_all['title']; $cover_images =$row_all['cover_images']; $status =$row_all['status']; $created_date =$row_all['created_date']; $i++; ?> <tr> <td><?php echo $i;?></td> <td><?php echo $meta_title;?></td> <td><?php echo $title;?></td> <td><a href="images/blog/<?php echo $cover_images;?>" target="_blank"><img src="images/blog/<?php echo $cover_images;?>" width="100px" height="100px"></a></td> <td><?php echo $status=='0'?'Hide':'Show'; ?></td> <td><?php echo $created_date; ?></td> <td><a href="../blog/<?php echo $slug_url; ?>" target="_blank"><button type="button" class="btn btn-block btn-dark btn-sm">View</button></a> <a href="edit_blog.php?edit=<?php echo $blogs_id; ?>"><button type="button" class="btn btn-block btn-secondary btn-sm">Edit</button></a> <a href="view_all_blogs.php?delete=<?php echo $blogs_id;?>"><button type="button" class="btn btn-block btn-danger btn-sm" onclick="return confirm('Are you sure you want to delete it?');">Delete</button></a></td> </tr> <?php } ?> </tbody> <tfoot> <tr> <th>S.N.</th> <th>Meta Title</th> <th>Course Name</th> <th>Cover Image</th> <th>Status</th> <th>Date</th> <th>Action</th> </tr> </tfoot> </table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> </div> <!-- /.row --> </section> <!-- /.content --> <?php if(isset($_GET['delete'])) { $the_id=$_GET['delete']; $delete="DELETE FROM blogs WHERE blogs_id='$the_id'"; $run_delete=query($delete); confirm($run_delete); if($run_delete) { echo "<script>alert('Blog has been deleted');</script>"; echo "<script>window.open('view_all_blogs.php','_self');</script>"; } } ?> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include("includes/footer.php");?> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Control sidebar content goes here --> </aside> <!-- /.control-sidebar --> </div> <!-- ./wrapper --> <?php include("includes/scripts.php"); ?> <script> $(function () { $("#example1").DataTable(); $('#example2').DataTable({ "paging": true, "lengthChange": false, "searching": false, "ordering": true, "info": true, "autoWidth": false, }); }); </script> </body> </html>