<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>public/plugins/datatables/jquery.dataTables.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>public/plugins/datatables/extensions/Responsive/css/dataTables.responsive.css">
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<div class="content_wrapper">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline" role="form" method="POST" action="#/payment/failOrder">
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>流水号:</label>
                                            <input type="text" class="form-control" placeholder="流水号" name="sl_platform_serial_num" value="<?php echo $sl_platform_serial_num ?? '';?>">
                                        </div>

                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>开始时间: </label>
                                                <input type="text" class="form-control datetimepicker" value="<?php echo $stime ?? '';?>" placeholder="开始时间" name="payment_stime" />
                                        </div>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>结束时间: </label>
                                                <input type="text" class="form-control datetimepicker" value="<?php echo $etime ?? '';?>" placeholder="结束时间" name="payment_etime" />
                                        </div>
                                        <span class="gap"></span>
                                        <button type="submit" class="btn btn-primary">查询</button>
                                        <a href="<?php echo site_url().'/payment/exportFailOrder'?>" target="_blank" class="btn btn-default pull-right" >导出</a>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>发货失败订单记录</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>序号</th>
                                                <th>ID</th>
                                                <th>用户ID</th>
                                                <th>游戏内商品ID</th>
                                                <th>平台商品ID</th>
                                                <th>下单时间</th>
                                                <th>支付渠道</th>
                                                <th>设备平台</th>
                                                <th>流水号</th>
                                                <th>商品sku</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                                if(is_array($list) && !empty($list)){
                                                    foreach ($list as $key => $val) {
                                            ?>
                                                <tr>
                                                    <td><?php echo $page + $key + 1;?></td>
                                                    <td><?php echo $val['pid'];?></td>
                                                    <td><?php echo $val['uid'];?></td>
                                                    <td><?php echo $val['gid'];?></td>
                                                    <td><?php echo $val['order_id'];?></td>
                                                    <td><?php echo date('Y-m-d H:i:s', $val['order_time']);?></td>
                                                    <td><?php echo isset($channelList[$val['sid']]) ? $channelList[$val['sid']] : '-';?></td>
                                                    <td><?php echo isset($platformList[$val['sid']]) ? $platformList[$val['sid']] : '-';?></td>
                                                    <td><?php echo $val['platform_serial_num'];?></td>
                                                    <td><?php echo $val['sku'];?></td>
                                                </tr>
                                            <?php }} else{?>
                                                <tr>
                                                    <td colspan="10">暂无数据</td>
                                                </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                    <nav>
                                        <ul class="pagination">
                                            <li class="disabled"><a href="#">共<span class="pagetotal"><?php echo $total;?></span>条</a></li>
                                            <?php echo $pageurl;?>
                                        </ul>
                                    </nav>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

</div>

<script>
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>
<script src="<?php echo base_url();?>public/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>public/plugins/datatables/extensions/Responsive/js/dataTables.responsive.min.js"></script>
