MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/www/imenso.co/demo/claapp/admin/index.php
<?php 
include("../config/config.php"); 
include(BASIC_PATH."layout/header.php"); 
include(BASIC_PATH.'config/Pagination.php');
?>

<!-- main start -->
<div class="main-container container padding-10">
  <div id="content" class="m_t10">
    <div class="row">
      <div class="col-xs-6 mt4">
        <h4 class="page-name">User List</h4>
      </div>
      <div class="col-xs-6">       
       <?php include(BASIC_PATH."layout/sub_header.php"); ?>
     </div>
     
      <div class="col-sm-12">
        <div class="form-inline">
            <div class="form-group">
            <input type="text" onkeyup="searchFilter()" name="search" placeholder="seacrh User" id="keywords" class="form-control">
           </div>
      </div>
     <div class="clearfix"></div>
     
     <div class="col-sm-12 text-right">
      <div class="sorting pull-left">
        Show:
        <a href="javascript:;" data-filter="all" class="active search_creator">All</a>
      </div>
    </div>
    <div class="container mb5">
      <div class="row">
        <div class="col-sm-12">
          <table class="table header-fix">
            <thead>
              <tr><th>Name</th><th>Email</th><th>Role</th><th class="text-center">Action</th></tr>
            </thead>
            <tbody id="posts_content">
              <?php

               $limit = 10;

                  $resultNum = $crud->getData("select count(*) as postNum from users ");
                  $rowCount = $resultNum[0]['postNum'];
                  $pagConfig = array(
                      'totalRows' => $rowCount,
                      'perPage' => $limit,
                      'link_func' => 'searchFilter'
                  );
                  $pagination =  new Pagination($pagConfig);

                    $query="select * from users order by id desc limit $limit";
                    $result=$crud->getData($query);
                    if($result)
                    {
                      for($i=0;$i<count($result);$i++)
                      {
                        $role="User";
                        if($result[$i]['appadmin']==1)
                        {
                          $role="Admin";
                        }
                        else if($result[$i]['claadmin']==1)
                        {
                          $role="Manager";
                        }
                        else if($result[$i]['clacreator']==1)
                        {
                          $role="Creator";
                        }
                        
                        echo '<tr>';
                        echo '<td><span class="Name">'.$result[$i]['name'].'</span></td>';
                        echo '<td><span class="Email">'.$result[$i]['email'].'</span></td>';
                        echo '<td><span class="Role">'.$role.'</span></td>'; 
                        echo '<td class="text-center"><button class="btn btn-default m_l10 edit_user"  data-id="'.$result[$i]['id'].'">Edit</button> 
                        </td></tr>';           
                        
                    }
                       echo  $pagination->createLinks(); 

                }
        ?> 
      </tbody>
    </table> 
  </div>
</div>
<br /><br /><br />
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<?php require(BASIC_PATH."layout/footer.php"); ?>
<script src="<?php echo PATH ?>js/user.js"></script>

<script type="text/javascript">
  function searchFilter(page_num) {
    page_num = page_num?page_num:0;
    var keywords = $('#keywords').val();
    $.ajax({
        type: 'POST',
        url: path+'admin/search.php',
        data:'page='+page_num+'&keywords='+keywords+'&seacrh_submit='+1,
        beforeSend: function () {
            $('.loading-overlay').show();
        },
        success: function (html) {
            $('#posts_content').html(html);
            $('.loading-overlay').fadeOut("slow");
        }
    });
}
</script>