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

📄 serworked.java

📁 改代码是采用JSP实现的在线办公自动化管理系统
💻 JAVA
字号:
package swing;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import com.zh.conpool.Condata;
import java.sql.*;
import com.bwm.string.Str;

public class Serworked extends HttpServlet {
	public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
		response.setContentType("text/html; charset=gb2312");
		PrintWriter out=response.getWriter();
		out.println("<html>\n"+"<head>\n"+"<title>统计</title>\n"+"</head>\n"+"<body>\n");
		out.println("<link href='css/style1.css' rel='stylesheet'>");
		out.println("<table width='95%'"+"   align='center'"+" cellpadding='0'"+" cellspacing='0'>");
		out.println("<tr align='center'><td>--工作进度统计信息--</td></tr>");
		out.println("</table>");

		out.println("<HR>");
		
		Str str=new Str();
		String names=str.toChinese(request.getParameter("name"));
		String work=str.toChinese(request.getParameter("work"));
		String bengin=request.getParameter("times");
		String sql="select * from jdwork ";
		if(names!=""){
			sql="select * from jdwork where Name='"+names+"' and BeginTime>='"+bengin+"'";
		}else{
			if(work==""){
				sql="select * from jdwork where BeginTime>='"+bengin+"'";
			}else{
				sql="select * from jdwork where BeginTime>='"+bengin+"' and Name in(select Name from tb_person where Popdeom='"+work+"')";
			}
			
		}
		Condata con=new Condata();
		Connection conn=null;
		try{
			conn=con.getConnection();
		}catch(Exception es){
			System.out.print(es.getMessage());
		}
		
		out.println("<table width='90%' height='196'  border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#FFFFFF' bordercolorlight='#FFFFFF' bordercolordark='#575757'>\n");

  		try{
	  		ResultSet rs=con.executeQuery(sql); 
	  		int i=0; 	
			while(rs.next()){
				i++;
				String name=rs.getString(2);
				String works=rs.getString(3);
				java.util.Date begtime=rs.getDate(4);
				java.util.Date endtime=rs.getDate(5);
				String note=rs.getString(6);
			
				out.println("<tr>");
				out.println("		<td height='25'"+"  width='8%'"+"scope='col' "+" align='center'>"+"姓&nbsp;&nbsp;&nbsp;&nbsp;名:"+"</td>");
				out.println("<td width='24%' scope='col' align='center'>"+name+"</td>");
				out.println(" <td width='10%' align='center' scope='col'>开始时间:</td>");
				out.println("<td width='24%' scope='col' align='center'>"+begtime+"</td>");
				out.println("<td width='10%' align='center' scope='col'><p>结束时间:</p></td>");
				out.println("<td width='24%' scope='col' align='center'>"+endtime+"</td>");
				out.println("");
			
				out.println("<tr>");
				out.println("		<td align='center'>"+"主要内容:"+"</td>");
				out.println("		<td  colspan='5'>"+works+"</td>");
				out.println("</tr>");
				out.println("<tr>");   
				out.println("		<td height='111'"+" align='center'>"+"详细内容:"+"</td>");
				out.println("		<td colspan='5'>"+note+"</td>");
				out.println("</tr>");
			}
			if(i<=0){
				out.println(" 	<tr>\n"); 
				out.println(" 		<td scope='col'>无记录</td>\n"); 
				out.println(" 	</tr>\n"); 	
			}			
  		}catch(SQLException e){
  			System.out.print(e.getMessage());
  		}
  		try{
  			con.close();
  			con=null;
  		}catch(Exception es){
  			System.out.print(es.getMessage());
  		}    	
  		try{
  			conn.close();
  			conn=null;
  		}catch(Exception es){
  			System.out.print(es.getMessage());
  		}
  		   	
	    out.println("</table>\n"); 
		out.println("</body>\n"+"</html>\n");
	}
}

⌨️ 快捷键说明

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