<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.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">

    <aside>
    <section>
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-12">
                    <form class="form-inline" role="form" method="POST" action="#permission/log" name="stanpform">
                        <span class="gap"></span>
                        <div class="form-group">
                            <label>开始时间</label>
                            <input type="text" class="form-control datetimepicker" value="<?php if($stime) echo $stime;?>" placeholder="开始时间" name="stime" />
                        </div>
                        <span class="gap"></span>
                        <div class="form-group">
                            <label>结束时间</label>
                            <input type="text" class="form-control datetimepicker" value="<?php if($etime) echo $etime;?>" placeholder="结束时间" name="etime" />
                        </div>
                        <span class="gap"></span>
                        <div class="form-group">
                            <label>关键字</label>
                            <input type="text" class="form-control" value="<?php if($key) echo $key;?>" placeholder="关键字" name="key" />
                        </div>
                        <button type="submit" class="btn btn-primary">查询</button>
                    </form>
                </div>
            </div>
        </div>
    </section>
    </aside>

<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 id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                    <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>uid</th>
                                        <th>username</th>
                                        <th>原因</th>
                                        <th>url</th>
                                        <th>uri</th>
                                        <th>时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php
                                    if(is_array($list)){
                                        foreach ($list as $key => $val) {
                                            ?>
                                            <tr>
                                                <td><?php echo $val['id'];?></td>
                                                <td><?php echo $val['uid'];?></td>
                                                <td><?php echo $val['username'];?></td>
                                                <td><?php echo $val['reason'];?></td>
                                                <td><?php echo $val['url'];?></td>
                                                <td><?php echo $val['uri'];?></td>
                                                <td><?php echo date("Y-m-d H:i:s",$val['add_time']);?></td>
                                                <td>
                                                    <button class="btn btn-primary view-parameter" type="button" content='<?php echo $val['parameter'];?>'>查看请求参数</button>
                                                </td>
                                            </tr>
                                        <?php } } else{?>
                                        <tr>
                                            <td colspan="10">暂无数据</td>
                                        </tr>
                                    <?php } ?>
                                    </tbody>

                                    </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>


<div class="modal fade" id="actionContent" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" >请求参数内容</h4>
            </div>
            <form class="form-horizontal J_ajaxForm" role="form" >
                <div class="modal-body" id="modelBody">

                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/modules/exporting.js"></script>
<script type="text/javascript">

</script>
<script type="text/javascript">
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });

    $(document).on("click",".view-parameter",function(){
        var content = $(this).attr("content");
        $("#modelBody").html("<pre style='height:300px'>"+content+"</pre>");
        $('#actionContent').modal('show');
    });
</script>