{include file="public/header" /}
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>虚拟订单退款</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
  <div class="fixed-bar">
    <div class="item-title">
      <h3>虚拟订单退款</h3>
      <ul class="tab-base">
        <li><a href="{:url('vrrefund/refund_manage')}"><span><?php echo '待审核';?></span></a></li>
        <li><a href="{:url('vrrefund/refund_all')}"><span><?php echo '所有记录';?></span></a></li>
        <li><a href="JavaScript:void(0);" class="current"><span><?php echo '审核';?></span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="post_form" method="post" action="{:url('vrrefund/edit',['refund_id'=>$refund.refund_id])}">
    <input type="hidden" name="form_submit" value="ok" />
    <table class="table tb-type2">
      <tbody>
        <tr>
          <td colspan="2" class="required">{$Think.lang.refund_order_refund}{$Think.lang.ds_colon}</td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><?php echo dsPriceFormat($refund['refund_amount']); ?>{$Think.lang.ds_search}</td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required">商品名称{$Think.lang.ds_colon}</td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><a href="{:url('/Home/Goods/index',['goods_id'=>$refund.goods_id])}" target="_blank"><?php echo $refund['goods_name']; ?></a></td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required">退款兑换码{$Think.lang.ds_colon}</td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
        <?php if (is_array($code_array) && !empty($code_array)) { ?>
          <?php foreach ($code_array as $key => $val) { ?>
          <?php echo $val;?><br />
          <?php } ?>
        <?php } ?>
            </td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required">退款说明{$Think.lang.ds_colon}</td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><?php echo $refund['buyer_message']; ?></td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required"><label class="validation">是否同意{$Think.lang.ds_colon}</label>
            </td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform onoff">
            <label for="state1" class="cb-enable" title="{$Think.lang.ds_yes}"><span>{$Think.lang.ds_yes}</span></label>
            <label for="state0" class="cb-disable" title="{$Think.lang.ds_no}"><span>{$Think.lang.ds_no}</span></label>
            <input id="state1" name="admin_state"  value="2" type="radio">
            <input id="state0" name="admin_state" value="3" type="radio"></td>
          <td class="vatop tips"></td>
        </tr>
        <tr>
          <td colspan="2" class="required"><label class="validation">{$Think.lang.refund_message}{$Think.lang.ds_colon}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
        	<textarea id="admin_message" name="admin_message" class="tarea"></textarea></td>
          <td class="vatop tips"></td>
        </tr>

      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>{$Think.lang.ds_submit}</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.nyroModal/custom.min.js" charset="utf-8"></script>
<link href="<?php echo RESOURCE_SITE_URL;?>/js/jquery.nyroModal/styles/nyroModal.css" rel="stylesheet" type="text/css" id="cssfile2" />
<script type="text/javascript">
$(function(){
    $('.nyroModal').nyroModal();
	$("#submitBtn").click(function(){
    if($("#post_form").valid()){
     $("#post_form").submit();
		}
	});
    $('#post_form').validate({
		errorPlacement: function(error, element){
			error.appendTo(element.parentsUntil('tr').parent().prev().find('td:first'));
        },
        rules : {
            admin_state : {
                required   : true
            },
            admin_message : {
                required   : true
            }
        },
        messages : {
            admin_state : {
                required   : '请选择是否同意退款'
            },
            admin_message  : {
                required   : '{$Think.lang.refund_message_null}'
            }
        }
    });
});
</script>