JezK
Edit File: usermanagement.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"); $user_list=$adminObj->getSubadminlist(); //~ print_r ($user_list); ?> <style> a#export1{ margin-right:0px !important; color:#fff !important; } .row.export_csv.buttonAlignment { position: absolute; right: 36px !important; bottom: 25px !important; } @media(max-width:767px){ /* #example_filter label:after{ top:74px; right:48px; } */ .resAddCenter { text-align: center; } .tophead { margin-top: 10px; padding-left: 12px; } td.status-col { text-overflow: unset !important; max-width: 100px !important; padding: 8px 0px ; } table.dataTable tbody th, table.dataTable tbody td:last-child { padding: 8px 8px !important; padding-left: 0px !important; } } .swith1 input { display: none; } .swith1 { display: inline-block; width: 60px; /*=w*/ height: 30px; /*=h*/ margin: 4px; transform: translateY(50%); position: relative; } .slider1 { position: absolute; top: 5px; bottom: 5px; left: 9px; right: 1px; border-radius: 30px; box-shadow: 0 0 0 2px #777, 0 0 4px #777; cursor: pointer; border: 4px solid transparent; overflow: hidden; transition: 0.2s; } .slider1:before { position: absolute; content: ""; width: 100%; height: 100%; background-color: #777; border-radius: 30px; transform: translateX(-30px); /*translateX(-(w-h))*/ transition: 0.2s; } input:checked + .slider1:before { transform: translateX(30px); /*translateX(w-h)*/ background-color: limeGreen; } input:checked + .slider1 { box-shadow: 0 0 0 2px limeGreen, 0 0 5px limeGreen; } /* .swith1200 .slider1:before { width: 200%; transform: translateX(-82px); } */ .swith1 input + .uncheck:before { background-color: red; } .swith1 input+ .uncheck { box-shadow: 0 0 0 2px red, 0 0 5px red; } /* .status-coltd:last-child{ padding: 8px 10px !important; } */ /* table.dataTable tbody th, table.dataTable tbody td:last-child { padding: 8px 0px ; } */ */ </style> <div class="container"> <div class="container mt-3"> <div class="row px-md-4 px-0"> <div class="tophead"> <h6><?php echo $lang['USER_MANAGEMENT'];?></h6> </div> </div> </div> <div class="errorCls" style="color: #008000;text-align: center;"> <?php if(isset($_SESSION['msg'])){ echo $_SESSION['msg']; } unset($_SESSION['msg']);?></div> <div class="errorCls" style="color: #F00;text-align: center;"> <?php if(isset($_SESSION['msg_err'])){ echo $_SESSION['msg_err']; } unset($_SESSION['msg_err']);?></div> <div class="container mt-3"> <div class="usrRes table-responsive p-md-4 p-0 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['NAME']; ?></th> <th ><?php echo $lang['EMAIL'];?></th> <th><?php echo $lang['PHONE_NUMBER'];?></th> <th><?php echo $lang['COUNTRY'];?></th> <th><?php echo $lang['STATUS'];?></th> <th class="text-center"><?php echo $lang['ACTION'];?></th> </tr> </thead> <tbody> <?php $checked =""; $hrefLink = ""; $Sno = 0; foreach($user_list as $val) { if ($val['status'] =='' || $val['status'] =='0'){ $status = "Inactive"; $checked =""; // $hrefLink = "href='userActive.php?id=".$val["admin_id"]."'"; $hrefLink = '<a class="p-2 " id="'.$val["admin_id"].'" href="userActive.php?id='.$val["admin_id"].'"> <label class="swith1" for="check'.$val["admin_id"].'"> <input type="checkbox" class=""> <span class="slider1 uncheck"></span> </label> </a>'; }else{ $status = "Active"; $checked ="checked"; // $hrefLink = "href='userInactive.php?id=".$val["admin_id"]."'"; $hrefLink = '<a class="p-2 " id="'.$val["admin_id"].'" href="userInactive.php?id='.$val["admin_id"].'" > <label for="check'.$val["admin_id"].'" class="swith1"> <input type="checkbox" checked > <span class="slider1"></span> </label></a>'; } ?> <tr> <td><?php echo ++$Sno; ?></td> <td><?php echo $val['name'] ?></td> <td><?php echo $val['email'] ?></td> <td><?php echo $val['phonenumber'] ?></td> <td><?php $country = $adminObj->getCountryList($val['country']); echo $country[0]['display_name']; ?> </td> <td><?php echo $status ?></td> <td class="status-col" style="padding: 8px 10px;"> <?php echo $hrefLink; ?> <!-- <a class="p-2" href='userInactive.php?id=<?php echo $val["admin_id"];?>'></a> --> <a href='edituser.php?id=<?php echo $val["admin_id"];?>'><i class='fa fa-pencil'></i></a> </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($user_list)>0){?> <a href="export-userManagement.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": 'frtlip', "ordering": false, }); $("#example_filter").before( "<div class='col-md-9 text-md-right my-3 mt-md-0 resAddCenter'><a href='adduser.php'><button class='add_user_btn'><img src='images/add-white.png'></i><span class='addusertext pl-2'><?php echo $lang['ADD_USER'];?></span></button> </a></div>" ); }); </script>