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

📄 stat.jsp

📁 企业办公自动化管理系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,java.sql.*" errorPage="" %>
<%@ page import="com.zh.conpool.Condata"%>
<% request.setCharacterEncoding("gb2312"); %>
<%@ page import="com.bwm.string.Str"%>
<%
	String sess=(String)session.getAttribute("username");
	if(sess==null||sess.equals("")){
		response.sendRedirect("../main.jsp");
	}else{
		swing.Rous rou=new swing.Rous();
		boolean maybe=rou.toInt(sess,"row115");
		if(!maybe){
			response.sendRedirect("../../notrous.jsp");
		}
	}
%><html>
<head>
	<title>Untitled</title>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<link href="../../css/style1.css" rel="stylesheet">
    <style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
    </style>
</head>
<script language="JavaScript">
function CheckDate(INDate)
{ if (INDate=="")
    {return true;}
	subYY=INDate.substr(0,4)
	//转换月份
	if(INDate.indexOf('-',0)!=-1){	separate="-"}
	else{
		if(INDate.indexOf('/',0)!=-1){separate="/"}
		else {return true;}}
		area=INDate.indexOf(separate,0)
		subMM=INDate.substr(area+1,INDate.indexOf(separate,area+1)-(area+1))
		if(subMM.length<2){subMM="0"+subMM}
	//转换日
	area=INDate.lastIndexOf(separate)
	subDD=INDate.substr(area+1,INDate.length-area-1)
	if(eval(subDD)<10){subDD="0"+eval(subDD)}
	NewDate=subYY+"-"+subMM+"-"+subDD
	if(NewDate.length!=10){return true;}
    if(NewDate.substr(4,1)!="-"){return true;}
    if(NewDate.substr(7,1)!="-"){return true;}
	if(NewDate.substr(5,2)>"12"){return true;}
	if(NewDate.substr(8,2)>"31"){return true;}
   return false;}
</script>
<script language="javascript">
	function chg2(company){
		var company=document.form1.company.value;
		var branch=document.form1.branch.value;
		var url='stat.jsp?company='+company+'&branch='+branch;
		location.href=url;
	}
</script>
<script language="javascript">
<!--
	function checkss(){
		if(form1.branch.value==""){
			window.alert("请填写部门");
			return false;
		}
		if(form1.times.value!=""){
			if(CheckDate(form1.times.value)){
				alert("您输入时间有误,请重新输入!");
				return false;
			}
		}
		if(form1.times1.value!=""){
			if(CheckDate(form1.times1.value)){
				alert("您输入时间有误,请重新输入!");
				return false;
			}
		}
		if(form1.times1.value < form1.times.value){
			alert("您输入时间区域有误,请重新输入!");
			return false;
		}
		document.form1.action="../../swing.Serworked";
		document.form1.submit();
		return true;
	}
	function checkss1(){
		if(form1.branch.value==""){
			window.alert("请填写部门");
			return false;
		}
		if(form1.times.value!=""){
			if(CheckDate(form1.times.value)){
				alert("您输入时间有误,请重新输入!");
				return false;
			}
		}
		if(form1.times1.value!=""){
			if(CheckDate(form1.times1.value)){
				alert("您输入时间有误,请重新输入!");
				return false;
			}
		}
		if(form1.times1.value < form1.times.value){
			alert("您输入时间区域有误,请重新输入!");
			return false;
		}
		document.form1.action="../stat/stattest.jsp";
		document.form1.submit();
		return true;
	}
-->
</script>
<body>
<br>
<form  method="post" name="form1" target="blank"  >
  <table border=0 cellpadding=0 cellspacing=0 width="100%">
    <tr>
      <td><div align="left">统计</div></td>
      <td><div align="right" class="style2">◆< href="#" onClick="window.print()" target="mainName" >打印</div></td>
    </tr>
  </table>
  <div align="right"></div>
  <hr size=1>
      <div align="center">
        <%
  	Str str1=new Str();
  	String company=str1.toChinese(request.getParameter("company"));
  	String branch=str1.toChinese(request.getParameter("branch"));
  %>
