<?php
/**
 * The reimburse mobile view file of refund module of ZDOO.
 *
 * @copyright   Copyright 2009-2019 青岛易软天创网络科技有限公司(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
 */

if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>

<?php if(!helper::isAjaxRequest()):?>
<?php include "../../common/view/m.header.html.php";?>
<?php endif;?>

<div class='heading divider'>
  <div class='title'><i class='icon icon-plus'></i> <strong><?php echo $lang->refund->reimburse;?></strong></div>
  <?php if(helper::isAjaxRequest()):?>
  <nav class='nav'><a data-dismiss='display'><i class='icon-remove muted'></i></a></nav>
  <?php endif;?>
</div>

<form class='content box' data-display-from='refundReimburseModal' id='reimburseForm' method='post' action='<?php echo $this->createLink('refund', 'reimburse', "type=$type&refundID=$refundID");?>'>
  <div class='control'>
    <label for='money'><?php echo $lang->refund->reviewMoney;?></label>
    <div class='row'>
      <div class='cell-8'>
      <?php echo html::input('money', $money, "class='input' readonly");?>
      </div>
      <div class='cell-4'>
        <?php echo html::input('money', zget($lang->currencyList, $currency), "class='input' readonly");?>
      </div>
    </div>
  </div>
  <div class='control'>
    <label><?php echo $lang->refund->createTrade;?></label>
    <div class='radio inline-block'>
      <input type='radio' name='trade' checked="checked" value="yes">
      <label for="trade"><?php echo $lang->yes;?></label>
    </div>
    <div class='radio inline-block'>
      <input type='radio' name='trade' value="no">
      <label for="trade"><?php echo $lang->no;?></label>
    </div>
  </div>
</form>

<div class='footer has-padding'>
  <button type='button' data-submit='#reimburseForm' class='btn primary'><?php echo $lang->save;?></button>
</div>

<script>
$(function()
{
    $('#reimburseForm').modalForm(
    {
        onSuccess: function(response)
        {
            if(response.result == 'success' && response.trade == 'yes')
            {
                new $.Display({
                    remote: createLink('refund', 'createTrade', 'type=' + response.type + '&refundID=' + response.refundID),
                    display: 'modal',
                    placement: 'bottom'
                }).show();
                response.message = false;
                response.locate  = false;
            }
        }
    }).listenScroll({container: 'parent'});
});
</script>

<?php if(!helper::isAjaxRequest()):?>
<?php include "../../common/view/m.footer.html.php";?>
<?php endif;?>
