{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>{$Think.lang.refund_manage}</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示" class="arrow"></span>
        </div>
        <ul>
            <li>买家提交申请，商家同意并经平台确认后，退款金额以预存款的形式返还给买家（充值卡部分只能退回到充值卡余额）。</li>
        </ul>
    </div>
    
    <form method="get">
        <table class="search-form">
            <tbody>
                <tr>
                    <th>
                        <select name="type">
                            <option value="order_sn" {if condition="$Think.get.type eq 'order_sn'"}selected{/if}>{$Think.lang.refund_order_ordersn}</option>
                            <option value="refund_sn" {if condition="$Think.get.type eq 'refund_sn'"}selected{/if}>{$Think.lang.refund_order_refundsn}</option>
                            <option value="store_name" {if condition="$Think.get.type eq 'store_name'"}selected{/if}>{$Think.lang.refund_store_name}</option>
                            <option value="goods_name" {if condition="$Think.get.type eq 'goods_name'"}selected{/if}>商品名称</option>
                            <option value="buyer_name" {if condition="$Think.get.type eq 'buyer_name'"}selected{/if}>{$Think.lang.refund_order_buyer}</option>
                        </select>
                    </th>
                    <td><input type="text" class="text" name="key" value="{$Think.get.key}" /></td>
                    <th><label for="add_time_from">申请时间</label></th>
                    <td><input class="txt date" type="text" value="{$Think.get.add_time_from}" id="add_time_from" name="add_time_from">
                        <label for="add_time_to">~</label>
                        <input class="txt date" type="text" value="{$Think.get.add_time_to}" id="add_time_to" name="add_time_to"/>
                    </td>
                    <td>                    
                        <label class="submit-border">
                            <input type="submit" class="submit" value="搜索">
                        </label>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>


    <table class="ds-default-table">
        <thead>
            <tr class="thead">
                <th>{$Think.lang.refund_order_ordersn}</th>
                <th>{$Think.lang.refund_order_refundsn}</th>
                <th>{$Think.lang.refund_store_name}</th>
                <th>商品名称</th>
                <th>{$Think.lang.refund_order_buyer}</th>
                <th class="align-center">{$Think.lang.refund_buyer_add_time}</th>
                <th class="align-center">商家审核时间</th>
                <th class="align-center">{$Think.lang.refund_order_refund}</th>
                <th class="align-center">{$Think.lang.ds_handle}</th>
            </tr>
        </thead>
        <tbody>
            <?php if (is_array($refund_list) && !empty($refund_list)) { ?>
            <?php foreach ($refund_list as $key => $val) { ?>
            <tr class="bd-line" >
                <td><?php echo $val['order_sn'];?></td>
                <td><?php echo $val['refund_sn'];?></td>
                <td><?php echo $val['store_name']; ?></td>
                <td><?php echo $val['goods_name']; ?></td>
                <td><?php echo $val['buyer_name']; ?></td>
                <td class="align-center"><?php echo date('Y-m-d H:i:s',$val['add_time']);?></td>
                <td class="align-center"><?php echo date('Y-m-d H:i:s',$val['seller_time']); ?></td>
                <td class="align-center"><?php echo $val['refund_amount'];?></td>
                <td class="align-center"><a href="{:url('/Admin/Refund/edit',['refund_id'=>$val.refund_id])}">确认</a></td>
            </tr>
            <?php } ?>
        </tbody>
        <?php } else { ?>
        <tbody>
            <tr class="no_data">
                <td colspan="20">{$Think.lang.no_record}</td>
            </tr>
        </tbody>
        <?php } ?>
    </table>
    <?php if (is_array($refund_list) && !empty($refund_list)) { ?>
    {$show_page}
    <?php } ?>
</div>

<script type="text/javascript">
    $(function() {
        $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
        $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
    });
</script>
