<?php
/**
 * The set reviewer view file of refund module of ZDOO.
 *
 * @copyright   Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Gang Liu <liugang@cnezsoft.com>
 * @package     refund 
 * @version     $Id$
 * @link        http://www.zdoo.com
 */
?>
<?php include '../../../common/view/header.html.php';?>
<?php js::set('turnon', empty($config->refund->multiReviewer) ? 0 : 1);?>
<?php if(!$module):?>
<div class='main-row'>
  <?php include '../../view/side.html.php';?>
  <div class='main-col'>
<?php endif;?>
    <div class='panel panel-block'>
      <div class='panel-heading'>
        <strong><?php echo $lang->refund->setReviewer;?></strong>
      </div>
      <div class='panel-body'>
        <form id='ajaxForm' method='post'>
          <table class='table table-form'>
            <tr>
              <th class='w-80px'><?php echo $lang->refund->multiReviewer;?></th>
              <td class='w-160px'><?php echo html::radio('turnon', $lang->refund->multiReviewerStatusList, !empty($config->refund->multiReviewer));?></td>
              <td class='w-200px'></td>
              <td></td>
            </tr>
            <?php $i = 1;?>
            <?php if(!empty($config->refund->multiReviewer)):?>
            <?php foreach($config->refund->multiReviewer as $reviewer):?>
            <?php $reviewer = json_decode($reviewer);?>
            <tr>
              <th><?php echo $i++;?></th>
              <td><?php echo html::select('multiReviewer[]', $users, $reviewer->reviewer, "class='form-control chosen multiReviewer'")?></td>
              <td><?php echo html::input('reviewerMoney[]', $reviewer->money, "class='form-control' placeholder='{$lang->refund->money}'");?></td>
              <td>
                <a class='btn addItem'><i class='icon icon-plus'></i></a>
                <a class='btn delItem'><i class='icon icon-remove'></i></a>
              </td>
            </tr>
            <?php endforeach;?>
            <?php else:?>
            <tr>
              <th><?php echo $i++;?></th>
              <td><?php echo html::select('multiReviewer[]', $users, '', "class='form-control chosen multiReviewer'")?></td>
              <td><?php echo html::input('reviewerMoney[]', '', "class='form-control' placeholder='{$lang->refund->money}'");?></td>
              <td>
                <a class='btn addItem'><i class='icon icon-plus'></i></a>
                <a class='btn delItem'><i class='icon icon-remove'></i></a>
              </td>
            </tr>
            <?php endif;?>
            <tr>
              <th><?php echo $lang->refund->firstReviewer;?></th>
              <td><?php echo html::select('firstReviewer', $firstReviewers, $firstReviewer, "class='form-control chosen singleReviewer'")?></td>
              <td></td>
              <td></td>
            </tr>
            <tr>
              <th><?php echo $lang->refund->secondReviewer;?></th>
              <td><?php echo html::select('secondReviewer', $secondReviewers, $secondReviewer, "class='form-control chosen singleReviewer'");?></td>
              <td>
                <div class='input-group'>
                  <span class='input-group-addon'><?php echo $lang->refund->money;?></span>
                  <?php echo html::input('money', zget($config->refund, 'money', ''), "class='form-control'");?>
                </div>
              </td>
              <td><?php echo html::a('javascript:;', "<i class='icon-question-sign'></i>", "data-original-title='{$lang->refund->moneyTip}' data-toggle='tooltip'");?></td>
            </tr>
            <tr>
              <th></th>
              <td colspan='3' class='form-actions'><?php echo html::submitButton();?></td>
            </tr>
          </table>
        </form>
      </div>
    </div>
<?php if(!$module):?>
  </div>
</div>
<?php endif;?>
<?php js::set('index', $i);?>
<?php include '../../../common/view/footer.html.php';?>
