<?php
/**
 * The browse view file of bonus module of ZDOO.
 *
 * @copyright   Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     商业软件，非开源软件
 * @author      Tao Lv <lvtao@cnezsoft.com>
 * @package     commission
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../common/view/header.html.php';?>
<div id='menuActions'>
  <?php commonModel::printLink('bonus', 'batchCreate', "month={$month}", "<i class='icon icon-plus'> </i>" . $lang->bonus->batchCreate, "class='btn btn-primary' data-toggle='modal'");?>
</div>
<div class='panel main-table' data-ride='table'>
  <table class='table table-fixed'>
    <thead>
      <tr class="text-center">
        <th class="w-60px"><?php echo $lang->bonus->id;?></th>
        <th class="w-60px"><?php echo $lang->bonus->month;?></th>
        <th class="w-120px"><?php echo $lang->bonus->account;?></th>
        <th class="w-120px"><?php echo $lang->bonus->dept;?></th>
        <th class="w-120px"><?php echo $lang->bonus->performance;?></th>
        <th class="w-120px"><?php echo $lang->bonus->bonus;?></th>
        <th><?php echo $lang->bonus->desc;?></th>
        <th class='w-80px'><?php echo $lang->bonus->status;?></th>
        <th class="w-120px"><?php echo $lang->actions;?></th>
      </tr>
    </thead>
    <tbody>
      <?php foreach($bonuses as $bonus):?>
      <tr class='text-center'>
        <td><?php echo $bonus->id;?></td>
        <td><?php echo $bonus->month;?></td>
        <td><?php echo zget($users, $bonus->account);?></td>
        <td><?php echo zget($depts, $bonus->dept, '');?></td>
        <td><?php echo $bonus->performance;?></td>
        <td><?php echo $bonus->bonus;?></td>
        <td class='text-left' title='<?php echo $bonus->desc;?>'><?php echo $bonus->desc;?></td>
        <td class='bonus-<?php echo $bonus->status;?>'><?php echo zget($lang->bonus->statusList, $bonus->status);?></td>
        <td>
          <?php
          if($bonus->status == 'wait')
          {
              commonModel::printLink('hr.bonus', 'edit', "id={$bonus->id}", $lang->edit, "data-toggle='modal'");
              commonModel::printLink('hr.bonus', 'confirm', "month={$month}&id={$bonus->id}", $lang->confirm, "class='jsoner'");
          }
          else
          {
              echo html::a('javascript:;', $lang->edit, "class='disabled'");
              echo html::a('javascript:;', $lang->confirm, "class='disabled'");
          }
          commonModel::printLink('hr.bonus', 'delete', "month={$month}&id={$bonus->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';?>