查询条件
      </div>
  <table width="443" border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#ffffff">
    <tr>
      <td width="203" bgcolor="#EFEFEF"><div align="right">公司名称</div></td>
      <td width="240" bgcolor="#EFEFEF"><select name="company"  size="1" onChange="return chg2(this.value);">
        <option selected>—请选择—</option>
	<%
		Condata con=new Condata();
		Connection conn=con.getConnection();
		String sql="select * from tb_company";
		
		ResultSet rs=con.executeQuery(sql);
		int temp=0;
		while(rs.next()){
			int companyid=rs.getInt(1);
			String str=rs.getString(2);
			if(company.equals(str)){
				out.println("<option value="+str+" selected>"+str+"</option>");
				temp=companyid;
			}else{
				out.println("<option value="+str+">"+str+"</option>");
			}
		}
	try{
		conn.close();
		conn=null;
	}catch(Exception e){
	}
	try{
		con.close();
		con=null;
	}catch(Exception e){
	}
	%>
  </select></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF"><div align="right">部门</div></td>
      <td bgcolor="#EFEFEF"><SELECT name="branch"  size="1" onChange="return chg2(this.value);">
        <option selected>—请选择—</option>
    <%
		Condata con1=new Condata();
		Connection conn1=con1.getConnection();
		String sq="select * from tb_branch where BranchId='"+temp+"'";
		ResultSet rss=con1.executeQuery(sq);
		int branchid=0;
		while(rss.next()){
			int id=rss.getInt(1);
			String tem=rss.getString(3);
			if(branch.equals(tem)){
				out.println("<option value="+tem+" selected>"+tem+"</option>");
				branchid=id;
			}else{
				out.println("<option value="+tem+">"+tem+"</option>");
			}
		}
	try{
		conn1.close();
		conn1=null;
	}catch(Exception e){
	}
	try{
		con1.close();
		con1=null;
	}catch(Exception e){
	}
	%>
  </SELECT></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF"><div align="right">人员名称</div></td>
      <td bgcolor="#EFEFEF"><select name="name">
        <option selected value="">—请选择—</option>
    <%
		Condata con12=new Condata();
		Connection conn12=con12.getConnection();
		String sql1="select * from tb_person where BranchId='"+branchid+"'and Popdeom='"+1+"'";
		ResultSet rst=con12.executeQuery(sql1);
		while(rst.next()){
			String tt=rst.getString(3);
			out.println("<option value="+tt+">"+tt+"</option>");
		}
		try{
			conn12.close();
			conn12=null;
		}catch(Exception e){
		}
		try{
			con12.close();
			con12=null;
		}catch(Exception e){
		}
	%>
      </select>
	  <select name="work">
	  <option value="">全部</option>
	  <option value="1">在职</option>
	  <option value="0">不在职</option>
	  </select>
	  </td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF"><div align="right">起止时间</div></td>
      <td bgcolor="#EFEFEF"><input name="times" type="text" size="9" value="<%=(((new java.util.Date()).toLocaleString()).substring(0,9))%>"></td>
    </tr>
    <tr>
      <td bgcolor="#EFEFEF"><div align="right">截止时间</div></td>
      <td bgcolor="#EFEFEF"><div align="left">
  <input name="times1" type="text" size="9" value="<%=(((new java.util.Date()).toLocaleString()).substring(0,9))%>">
      </div></td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#EFEFEF"><div align="right"></div>        
        <div align="center">
          <input type="button" name="Submit" value="统计记录" onClick="return checkss1()" >        
          <input type="button" name="Submit1" value="统计进度" onClick="return checkss()">      
      </div></td>
    </tr>
  </table>
  <div align="right"></div>
</form>
</body>
</html>

⌨️ 快捷键说明

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