<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>

<link rel="stylesheet" href="${contextPath}/static/assets/css/jquery.gritter.css" />
<link rel="stylesheet" href="${contextPath}/static/assets/css/bootstrap-datetimepicker.css" />

<!-- ajax layout which only needs content area -->
<div class="page-header">
	<h1>
			<div id="totalStatistics"></div>
		
	</h1>
</div><!-- /.page-header -->


<div class="row">
	<div class="col-xs-12">
		开始日期：<input id="startDate" type="text">
		结束日期：<input id="endDate" type="text">
		<a data-toggle="tab" href="javascript:void(0)" class="btn-new-mail" id="row11">
			<span class="btn btn-purple no-border">
				<span class="bigger-110">申请日期统计</span>
			</span>
		</a>
		
	</div>
</div><!-- /.row -->
<div id="show" style="display:none;">数据统计中，请稍等...</div>	
<!-- PAGE CONTENT ENDS -->
	

<!-- page specific plugin scripts -->
<style type="text/css">
	#show{display: none;  position: absolute; left: 35%;  width: 400;  height: 60;  padding: 8px;  border: 8px solid #E8E9F7;  background-color: white;  z-index:1002;  overflow: auto;}
	</style>
<script type="text/javascript">
	var scripts = [null,"${contextPath}/static/assets/js/bootstrap-tag.js","${contextPath}/static/assets/js/jquery.hotkeys.js","${contextPath}/static/assets/js/date-time/bootstrap-datepicker.js","${contextPath}/static/assets/js/date-time/locales/bootstrap-datepicker.zh-CN.js",null]
	$(".page-content-area").ace_ajax("loadScripts", scripts, function() {
		jQuery(function($){
			$("#row11").click(row11);
			
			$('#startDate').datepicker({
		        language: 'zh-CN',
		        pickTime: false,
		        todayBtn: true,
		        autoclose: true,
		        minView: '2',
		        forceParse: false,
		        format:"yyyy-mm-dd"
		    });
			$('#endDate').datepicker({
		        language: 'zh-CN',
		        pickTime: false,
		        todayBtn: true,
		        autoclose: true,
		        minView: '2',
		        forceParse: false,
		        format:"yyyy-mm-dd"
		    });
			$.post("${contextPath}/sys/company/totalStatistics", {}, function(result){
				$("#totalStatistics").html("企业总数："+result.a+"，认证成功总数："+result.b+"，付费总数："+result.c);
			});
		});	
	});
	
	function showdiv() {            
        document.getElementById("show").style.display ="block";
        $(".btn").attr({"disabled":"disabled"});
    }
	function hidediv() {
        document.getElementById("show").style.display ='none';
        $(".btn").removeAttr("disabled");
    }
	
	function row11(){
		var startDate = $("#startDate").val();
		var endDate = $("#endDate").val();
		if(startDate==''){
			alert('开始日期不能为空！');
			return;
		}
		window.open('${contextPath}/sys/company/getCompanyStatices?type=total&startDate='+startDate+'&endDate='+endDate);
	}
	
</script>
