JezK
Edit File: newsletter.php
<?php include("./app/checkSession.php"); if(empty($_SESSION['admin_name'])&&$_SESSION['admin_name']==""){ echo "<script>window.location.href='index.php'</script>"; } include("header.php"); include_once("../master_admin/app/adminObj.php"); $Newsletter_list=$adminObj->newLetterlist(); // print_r ( $Newsletter_list); $Newsletter_list1=''; if(isset($_GET['id'])){ $id=$_GET['id']; $Newsletter_list1=$adminObj->deletenewLetterList($id); // echo $Newsletter_list1; } if($Newsletter_list1==1){ // echo "<script>alert('deleted success')</script>"; echo "<script>window.location.href='newsletter.php'</script>"; } if($Newsletter_list1==2){ // echo "<script>alert('deleted failed')</script>"; echo "<script>window.location.href='newsletter.php'</script>"; } ?> <style> #example_length { display: none; } .text-danger{ color:red !important; } a#export1{ margin-right:0px !important; } .row.export_csv.buttonAlignment { position: absolute; right: 36px !important; bottom: 25px !important; } @media(max-width:767px){ /* #example_filter label:after{ right: 22px !important; top: 74px !important; } */ } </style> <div class="container"> <div class="container mt-3"> <div class="row px-md-4 px-0"> <div class="tophead col-md-4"> <h6><?php echo $lang['NEWS_LETTER']; ?></h6> </div> <div class="col-md-4"> </div> <!-- <div class="col-md-4 text-md-right my-3 mt-md-0"> <a href="add-newsletter.php"><button class="add_user_btn"><img src="images/addwarehouse_selected.png"></button><span class="addusertext pl-2">Create News letter</span> </a> </div> --> </div> </div> <div class="container "> <div class="table-responsive p-4 myquotation-table"> <table id="example" class="display bg-white tbl-border table-borderless" style="width:100%"> <thead> <tr> <th><?php echo $lang['SNO'];?></th> <th><?php echo $lang['EMAIL']; ?></th> <th><?php echo $lang['STATUS']; ?></th> <!-- <th>Created date</th> --> <th><?php echo $lang['ACTION']; ?></th> </tr> </thead> <tbody> <?php if($Newsletter_list>0){ $Sno = 0; foreach($Newsletter_list as $val) { ?> <tr> <td><?php echo ++$Sno; ?></td> <td><?php echo $val['email'] ?></td> <td><?php if($val['status'] == 1){ echo "Active";}else{echo "Blocked";} ?></td> <!-- <td><?php echo $val['created_date'] ?></td> --> <!-- <td><a href='edituser.php'><i class='fa fa-pencil'></i></a></td> --> <!-- <td><a href="?id=<?php echo $val['id'] ?>"><i class='fa fa-trash'></i></a></td> --> <td> <?php if($val['status'] == 1){ ?> <a href="newsLetterStatus.php?id=<?php echo $val["id"]; ?>"><i class='fa fa-ban text-success' title="Active"></i></a> <?php } else {?> <a href="newsLetterStatus.php?id=<?php echo $val['id']; ?>"><i class='fa fa-ban text-danger' title="Blocked"></i></a> <?php } ?> </td> </tr> <?php } } ?> </tbody> </table> </div> </div> <div class="container position-relative"> <div class="row export_csv buttonAlignment"> <div class="col-md-3 pl-2"> <?php if(count($Newsletter_list)>0){?> <a href="export-newsLetter.php" id="export1" class="btn btn-primary"><i class="fa fa-download"></i><span class="pl-0"> <?php echo $lang['EXPORT.XLSX']; ?></span></a> <?php }?> </div> </div> </div> </div> <!-- footer --> <?php include("footer.php"); ?> <!-- <script src="js/jquery.min.js"></script> --> <!-- <script src="js/jquery.pagination.min.js"></script> --> <!----> <script> $(document).ready(function() { $('#example').DataTable( { language: { search: '', searchPlaceholder: "<?php echo $lang['SEARCH'];?>", paginate: {previous: '<?php echo $lang['PREV']; ?>',next:'<?php echo $lang['NEXT'];?>'}, }, "processing": true, "dataSrc": "", // "dom": 'Bfrtip', "dom": 'Rlfrtlip', buttons: [ { extend: 'csvHtml5', text: '<i class="fa fa-download p-1"></i>Export to csv', titleAttr: 'CSV' }, ] } ); $("#example_filter").before("<div class='col-md-9 text-md-right my-3 mt-md-0 butRes'><a href='add-newsletter.php'><button class='add_user_btn'><img src='images/add-white.png'><span class='addusertext pl-2'><?php echo $lang['Create_News_letter'];?></span> </button></a></div>"); } ); </script>