JezK
Edit File: contact_management.php
<?php include('admin_functions.php'); if($_SESSION['username']=='') { echo "<script>location.replace('index.php');</script>" ; } $admin=new adm_functions(); $contacts = $admin->get_contact(); $i=1; $reposrtdata =''; foreach($contacts as $k=>$v){ $contactdata .='<tr> <td>'.$i.'</td> <td>'.$v['username'].'</td> <td>'.$v['contactdate'].'</td> <td><a href="contact_view.php?id='.$v['contactid'].'"><input type="button" class="btn btn-success" value="View"></a> <a href="contact_delete.php?id='.$v['contactid'].'"><input type="button" class="btn btn-danger" value="Delete"></a> </td> </tr>'; $i++; } $currentPage='contact_management'; include"header.php" ?> <div class="main-panel"> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar bar1"></span> <span class="icon-bar bar2"></span> <span class="icon-bar bar3"></span> </button> <a class="navbar-brand" href="#">Contact Management</a> </div> </div> <div class="collapse navbar-collapse"> </div> </nav> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="content table-responsive table-full-width"> <table class="table table-striped" id="example"> <thead> <th>S.No</th> <th>UserName</th> <th>Contact Date & Time</th> <th>Action</th> </thead> <tbody> <?php echo $contactdata; ?> </tbody> </table> </div> </div> </div> </div> </div> <?php include"footer.php" ?> <script> $(document).ready(function() { $('#example').DataTable(); }) </script> <link href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" rel="stylesheet"> <script src="//code.jquery.com/jquery-1.12.4.js"></script> <script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>