<?php use_helper('tvtl', 'ModalBox'); ?>
<?php $cache_file = 'user_list_'.$type.'_'.$page ?>
<?php if ($page==1 && !begin_html_cache($cache_file)) return ?>

<?php echo gridTab(array('all'=>'Danh sách thành viên đầy đủ', 'short'=>'Danh sách thành viên rút gọn'), '/user/list?page='.$page.'&type=', $type) ?>
<div class="doc" id="info-show">
  <h2></h2>
  <div class="content">
    <?php if ($type == 'all'): ?>
      <?php foreach ($pager->getResult() as $key => $result):?>
        <?php if ($key > 0) echo '<hr>' ?>
        <?php $tbluser = $mainBlog? $result: $result->getTbluser() ?>
        <?php include_component('user', 'userinfo', array('tbluser'=>$tbluser, 'linkName'=>true, 'allow'=>'user_info_listing')) ?>
      <?php endforeach;?>

    <?php else: ?>
      <table class="table-content" style="width:100%">
        <tr>
          <th width="35%">Họ và tên</th>
          <th width="40%">Đơn vị</th>
          <th width="15%">Chức vụ</th>
          <th width="10%">Điểm</th>
        </tr>
        <?php foreach ($pager->getResult() as $key => $result):?>
          <?php $tbluser = $mainBlog? $result: $result->getTbluser() ?>
          <tr class="row<?php echo $key%2?>">
            <td><?php echo $tbluser->getObject()->getHtmlName(true) ?></td>
            <td><?php echo $tbluser->getSchoolName().'<br>'.$tbluser->getDistrictName().' - '.$tbluser->getProvinceName() ?></td>
            <td><?php echo $tbluser->getPositionTitle() ?></td>
            <td><?php echo $tbluser->getUsScore() ?></td>
          </tr>
        <?php endforeach;?>
      </table>
    <?php endif; ?>
    <br>
    <center><?php echo showPageNav13($pager,'/user/list?type='.$type) ?></center>
  </div>
</div>
<?php if ($page==1) end_html_cache($cache_file) ?>
