<div class="tab-container">
   <div class="row">
      <div class="col-lg-12 table-responsive">
         <h4 ><?php echo $wo['lang']['manage_pages'];?></h4>
         <table class="table table-hover table-bordered table-striped table-condensed setting-table">
            <thead>
               <tr>
                  <th><?php echo $wo['lang']['id'];?></th>
                  <th><?php echo $wo['lang']['page_name'];?></th>
                  <th><?php echo $wo['lang']['page_title'];?></th>
                  <th><?php echo $wo['lang']['owner'];?></th>
                  <th><?php echo $wo['lang']['category'];?></th>
                  <th><?php echo $wo['lang']['action'];?></th>
               </tr>
            </thead>
            <tbody class="page-result manage-pages-list">
               <?php 
               foreach (Wo_GetAllPages(10) as $wo['pagelist']) {
                  echo Wo_LoadPage('admin/manage_pages/pages-list');
                }
               ?>
            </tbody>
         </table>
         <div class="view-more-wrapper view-more-pages-wrapper">
            <span class="text-center" onclick="Wo_GetMorePages();">
            <i class="fa fa-arrow-down progress-icon" data-icon="search"></i> <?php echo $wo['lang']['show_more_pages'];?>
            </span>
         </div>
         <span class="center-text"></span>
      </div>
   </div>
</div>
<script>
$(function() {
  view_more_pages_wrapper = $('.view-more-pages-wrapper');
});
function Wo_GetMorePages() {
  after_page_id = $('.manage-pages-list').find('.setting-pagelist:last').attr('data-page-id');
  Wo_progressIconLoader(view_more_pages_wrapper.find('.text-center'));
  $.get(Wo_Ajax_Requests_File() + '?f=admin_setting&s=get_more_pages', {after_page_id: after_page_id}, function(data) {
    if (data.html.length != 0) {
      $('tbody.page-result').append(data.html);
    } else {
      view_more_pages_wrapper.text("<?php echo $wo['lang']['no_more_pages'];?>");
      view_more_pages_wrapper.delay(1000).slideUp(200);
    }
    Wo_progressIconLoader(view_more_pages_wrapper.find('.text-center'));
  });
}

function Wo_DeletePage(page_id) {
  if (confirm("<?php echo $wo['lang']['page_delete_confirmation'];?>") == false) {
    return false;
  }
  $.get(Wo_Ajax_Requests_File(),{f:'admin_setting',s:'delete_page',page_id: page_id}, function(data) {
    if (data.status == 200) {
      $('#PageID_' + page_id).fadeOut(300, function() {
        $(this).remove();
      });
    }
  });
}

</script>