<?php
/**
 * The update 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 '../../../sys/common/view/header.modal.html.php';?>
<?php include '../../../sys/common/view/datepicker.html.php';?>
<div class='main-row'>
  <form id='ajaxForm' method='post' action='<?php echo inlink('batchCreate');?>'>
    <table class="table table-data monthTable">
      <tr>
        <td class='w-200px'>
          <div class='input-group'>
            <span class='input-group-addon'><?php echo $lang->bonus->month;?></span>
            <?php echo html::input('month', date(DT_DATE1, strtotime($month . '01')), "class='form-control form-date date-picker-down'");?>
          </div>
        </td>
        <td class='text-middle'><?php echo $lang->bonus->monthTips;?></td>
      </tr>
    </table>
    <table class="table table-bordered table-hover">
      <thead>
        <tr class='text-center bg-gray-pale'>
          <th class='w-80px'><?php echo $lang->bonus->account;?></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>
        </tr>
      </thead>
      <tbody>
        <?php foreach($users as $user):?>
        <?php $basic = zget($basics, $user->account);?>
        <tr class='text-center text-middle'>
          <td>
            <?php echo $user->realname;?>
            <?php echo html::hidden("account[{$user->id}]", $user->account);?>
            <?php echo html::hidden("dept[{$user->id}]", $user->dept);?>
          </td>
          <td><?php echo html::input("performance[{$user->id}]", isset($basic->performance) ? $basic->performance : '', "id='performance{$user->id}' class='form-control'");?></td>
          <td><?php echo html::input("bonus[{$user->id}]", '', "id='bonus{$user->id}' class='form-control'");?></td>
          <td><?php echo html::textarea("desc[{$user->id}]", '', "id='bonus{$user->id}' rows='1' class='form-control'");?></td>
        </tr>
        <?php endforeach;?>
      </tbody>
    </table>
    <div class='form-actions text-center'><?php echo html::submitButton()?></div>
  </form>
</div>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
