JezK
Edit File: notification.php
<?php include_once('includes/connect_database.php'); include_once('functions.php'); $msg=$alert_color=''; if(isset($_SESSION['cat_ses'])) { if($_SESSION['cat_ses']==11) { $msg="Falied to delete"; $alert_color="alert-danger"; } if($_SESSION['cat_ses']==10) { $msg="Deleted category successfully"; $alert_color="alert-warning"; } if($_SESSION['cat_ses']==21) { $msg="Transport updated successfully"; $alert_color="alert-success"; } if($_SESSION['cat_ses']==22) { $msg="Failed update"; $alert_color="alert-danger"; } unset($_SESSION['cat_ses']); } ?> <div id="content" class="container col-md-12"> <?php $sql_query = "SELECT id,message,user_type,order_id,user_id,read_status,create_date FROM notification where delete_status=0 and user_type=2 ORDER BY id DESC "; //print_r($sql_query);exit; //~ }else{ //~ $sql_query = "SELECT Category_ID, Category_name, Category_image ,main_company //~ FROM tbl_category //~ WHERE Category_name LIKE ? //~ ORDER BY Category_ID DESC LIMIT ?, ?"; //~ } $stmt_paging = $connect->stmt_init(); if($stmt_paging ->prepare($sql_query)) { //~ // Bind your variables to replace the ?s //~ if(empty($keyword)){ //~ $stmt_paging ->bind_param('ss', $from, $offset); //~ }else{ //~ $stmt_paging ->bind_param('sss', $bind_keyword, $from, $offset); //~ } // Execute query $stmt_paging ->execute(); // store result $stmt_paging ->store_result(); $stmt_paging->bind_result($data['id'], $data['message'], $data['user_type'], $data['order_id'], $data['user_id'], $data['read_status'], $data['create_date'] ); //~ // for paging purpose //$total_records_paging = $total_records; } ?> <div class="col-md-12"> <h1>Admin Notifications</h1> <hr> </div> <br/> <div class="col-md-12 text-right"> <a href="add_notification.php"> <button class="btn btnAdd">Add</button> </a> </div> <div style="clear:both"></div> <br/> <div class="col-md-12"> <div class="col-md-12"> <div style="width:25% ;margin:auto" > <?php if(!empty($msg)){?> <div class="alert <?=$alert_color?>" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <?php echo isset($msg) ? $msg : '';?> </div> <?php } ?> </div> </div> <div class="table-responsive col-md-12 col-xs-12"> <table id="vendor_list_cate" class="table table-striped table-bordered dataTable no-footer"> <thead> <tr > <th>S.No</th> <th>Message</th> <th>Date</th> </tr> </thead> <tbody> <?php $i=1; while ($stmt_paging->fetch()){ ?> <tr> <td><?php echo $i++?></td> <td><?php echo $data['message']; ?></td> <td><?php echo date('Y-m-d',strtotime($data['create_date'])); ?></td> </tr> <?php }?> </tbody> </table> </div> </div> </div> <style> #vendor_list_cate_filter{ text-align: right; } .btnAdd, .btnAdd:hover { background-color:#2787D9; color:#FFFFFF; padding: 6px 18px; } </style> <?php //$stmt->close(); include_once('includes/close_database.php'); ?> <?php include('public/footer.php'); ?> </div> <style> #vendor_list_filter{ text-align: right; } </style> <script src="css/js/jquery.min.js"></script> <script src="css/js/bootstrap.min.js"></script> <script type="text/javascript" src="css/js/datatables.min.js"></script> <script type="application/javascript"> $(document).ready(function (e) { $('#vendor_list').DataTable(); $('#companyLog').click(function(){ if($.trim($('#comapany_name').val())=="") { alert("Please enter company name"); return false; } }); }); function editcompany(id,name,company) { document.getElementById("editcomapany_name").value=name; document.getElementById("editid").value=id; $("input[name='main_company'][value='"+company+"']").prop('checked', true); } function confirmdelete(id) { var con=confirm("Do You want delete?"); if(con){ } } </script> <script type="text/javascript"> // For demo to fit into DataTables site builder... $('#vendor_list') .removeClass( 'display' ) .addClass('table table-striped table-bordered'); </script> <script type="text/javascript"> // For demo to fit into DataTables site builder... function confirmdelete(id) { var con=confirm("Do you want to delete?"); if(con) { location.replace("./public/confirm-delete-category.php?id="+id); } } $(document).ready(function (e) { window.setTimeout(function() { $(".alert").fadeTo(500, 0).slideUp(500, function(){ $(this).remove(); }); }, 2000); $('#vendor_list_cate').DataTable(); }); </script> </body> </html>