{set:
	$start = IFilter::act(IReq::get('start'));
	$end   = IFilter::act(IReq::get('end'));
	$countData = statistics::userReg($start,$end);
}

{js:my97date}
{js:chart}

<div class="headbar">
	<div class="position"><span>统计</span><span>></span><span>基础数据统计</span><span>></span><span>注册用户统计</span></div>
	<form action='{url:/}' method='get'>
		<input type='hidden' name='controller' value='market' />
		<input type='hidden' name='action' value='user_reg' />
		<div class="operating">
			<div class="search f_l">
				<input type="text" name='start' class="Wdate" id="date_start" pattern='date' value='{$start}' alt='' onFocus="WdatePicker()" empty /> —— <input type="text" value="{$end}" name='end' pattern='date' class="Wdate" id="date_end" onFocus="WdatePicker()" empty />
				<button class="btn"><span>查 询</span></button>
				<button class="btn" onclick="userReport()"><span>导出报表</span></button>
			</div>
		</div>
    </form>
</div>

<div class="content_box">
	<h3>用户注册统计：</h3>
	<div class='cont'>
		<ul>
			<li>用户注册统计，可以帮助更好的了解你的shop用户的注册情况，为你下一步的营销计划做出更好的判定！</li>
		</ul>
	</div>
</div>

<div class='content_box'>
	<div id="myChart" style="min-height:350px;"></div>
</div>

<script type='text/javascript'>
//图表生成
$(function()
{
	//图标模板
	var option = {
		title:
		{
			text:'注册用户'
		},
		xAxis:
		{
			name:'时间',
			data:{echo:JSON::encode(array_keys($countData))},
		},
		yAxis:
		{
			name:'人数(人)',
		},
		series:
		[
			{
				name:'注册人数',
				type: 'line',
				data:{echo:JSON::encode(array_values($countData))}
			}
		],
		tooltip:
		{
			show:true,
		}
	};

	echarts.init(document.getElementById('myChart')).setOption(option);
});

//生成 Excel并下载
function userReport()
{
	var url   = '{url:/market/user_report/start/@start@/end/@end@}';
	var start = $('#date_start').val();
	var end   = $('#date_end').val();
	url = url.replace("@start@",start).replace("@end@",end);
	window.open(url);
	return false;
}
</script>