<%@ 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" />

<style>
    .fen{
        width: 100%;
        height: 2px;
        background-color: rgba(0, 0, 0, 0.2);
        position: absolute;
        top: 290px;
        -moz-box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.32);
        -webkit-box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.32);
        box-shadow:2px 2px 15px rgba(0, 0, 0, 0.32);
    }
</style>

<table  border="1" id="dataTable"  style=" border-collapse:collapse;border-spacing:0; border:1px  solid  #FFFFFF;height: 180px;width: 800px">
    <span style="font-size: 20px;">异地查档实时监控</span>
    <br>
    开始日期：<input id="startDate" type="text">
    结束日期：<input id="endDate" type="text">&nbsp;&nbsp;&nbsp;&nbsp;

    <a data-toggle="tab" href="javascript:void(0)" class="btn-new-mail" id="row11">
			<span class="btn btn-purple no-border">
				<span class="bigger-90" id="count">统计</span>
			</span>
    </a>
    <br>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">筛选人数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="p1"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">筛选次数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="p2"></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">发布人数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="p3"></td>
    </tr>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">发布次数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="p4"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">提交订单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="p5"></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">付款订单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="p6"></td>
    </tr>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">待接单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="p7"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">已取消数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="p8"></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">已过期数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="p9"></td>
    </tr>

</table>
<br>
<div class="fen" ></div>
<br>
<br>
<table  border="1" id="dataTable"  style=" border-collapse:collapse;border-spacing:0; border:1px  solid  #FFFFFF;height: 180px;width: 800px">
    <span style="font-size: 20px;">代缴诉讼费/立案实时监控</span>
    <br>
    开始日期：<input id="startDate1" type="text">
    结束日期：<input id="endDate1" type="text">&nbsp;&nbsp;&nbsp;&nbsp;

    <a data-toggle="tab" href="javascript:void(0)" class="btn-new-mail" id="row111">
			<span class="btn btn-purple no-border">
				<span class="bigger-90" id="count1">统计</span>
			</span>
    </a>
    <br>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">发布人数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="d1"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">发布次数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="d2"></td>
    </tr>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">提交订单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="d3"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">付款订单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="d4"></td>
    </tr>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">待接单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="d5"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">已取消数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="d6"></td>
    </tr>
    <tr  style="background:#50aca2;color: #fff;border-bottom-width: 0;  text-align: center; height: 2.2rem;">
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;">已过期订单数</td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px"><span id="d7"></span></td>
        <td style="background:#50aca2;color: #fff;border-bottom-width: 0;width: 160px;  text-align: center; height: 2.2rem;"></td>
        <td style="background: #e5efeb; text-align: center;height: 2.2rem;color: black;width: 160px" id="d8"></td>
    </tr>

