<?php
/**
 * The browse view file of group module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Xiying Guan <guanxiying@xirangit.com>
 * @package     group
 * @version     $Id: browse.html.php 4769 2013-05-05 07:24:21Z wwccss $
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/sortable.html.php';?>
<?php js::set('recPerPage', $pager->recPerPage);?>
<?php js::set('pageID', $pager->pageID);?>
<div id='menuActions'>
  <?php echo html::a($this->inlink('create'), $lang->group->create, "class='btn btn-primary' data-toggle='modal'");?>
</div>
<div class='panel main-table' data-ride='table'>
  <table class='table table-fixed has-sort-head'>
    <thead>
      <tr>
       <?php $vars = "orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?>
       <th class='w-60px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->group->id);?></th>
       <th class='w-60px'><?php commonModel::printOrderLink('order', $orderBy, $vars, $lang->group->order);?></th>
       <th class='w-200px'><?php commonModel::printOrderLink('name', $orderBy, $vars, $lang->group->name);?></th>
       <th class='w-300px'><?php echo $lang->group->desc;?></th>
       <th><?php echo $lang->group->users;?></th>
       <th class='w-<?php echo $lang->group->actionWidth;?>px text-center'><?php echo $lang->actions;?></th>
      </tr>
    </thead>
    <tbody class='sortable' id='groupList'>
    <?php foreach($groups as $group):?>
    <?php $users = zget($groupUsers, $group->id, '');?>
    <tr data-id='<?php echo $group->id;?>'>
      <td class='text-center'><?php printf('%03d', $group->id);?></td>
      <td class='text-center sort-handler'><i class='icon icon-move text-muted'></i></td>
      <td><?php echo $group->name;?></td>
      <td title='<?php echo $group->desc;?>'><?php echo $group->desc;?></td>
      <td class='user-list' title='<?php echo $users;?>'>
        <div class='names'>
          <?php echo $users;?>
          <a class ="hide-list" href="javascript:#"><?php echo $lang->group->hide;?></a>
        </div>
        <a class ="more-list" href="javascript:#"><?php echo $lang->group->show;?></a>
      </td>
      <td class='text-center'>
        <?php echo html::a(inlink('manageAppPriv', "type=byGroup&param={$group->id}"), $lang->group->manageAppPriv);?>
        <?php echo html::a(inlink('manageMember', "groupID={$group->id}"), $lang->group->manageMember);?>
        <?php echo html::a(inlink('managePriv', "type=byGroup&param={$group->id}"), $lang->group->managePriv);?>
        <?php echo html::a(inlink('edit', "groupID={$group->id}"), $lang->edit, "data-toggle='modal'");?>
        <?php echo html::a(inlink('delete', "groupID={$group->id}"), $lang->delete, "class='deleter'");?>
      </td>
    </tr>
    <?php endforeach;?>
    </tbody>
  </table>
  <div class='table-footer'><?php $pager->show();?></div>
</div>
<?php include '../../common/view/footer.html.php';?>
