<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<script src="<!--{$urlpath}-->tpl/static/charts/highcharts.src.js"></script>
<script src="<!--{$urlpath}-->tpl/static/charts/modules/exporting.src.js"></script>
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>报表统计->注册会员报表</div>
  <div class="oe_content">
    <h6>会员注册报表分析</h6>
	<form id="moreform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="moremonths" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">选择月份范围：<span class="f_red">*</span></th>
		<td width="85%">
		  <input type="text" name="starttime" id="starttime" class="input-120" /> 至
		  <input type="text" name="endtime" id="endtime" class="input-120" value="<!--{$time|date_format:"%Y-%m"}-->" /> 
		  （月份格式如：<!--{$time|date_format:"%Y-%m"}-->）
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_more" class="button_2" value="查看报表" /> </td>
	  </tr>
	</table>
	</form>

  </div>
</div>
<script type="text/javascript">
$(function(){
	$("#btn_more").bind("click", function(){
		if ($("#starttime").val().length  == 0) {
			ToastShow("请输入起始月份", "starttime");
			return false;
		}
		$("#moreform").submit();
	});
});
</script>
<!--{/if}-->

<!--{if $a == "moremonths"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
    <i></i>报表统计->注册会员报表
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回选择</a></span>
  </div>
  <div class="oe_content">
    <h6><!--{$starttime}-->~<!--{$endtime}--> 注册会员统计</h6>

    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">个人会员：</th>
		<td width="35%">
		<!--{assign var='person_nums' value=count_chart("mod={user} type={count} where={v.type='1' AND <!--{$where}-->}")}-->
	    <!--{$person_nums}-->人
		</td>
		<th width="15%">商家会员：</th>
		<td width="35%">
		<!--{assign var='merchant_nums' value=count_chart("mod={user} type={count} where={v.type='2' AND <!--{$where}-->}")}-->
	    <!--{$merchant_nums}-->人
		</td>
	  </tr>
	  <tr>
	    <th colspan="4">图表</th>
	  </tr>
	  <tr>
	    <td colspan="4"><div id="sales-charts" style="margin:0 auto;width:98%;"></div></td>
	  </tr>
	</table>


  </div>
</div>
<script type="text/javascript">
$(function () {
	var chart;
	$(document).ready(function() {
		chart = new Highcharts.Chart({
			chart: {
				renderTo: 'sales-charts',
				type: 'line'
			},
			title: {
				text: ''
			},
			subtitle: {
				text: ''
			},
			xAxis: {
				categories: [<!--{$contmonths}-->]
			},
			yAxis: {
				title: {
					text: '报表统计(单位：人)'
				}
			},
			tooltip: {
				enabled: false,
				formatter: function() {
					return '<b>'+ this.series.name +'</b><br/>'+
						this.x +': '+ this.y +'人';
				}
			},
			plotOptions: {
				line: {
					dataLabels: {
						enabled: true
					},
					enableMouseTracking: false
				}
			},
			series: [{
				<!--{assign var='person_chartcount' value=draw_chart("mod={user} type={count} contday={$contmonths} where={v.type='1'<!--{$nodate_where}-->}")}-->
				name: '个人会员',
				data: [<!--{$person_chartcount}-->]
			}, {
				<!--{assign var='merchant_chartcount' value=draw_chart("mod={user} type={count} contday={$contmonths} where={v.type='2'<!--{$nodate_where}-->}")}-->
				name: '商家会员',
				data: [<!--{$merchant_chartcount}-->]
			}]
		});
	});
	
});

</script>

<!--{/if}-->

</body>
</html>