</table>
<script type="text/javascript">

    var scripts = [ null,  "${contextPath}/static/assets/js/date-time/bootstrap-datepicker.js", "${contextPath}/static/assets/js/date-time/locales/bootstrap-datepicker.zh-CN.js", "${contextPath}/static/assets/js/jqGrid/jquery.jqGrid.js", "${contextPath}/static/assets/js/jqGrid/i18n/grid.locale-cn.js", null ]
    $(".page-content-area").ace_ajax("loadScripts", scripts, function() {
        jQuery(function ($) {
            $("#row11").click(row11);
            $("#row111").click(row111);
            $('#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"
            });
            $('#startDate1').datepicker({
                language: 'zh-CN',
                pickTime: false,
                todayBtn: true,
                autoclose: true,
                minView: '2',
                forceParse: false,
                format:"yyyy-mm-dd"
            });
            $('#endDate1').datepicker({
                language: 'zh-CN',
                pickTime: false,
                todayBtn: true,
                autoclose: true,
                minView: '2',
                forceParse: false,
                format:"yyyy-mm-dd"
            });


            $(document).keydown(function(event) {
                var key = window.event ? event.keyCode : event.which;
                if (key == 13) {
                    $("#count").click();
                    $("#count1").click();
                }
            });

            /*搜索框  主要对Jquery grid进行刷新 带参数刷新    */
            $("#count").click(function(){
                var startDate = encodeURI(encodeURI($("#startDate").val()));
                var endDate = encodeURI(encodeURI($("#endDate").val()));
                getCount();

            });
            /*搜索框  主要对Jquery grid进行刷新 带参数刷新    */
            $("#count1").click(function(){
                var startDate1 = encodeURI(encodeURI($("#startDate1").val()));
                var endDate1 = encodeURI(encodeURI($("#endDate1").val()));
                getCount1();

            });

        });

        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);
        }
        function row111(){
            var startDate1 = $("#startDate1").val();
            var endDate1 = $("#endDate1").val();
            if(startDate1==''){
                alert('开始日期不能为空！');
                return;
            }
            //window.open('${contextPath}/sys/company/getCompanyStatices?type=total&startDate='+startDate+'&endDate='+endDate);
        }
    });
    setInterval("freshcdSearchs()", 3*60000);

    function freshcdSearchs() {
        getCount();
        getCount1();
    }
    getCount();
    getCount1();
    function getCount() {

        var startDate = $("#startDate").val();
        //默认查询当天记录
        if(startDate==""){
            var date = new Date((+new Date()));
            startDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();
            $("#startDate").val(startDate);
        }
        var endDate = $("#endDate").val();
        if(endDate ==""){
            var date = new Date((+new Date()));
            endDate = date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();
            $("#endDate").val(endDate);
        }

        var param = "?startDate=" + startDate + "&endDate=" + endDate;
        $.ajax({
            dataType : "json",
            url : "${contextPath}/ajhz/monitor/getInfo" +param,
            type : "get",
            data : {/*"startDate":startDate,"endDate":endDate*/},
            async:false,
            complete : function(ret) {
                var ret = eval("("+ret.responseText+")");
                /*异地查档监控*/
                $("#p1").html(ret.searchTotalLawyer);
                $("#p2").html(ret.searchTotal);
                $("#p3").html(ret.sendTotalLawyer);
                $("#p4").html(ret.sendTotal);
                $("#p5").html(ret.commitTotal );
                $("#p6").html(ret.payedTotal );
                $("#p7").html(ret.waiteTotal );
                $("#p8").html(ret.cancelTotal );
                $("#p9").html(ret.overdueTotal );


            }
        });
    }
    function getCount1() {
        var startDate1 = $("#startDate1").val();
        //默认查询当天记录
        if(startDate1 == ""){
            var date1 = new Date((+new Date()));
            startDate1 = date1.getFullYear()+'-'+(date1.getMonth()+1)+'-'+date1.getDate();
            $("#startDate1").val(startDate1);
        }
        var endDate1 = $("#endDate1").val();
        if(endDate1 == ""){
            var date1 = new Date((+new Date()));
            endDate1 = date1.getFullYear()+'-'+(date1.getMonth()+1)+'-'+date1.getDate();
            $("#endDate1").val(endDate1);
        }

        var param = "?startDate1=" + startDate1 + "&endDate1=" + endDate1;
        $.ajax({
            dataType : "json",
            url : "${contextPath}/ajhz/monitor/getInfo1" +param,
            type : "get",
            data : {/*"startDate":startDate,"endDate":endDate*/},
            async:false,
            complete : function(ret) {
                var ret = eval("("+ret.responseText+")");
                $("#d1").html(ret.sendTotalLawyer1);
                $("#d2").html(ret.sendTotal1);
                $("#d3").html(ret.commitTotal1 );
                $("#d4").html(ret.payedTotal1 );
                $("#d5").html(ret.waiteTotal1 );
                $("#d6").html(ret.cancelTotal1 );
                $("#d7").html(ret.overdueTotal1 );


            }
        });
    }

</script>
