<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.*"%>

<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.analyseengine.service.StatisticsControl"%>
<%@ page import = "zr.zrpower.analyseengine.mode.ANALYSE_STATISTICS_MAIN"%>

<%@ page import = "zr.zrpower.ejb.sys.UIService"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%
        response.setContentType("text/html; charset=GBK");
        request.setCharacterEncoding("GBK");

        SessionUser user = (SessionUser)session.getAttribute("userinfo");
        UIService userUI =new UIService();
        StatisticsControl StatisticsControl = new StatisticsControl();
        //统计方案配置ID
        String strID = request.getParameter("ID");
        if (strID == null) {
            strID ="";
        }

        String P1 = request.getParameter("P1");
        if (P1 == null) {
            P1 ="";
        }
        String P2 = request.getParameter("P2");
        if (P2 == null) {
            P1 ="";
        }
        String P3 = request.getParameter("P3");
        if (P3 == null) {
            P3 ="";
        }
        String P4 = request.getParameter("P4");
        if (P4 == null) {
            P4 ="";
        }
        String P5 = request.getParameter("P5");
        if (P5 == null) {
            P5 ="";
        }



        ANALYSE_STATISTICS_MAIN Smain = null;
        Smain = StatisticsControl.GetSmain(strID);
        //得到统计配置方案的名称
        String strNAME = Smain.getSTATISTICSNAME();
        if (strNAME==null){strNAME="";}
        //得到单元格的详细信息链接地址
        String strSHOWLINK = Smain.getSHOWLINK();
        if (strSHOWLINK==null){strSHOWLINK="";}
        //得到报表表格可显示详细列表的列号串
        String strTiers = StatisticsControl.getTiers(strID);
        if (strTiers==null){strTiers="";}

%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<link REL="stylesheet" type="text/css" href="../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../zrsysmanage/script/Public.js"></SCRIPT>
<% if("html5.css".equals(user.getUserCSS())){//class="bordered"%>
<LINK type="text/css" rel="stylesheet" href="../../zrsysmanage/html5/css/style_tables.css">
<script src="../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></script>
<script src="../../zrsysmanage/html5/layer/layer.js"></script>

<% }%>
</HEAD>
<!--
<BODY oncontextmenu='if(event.srcElement.tagName!="TEXTAREA")return false' onselectstart='if(event.srcElement.tagName!="TEXTAREA"&amp;&amp;event.srcElement.tagName!="INPUT")return false' bgcolor="#ffffff">
-->
<BODY class="BodyMain">
<% if("html5.css".equals(user.getUserCSS())){//class="bordered"%>
<script type="text/javascript">
var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
//var index = layer.load(2, {time: 10*1000}); //又换了种风格，并且设定最长等待10秒
</script>
<% }%>
<form name="form1" action="datashowtable2.jsp">

<DIV id="divMessage" style='position:absolute;width:100%;height:96%;overflow:auto'>
<%String strHtml = StatisticsControl.GetShowHtml(strID,user.getUserID()); %>
<%=strHtml%>
</DIV>
<center>
<br>

</center>

</form>



<script language="javascript">
  //导出Rtf
  function ExportRtf(){
   var strURL="expreport2.jsp?ID=<%=strID%>&P1=<%=P1%>&P2=<%=P2%>&P3=<%=P3%>&P4=<%=P4%>&P5=<%=P5%>";
   var w,h,s;
   var MenuWindow = null;
   w = screen.availWidth - 4;
   h = screen.availHeight - 43;
   s = "directories=no,left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + w + ",height=" + h;
   MenuWindow = window.open(strURL,"_blank",s);
   MenuWindow.moveTo(-4,-4);
   MenuWindow.focus();
  }
  //导出pdf
  function ExportPdf(){
   var strURL="expreport1.jsp?ID=<%=strID%>&P1=<%=P1%>&P2=<%=P2%>&P3=<%=P3%>&P4=<%=P4%>&P5=<%=P5%>";
   var w,h,s;
   var MenuWindow = null;
   w = screen.availWidth - 4;
   h = screen.availHeight - 43;
   s = "directories=no,left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + w + ",height=" + h;
   MenuWindow = window.open(strURL,"_blank",s);
   MenuWindow.moveTo(-4,-4);
   MenuWindow.focus();
  }
  //导出图表
  function ExportChart(){
   var strURL="expreport3.jsp?ID=<%=strID%>&P1=<%=P1%>&P2=<%=P2%>&P3=<%=P3%>&P4=<%=P4%>&P5=<%=P5%>";
   var w,h,s;
   var MenuWindow = null;
   w = screen.availWidth - 4;
   h = screen.availHeight - 43;
   s = "directories=no,left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + w + ",height=" + h;
   MenuWindow = window.open(strURL,"_blank",s);
   MenuWindow.moveTo(-4,-4);
   MenuWindow.focus();
  }
  //打开点击单位下的子单位的统计表
  function opencompute(unitid,showname,tier,type)
  {
     var strvalue = unitid;
     if (type=="1")
     {    <% if(!"html5.css".equals(user.getUserCSS())){//class="bordered"%>
          document.all.show1.style.display='';
          document.all.show2.style.display='';
          flashs();
          str();
        <%}%>

          parent.document.computer.location.href="../../statisticscompute.do?ID=<%=strID%>&P1=<%=P1%>&P2=<%=P2%>&P3=<%=P3%>&P4=<%=P4%>&P5=<%=P5%>&UNITID="+strvalue;
     }else
     {
       if (strvalue.length>1)
       {
           //打开当前表格的详细信息
           var showlink = "<%=strSHOWLINK%>";
           var strTiers = "<%=strTiers%>";
           if (showlink.length>0)
           {
              if (strTiers.match(tier)>0)//可显示详细信息
              {
                  var ID = "<%=strID%>";
                  var UNITID = unitid;
                  var P1 = "<%=P1%>";
                  var P2 = "<%=P2%>";
                  var P3 = "<%=P3%>";
                  var P4 = "<%=P4%>";
                  var P5 = "<%=P5%>";

                  var tier1= parseInt(tier)+2;
                  var strvalue = showname;
                  if (parseInt(strvalue)>0)
                  {
                  var w,h,s;
                  var MenuWindow = null;
                  w = 800;
                  h = 600;
                  s = "directories=no,left=0,top=0,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + w + ",height=" + h;
                  MenuWindow = window.open("openlink.jsp?ID="+ID+"&UNITID="+UNITID+"&TIER="+tier+"&LINK="+showlink+"&P1="+P1+"&P2="+P2+"&P3="+P3+"&P4="+P4+"&P5="+P5,"_blank",s);
                  MenuWindow.moveTo(100,100);
                  MenuWindow.focus();
                  }
              }
           }
       }
     }
  }


</script>
<script type="text/javascript">
<% if("html5.css".equals(user.getUserCSS())){//class="bordered"%>
layer.close(index);
//alert(index);
<%}%>
</script>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
StatisticsControl = null;
Smain = null;
%>
