<?php
/**
 * The create score rule view file of score module of ZDOO.
 *
 * @copyright   Copyright 2009-2020 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Gang Liu <liugang@easycorp.ltd>
 * @package     score
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../sys/common/view/header.modal.html.php';?>
<?php js::set('deptCount', count($deptsOption));?>
<form id='grantForm' method='post' action='<?php echo inlink('grantBonus');?>'>
  <table class='table table-form'>
    <tr id='scoreBalance'>
      <th class='w-60px'></th>
      <td>
        <?php if(!empty($depts)):?>
        <div id='balanceTip' class='alert alert-warning no-margin'><?php foreach($depts as $dept) echo sprintf($lang->score->descList->deptScore, $dept->name , $dept->score);?></div>
        <?php endif;?>
      </td>
    </tr>
    <tr <?php if(count($deptsOption) < 2) echo "class='hide'";?>>
      <th><?php echo $lang->score->dept;?></th>
      <td>
        <div class='required required-wrapper'></div>
        <?php echo html::select('dept', $deptsOption, '', "class='form-control'");?>
      </td>
    </tr>
    <tr>
      <th><?php echo $lang->score->account;?></th>
      <td id='accountTD'><?php echo html::select('account[]', array(''), '', "class='form-control chosen' multiple");?></td>
    </tr>
    <tr>
      <th><?php echo $lang->score->score;?></th>
      <td><?php echo html::number('score', '', "class='form-control' min='-999' max='999'");?></td>
    </tr>
    <tr>
      <th><?php echo $lang->score->desc;?></th>
      <td><?php echo html::textarea('desc', '', "class='form-control'");?></td>
    </tr>
    <tr>
      <th></th>
      <td class='form-actions'>
        <?php echo html::submitButton();?>
        <?php echo html::commonButton($lang->cancel, 'btn', "data-dismiss='modal'");?>
      </td>
    </tr>
  </table>
</form>
<?php include '../../../sys/common/view/footer.modal.html.php';?>
