<?php
/**
 * The admin view file of user 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      Yangyang Shi <shiyangyangwork@yahoo.cn>
 * @package     User
 * @version     $Id: admin.html.php 4029 2016-08-26 06:50:41Z liugang $
 * @link        http://www.zdoo.com
 */
?>
<?php if($this->appName == 'welfare'):?>
<?php include '../../common/view/header.html.php';?>
<?php else:?>
<?php include '../../my/view/header.html.php';?>
<?php endif;?>
<?php js::set('mode', $type);?>
<li id='bysearchTab'><?php echo html::a('#', "<i class='icon-search icon'></i>" . $lang->search->common)?></li>
<div class='panel main-table' data-ride='table'>
  <table class='table has-sort-head'>
    <thead>
      <tr class='text-center'>
        <?php $vars = "type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
        <th class='w-60px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->score->id);?></th>
        <th class='w-160px'><?php commonModel::printOrderLink('time', $orderBy, $vars, $lang->score->time);?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('giver', $orderBy, $vars, $lang->score->giver);?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('receiver', $orderBy, $vars, $lang->score->receiver);?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('dept', $orderBy, $vars, $lang->score->dept);?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->score->type);?></th>
        <th class='w-120px'><?php commonModel::printOrderLink('rule', $orderBy, $vars, $lang->score->behavior);?></th>
        <th class='w-60px'><?php commonModel::printOrderLink('score', $orderBy, $vars, $lang->score->score);?></th>
        <th class='text-left'><?php echo $lang->score->desc;?></th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($scores as $score):?>
      <?php $rule  = zget($rules, $score->rule);?>
      <?php $giver = zget($users, $score->giver);?>
      <?php if($giver == 'system') $giver = $lang->score->system;?>
      <?php $receiver = zget($users, $score->receiver, '');?>
      <?php if($receiver == '') $receiver = zget($depts, $score->receiver);?>
      <tr class='text-center'>
        <td><?php echo $score->id;?></td>
        <td><?php echo $score->time;?></td>
        <td><?php echo $giver;?></td>
        <td><?php echo $receiver;?></td>
        <td><?php echo zget($depts, $score->dept, '');?></td>
        <td><?php echo zget($lang->score->grantTypeList, $score->type);?></td>
        <td><?php echo $score->rule ? zget($rule, 'name') : zget(zget($lang->score->methods, $score->module), $score->method);?></td>
        <td><?php echo $score->type == 'bonus' ? abs($score->score) : $score->score;?></td>
        <td class='text-left text-ellipsis' title="<?php echo $score->desc;?>"><?php echo $score->desc;?></td>
      </tr>
      <?php endforeach;?>
    </tbody>
  </table>
  <div class='table-footer'>
    <?php $pager->show();?>
  </div>
</div>
<?php include '../../common/view/footer.html.php';?>
