⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showdetailmonthinfo.jsp

📁 tomcat最新安装程序
💻 JSP
字号:
<%@ page import="java.util.*,java.sql.*,java.io.*"%>
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="cn.com.aheadsoft.util.UserInfo"%>

<jsp:useBean id="userPurviewManage" scope="page" class="cn.com.aheadsoft.manage.UserPurviewManage" />
<jsp:useBean id="userInfo" scope="page" class="cn.com.aheadsoft.util.UserInfo" />
<jsp:useBean id="periodManage" scope="page" class="cn.com.aheadsoft.manage.PeriodManage" />
<jsp:useBean id="diaryManage" scope="page" class="cn.com.aheadsoft.manage.DiaryManage" />
<jsp:useBean id="diaryPeriodRecordSet" scope="page" class="cn.com.aheadsoft.recordset.DiaryPeriodRecordSet" />
<jsp:useBean id="diaryDateRecordSet" scope="page" class="cn.com.aheadsoft.recordset.DiaryDateRecordSet" />
<jsp:useBean id="userDeptManage" scope="page" class="cn.com.aheadsoft.manage.UserDeptManage" />
<jsp:useBean id="diaryItemRecordSet" scope="page" class="cn.com.aheadsoft.recordset.DiaryItemRecordSet" />

<html>
<head>
<link rel="stylesheet" type="text/css" href="/krm/jsp/css/css.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

</head>

<%


        
        diaryItemRecordSet=diaryManage.getDiaryItem();//获取工作日记项目记录集
        int rsSize=diaryItemRecordSet.size();
        int [] timeCount=new int[rsSize]; //时间记数数组
        
        String[] itemName=new String[rsSize];//工作日记项目名称数组
        String[] itemID=new String[rsSize];
        for(int i=0;i<rsSize;i++){
           diaryItemRecordSet.next();
           itemName[i]=diaryItemRecordSet.getDIM_Name().trim();   
           itemID[i]=diaryItemRecordSet.getDIM_TypeID().trim();        
        }
        
        //String DIA_ID=request.getParameter("diaryDate_ID");
        int work=Integer.parseInt(request.getParameter("work"));
        int learn=Integer.parseInt(request.getParameter("learn"));
        int sport=Integer.parseInt(request.getParameter("sport"));
        int rest=Integer.parseInt(request.getParameter("rest"));
        int total = work+learn+sport+rest;
        String UserID=request.getParameter("userID");
        String year=request.getParameter("year");
        String month = request.getParameter("month");
        String userName=request.getParameter("userName");
        String deptName=request.getParameter("deptName");  
        Connection conn=null;
        Statement stmt=null;
        ResultSet rs=null;
        String sql="";
        Class.forName("org.gjt.mm.mysql.Driver");//用jdbc:odbc桥连接数据库
        conn=DriverManager.getConnection("jdbc:mysql://localhost/krm","root","");//连接数据库
        stmt=conn.createStatement();
        sql="select * from WD_DiaryPeriod where UserID='"+UserID+"' and year(DPD_writedate) = '"+year+"' and month(DPD_writedate) ='"+month+"'";
        rs=stmt.executeQuery(sql); 

        //diaryPeriodRecordSet=periodManage.getDiaryPeriodRecordSet(UserID,year);        
        String[] infoItem=new String[24];
        while(rs.next()){			
        	infoItem[0]=rs.getString("DPD_Item1");
		infoItem[1]=rs.getString("DPD_Item2");
		infoItem[2]=rs.getString("DPD_Item3");
		infoItem[3]=rs.getString("DPD_Item4");
		infoItem[4]=rs.getString("DPD_Item5");
		infoItem[5]=rs.getString("DPD_Item6");
		infoItem[6]=rs.getString("DPD_Item7");
		infoItem[7]=rs.getString("DPD_Item8");
		infoItem[8]=rs.getString("DPD_Item9");
		infoItem[9]=rs.getString("DPD_Item10");
		infoItem[10]=rs.getString("DPD_Item11");
		infoItem[11]=rs.getString("DPD_Item12");
		infoItem[12]=rs.getString("DPD_Item13");
		infoItem[13]=rs.getString("DPD_Item14");
		infoItem[14]=rs.getString("DPD_Item15");
		infoItem[15]=rs.getString("DPD_Item16");
		infoItem[16]=rs.getString("DPD_Item17");
		infoItem[17]=rs.getString("DPD_Item18");
		infoItem[18]=rs.getString("DPD_Item19");
		infoItem[19]=rs.getString("DPD_Item20");
		infoItem[20]=rs.getString("DPD_Item21");
		infoItem[21]=rs.getString("DPD_Item22");
		infoItem[22]=rs.getString("DPD_Item23");
		infoItem[23]=rs.getString("DPD_Item24");
	
	
	for(int i=0;i<rsSize;i++){	
        /* 分项统计时间 */	
	  for(int j=0;j<24;j++)
	     //if(infoItem[j].trim().equals(itemID[i]))
	     if(itemID[i].equals(infoItem[j].trim())){	     
	        timeCount[i]++;	
	     }   
	}
	}
	
       rs.close();
       stmt.close();
       conn.close();
	
%>
<script language="JavaScript">
<!--
	isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
	isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;	
	function fsubmit(){
		document.form2.submit();	
	}

