%PDF- %PDF-
Direktori : /home/ugotscom/public_html/sterren/application/modules/users/views/ |
Current File : /home/ugotscom/public_html/sterren/application/modules/users/views/userslist.php |
<section class="content"> <div class="row"> <div class="col-md-12"> <!-- BEGIN EXAMPLE TABLE PORTLET--> <div class="portlet box blue-hoki"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-globe"></i>Users List </div> <div class="tools"> </div> <div class="actions"> <a href="<?=base_url()?>user/add" class="btn btn-sm btn-success"> <i class="fa fa-plus"></i> Add </a> </div> </div> <div class="portlet-body"> <table class="table table-striped table-bordered table-hover" id="userlist"> <thead> <tr> <th class="text-center"> No</th> <th class="text-center"> Name</th> <th class="text-center"> User Type</th> <th class="text-center"> Email</th> <th class="text-center"> Username</th> <th class="text-center"> Phone No</th> <th class="text-center"> Status</th> <th class="text-center"> Actions</th> </tr> </thead> <tbody> <?php $i=1; foreach ($users_list as $key => $value) { ?> <tr> <td class="text-center"><?=$i?></td> <td class="text-center"><?=$value['name']?></td> <td class="text-center"><?=$value['user_type']?></td> <td class="text-center"><?=$value['email']?></td> <td class="text-center"><?=$value['username']?></td> <td class="text-center"><?=$value['phone']?></td> <td class="text-center"> <?php if($value['status']==1){?> <a href="<?=base_url();?>user/change_status/<?=$value['user_id']?>/<?=$value['status']?>" type="button" class="btn btn-success" onClick="return confirm('Are you sure you want to change status?')">Active</a> <?php } else{?> <a href="<?=base_url();?>user/change_status/<?=$value['user_id']?>/<?=$value['status']?>" type="button" class="btn btn-danger" onClick="return confirm('Are you sure you want to change status?')">Inactive</a> <?php } ?> </td> <td class="text-center"> <a href="<?=base_url()?>user/edit/<?=$value['user_id']?>" class="btn btn-danger btn-sm"> Edit </a> <!-- <a href="<?=base_url()?>user/add" class="btn btn-danger btn-sm"><i class="fa fa-times"></i> Delete </a> --> </td> </tr> <?php $i++; } ?> </tbody> </table> </div> </div> <!-- END EXAMPLE TABLE PORTLET--> </div> </div> </section> </div> <!DOCTYPE html> <html> <head> <title>DataTables AJAX Pagination with Search and Sort in CodeIgniter</title> <!-- Datatable CSS --> <link href='//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css' rel='stylesheet' type='text/css'> <!-- jQuery Library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!-- Datatable JS --> <script src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> </head> <body> <!-- Table --> <table id='empTable' class='display dataTable'> <thead> <tr> <th>Employee name</th> <th>Email</th> <th>Gender</th> <th>Salary</th> <th>City</th> </tr> </thead> </table> <!-- Script --> <script type="text/javascript"> $(document).ready(function(){ $('#empTable').DataTable({ 'processing': true, 'serverSide': true, 'serverMethod': 'post', 'ajax': { 'url':'<?=base_url()?>/users/all_users' }, 'columns': [ { data: 'emp_name' }, { data: 'email' }, { data: 'gender' }, { data: 'salary' }, { data: 'city' }, ] }); }); </script> </body> </html> <script> $(document).ready(function(){ $('#userlist').DataTable({ // Processing indicator "processing": true, // DataTables server-side processing mode "serverSide": true, // Initial no order. "order": [], // Load data from an Ajax source "ajax": { "url": "<?php echo base_url('users/all_users/'); ?>", "type": "POST" }, //Set column definition initialisation properties "columnDefs": [{ "targets": [0], "orderable": false }] }); }); </script>