D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
epksuofuukz9
/
www
/
admin
/
Filename :
view_posts.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>Post</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="#" style="color:#111;">Dashboard</a></li> <li class="breadcrumb-item active">View Course</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 Course</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>Course Name</th> <th>Cover Image</th> <th>Status</th> <th>Date</th> <th>Action</th> </tr> </thead> <tbody> <?php $i=0; $get_all="SELECT * FROM courses ORDER BY course_id DESC"; $run_all=query($get_all); while($row_all=fetch($run_all)) { $course_id =$row_all['course_id']; $meta_title =$row_all['meta_title']; $slug_url =$row_all['slug_url']; $meta_keywords =$row_all['meta_keywords']; $meta_description =$row_all['meta_description']; $course_name =$row_all['course_name']; $description =$row_all['description']; $cover_image =$row_all['cover_image']; $status =$row_all['status']; $date=$row_all['date']; $i++; ?> <tr> <td><?php echo $i;?></td> <td><?php echo $meta_title;?></td> <td><?php echo $course_name;?></td> <td><a href="images/cover_image/<?php echo $cover_image;?>" target="_blank"><img src="images/cover_image/<?php echo $cover_image;?>" width="100px" height="100px"></a></td> <td><?php echo $status=='0'?'Hide':'Show'; ?></td> <td><?php echo $date;?></td> <td><a href="../courses/<?php echo $slug_url; ?>" target="_blank"><button type="button" class="btn btn-block btn-dark btn-sm">View</button></a> <a href="edit_posts.php?edit=<?php echo $course_id; ?>"><button type="button" class="btn btn-block btn-secondary btn-sm">Edit</button></a> <a href="view_posts.php?delete=<?php echo $course_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_course="DELETE FROM courses WHERE course_id='$the_id'"; $run_delete_course=query($delete_course); confirm($run_delete_course); if($run_delete_course) { echo "<script>alert('Course has been deleted');</script>"; echo "<script>window.open('view_posts.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>