<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">
        <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">
                                    <form class="form-inline" role="form" method="POST" action="#abnormal/upStarsLine">
                                        <span class="gap"></span>
                                        
                                        <div class="form-group">
                                            <label>查询玩家:</label>
                                            
                                            <input type="text" class="form-control" value="<?php if($uid) echo $uid;?>" placeholder="uid" name="uid" />
                                        </div>
                                        <span class="gap"></span>
                                        <button type="button" class="btn btn-primary" id="query">查询</button>
                                        <span class="gap"></span>
                                    </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 id="container1" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
            
            <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 id="containerDay" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        
    </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">
	$(document).on("click","#query",function(){
		var uid = $("input[name='uid']").val();
		location.href = "#abnormal/upStarsLine/"+uid;
	})
	
	
    Highcharts.chart('container1', {
        chart: {
            type: 'line'
        },
        title: {
            text: '玩家升级曲线'
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: ["<?php echo implode('","',$num); ?>"]
        },
        yAxis: [{ // Primary yAxis
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            title: {
                text: '数值(天)',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            }
        }, { // Secondary yAxis
            title: {
                text: '日期',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            opposite: true
        }],
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [
            {
                name:'时间',
                data:[<?php echo implode(',',$time); ?>]
            },
            // {
            //     name:'日期',
            //     yAxis: 1,
            //     data:[<?php echo implode(',',$time2); ?>]
            // }
        ]
    });
    
    Highcharts.chart('containerDay', {
        chart: {
            type: 'line'
        },
        title: {
            text: '玩家升级曲线'
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: ["<?php echo implode('","',$dateTemp); ?>"]
        },
        yAxis: [{ // Primary yAxis
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            title: {
                text: '等级',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            }
        }, { // Secondary yAxis
            title: {
                text: '日期',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            labels: {
                format: '{value}',
                style: {
                    color: Highcharts.getOptions().colors[1]
                }
            },
            opposite: true
        }],
        plotOptions: {
            line: {
                dataLabels: {
                    enabled: true
                },
                enableMouseTracking: false
            }
        },
        series: [
            {
                name:'等级',
                data:[<?php echo implode(',',$dayData); ?>]
            }
        ]
    });
</script>
<script type="text/javascript">
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>