123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- {template 'common/header'}
- <style>
- .account-stat-num > div{width:33.333%; float:left; font-size:16px; text-align:center;}
- .account-stat-num > div span{display:block; font-size:30px; font-weight:bold;}
- </style>
- <ul class="nav nav-tabs">
- <li class="active"><a href="{php echo url('stat/card')}">会员卡领卡统计</a></li>
- </ul>
- <div class="panel panel-default">
- <div class="panel-heading">
- 会员卡统计
- </div>
- <div class="panel-body">
- <div class="account-stat-num row">
- <div>会员卡总数<span>{$total}</span></div>
- <div>今日领卡<span>{$today}</span></div>
- <div>昨日领卡<span>{$yesterday}</span></div>
- </div>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- 会员卡统计
- </div>
- <div class="panel-body" id="scroll">
- <div class="pull-left">
- <form action="" id="form1">
- <input name="c" value="stat" type="hidden" />
- <input name="a" value="card" type="hidden" />
- {php echo tpl_form_field_daterange('time', array('start' => date('Y-m-d', $starttime),'end' => date('Y-m-d', $endtime)), '')}
- <input type="hidden" value="" name="scroll">
- </form>
- </div>
- <div style="margin-top:20px">
- <canvas id="myChart" width="1200" height="300"></canvas>
- </div>
- </div>
- </div>
- <script>
- require(['chart', 'daterangepicker'], function(c) {
- $('.daterange').on('apply.daterangepicker', function(ev, picker) {
- $('#form1')[0].submit();
- });
- var chart = null;
- var templates = {
- label: '领卡数',
- fillColor : "rgba(149,192,0,0.1)",
- strokeColor : "rgba(149,192,0,1)",
- pointColor : "rgba(149,192,0,1)",
- pointStrokeColor : "#fff",
- pointHighlightFill : "#fff",
- pointHighlightStroke : "rgba(149,192,0,1)"
- };
-
- var url = location.href + '&#aaaa';
- $.post(url, function(data){
- var data = $.parseJSON(data)
- var datasets = data.datasets;
-
- if(!chart) {
- var label = data.label;
- console.dir(label);
- templates.data = datasets;
- var lineChartData = {
- labels : label,
- datasets : [templates]
- };
-
- var ctx = document.getElementById("myChart").getContext("2d");
- chart = new Chart(ctx).Line(lineChartData, {
- responsive: true
- });
- }
- });
- });
- </script>
- {template 'common/footer'}
|