-->
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="F1F7F9">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="F1F7F9">
  <tr height="8">
    <td></td>
  </tr>
  <tr>
    <td align="center">
      <fieldset style="width:95%; text-align:center">

        <legend><img src="/krm/jsp/diamanage/image/dia_tjsjxs.gif" width="106" height="18"></legend>
      <form name="form1" method="post" action="" onSubmit="return sub();">
      
        <table border="1" width="95%" align="center" height="20%" bordercolor="A1B7DB" class="collapse">
          <tr bgcolor="0BD0F8"> 
            <td class="common" colspan="6" align="center"><strong><%=deptName%> <%=userName%> <%=month%>月份时间安排统计</strong></td>
          </tr>
          <tr bgcolor="E7FDF3"> 
            <td class="common" align="center">日期</td>
            <td class="common" align="center">工作时间</td>
            <td class="common" align="center">学习时间</td>
            <td class="common" align="center">运动时间</td>
            <td class="common" align="center">休息时间</td>
            <td class="common" align="center" bgcolor="E7FDF3">总计</td>
          </tr>
          <tr align="center"> 
            <td class="common"><%=year%>年<%=month%>月</td> 
            <td class="common"><%=work%></td>
            <td class="common"><%=learn%></td>
            <td class="common"><%=sport%></td>
            <td class="common"><%=rest%></td>
            <td class="common" bgcolor="E7FDF3"><%=total%></td>
          </tr>
        </table><br>
        
        <table border="1" width="95%" align="center" height="20%" bordercolor="A1B7DB" class="collapse">
          <tr bgcolor="9BD0F8"> 
            <td class="common" colspan="7" >工作时间详细信息</td>
          </tr>
          <tr bgcolor="F7FDF3"> 
            <td class="common" align="center">日期</td>
            <%
           for(int i=0;i<5;i++){             
        %>
            <td class="common" align="center"><%=itemName[i]%></td>
            <%
          ;}
           
       %>
          <td class="common" align="center" bgcolor="E7FDF3">总计</td>
          </tr>
          <tr align="center"> 
            <td class="common"><%=year%>年<%=month%>月</td>
            <%
           for(int i=0;i<5;i++){
        %>
            <td class="common"><%=timeCount[i]%></td>
            <%
         ;}
        %>
           <td class="common" bgcolor="E7FDF3"><%=work%></td>
          </tr>
        </table><br>
        
        <table border="1" width="95%" align="center" height="20%" bordercolor="A1B7DB" class="collapse">
          <tr bgcolor="9BD0F8"> 
            <td class="common" colspan="5" >学习时间详细信息</td>
          </tr>
          <tr bgcolor="F7FDF3"> 
            <td class="common" align="center">日期</td>
            <%
           for(int i=5;i<8;i++){             
        %>
            <td class="common" align="center"><%=itemName[i]%></td>
            <%
          ;} 
       %>
           <td class="common" align="center" bgcolor="E7FDF3">总计</td>
          </tr>
          <tr align="center"> 
            <td class="common"><%=year%>年<%=month%>月</td>
            <%
           for(int i=5;i<8;i++){
        %>
            <td class="common"><%=timeCount[i]%></td>
            <%
         ;}
        %>
           <td class="common" bgcolor="E7FDF3"><%=learn%></td>
          </tr>
        </table><br>
        
        <table border="1" width="95%" align="center" height="20%" bordercolor="A1B7DB" class="collapse">
          <tr bgcolor="9BD0F8"> 
            <td class="common" colspan="4" >运动时间详细信息</td>
          </tr>
          <tr bgcolor="F7FDF3"> 
            <td class="common" align="center">日期</td>
            <%
           for(int i=8;i<10;i++){             
        %>
            <td class="common" align="center"><%=itemName[i]%></td>
            <%
          ;} 
       %>
           <td class="common" align="center" bgcolor="E7FDF3">总计</td>
          </tr>
          <tr align="center"> 
            <td class="common"><%=year%>年<%=month%>月</td>
            <%
           for(int i=8;i<10;i++){
        %>
            <td class="common"><%=timeCount[i]%></td>
            <%
         ;}
        %>
           <td class="common" bgcolor="E7FDF3"><%=sport%></td>
          </tr>
        </table><br>
        
        <table border="1" width="95%" align="center" height="20%" bordercolor="A1B7DB" class="collapse">
          <tr bgcolor="9BD0F8"> 
            <td class="common" colspan="6" >休息时间详细信息</td>
          </tr>
          <tr bgcolor="F7FDF3"> 
            <td class="common" align="center">日期</td>
            <%
           for(int i=10;i<14;i++){             
        %>
            <td class="common" align="center"><%=itemName[i]%></td>
            <%
          ;} 
       %>
           <td class="common" align="center" bgcolor="E7FDF3">总计</td>
          </tr>
          <tr align="center"> 
            <td class="common"><%=year%>年<%=month%>月</td>
            <%
           for(int i=10;i<14;i++){
        %>
            <td class="common"><%=timeCount[i]%></td>
            <%
         ;}
        %>
           <td class="common" bgcolor="E7FDF3"><%=rest%></td>
          </tr>
        </table><br>
      </form>
      	  <a href="javascript:history.back();"><img src="/krm/jsp/diamanage/image/back.gif" border="0"></a>
      
		 </fieldset>
	   </td>
	</tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -