【JSP开源代码栏目提醒】:网学会员在JSP开源代码频道为大家收集整理了Time_Manger.jsp提供大家参考,希望对大家有所帮助!
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"%>
<%@ page import="com.zh.conpool.Condata"%>
<% request.setCharacterEncoding("gb2312"); %>
<%@ page import="com.bwm.string.Str"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题
文档</title>
<link href="../css/style1.css" rel="stylesheet">
</head>
<body>
<script language="javascript">
function chg(company){
var company=document.form1.company.value;
var branch=document.form1.branch.value;
var url='Time_Manger.jsp?company='+company+'&branch='+branch;
location.href=url;
}
</script>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" bordercolorlight="#EEF2F9">
<form action="" name="form1" method="post">
<tr>
<td height="24" colspan="6"> <img src="../images/face/mode.design.gif" width="21" height="20">添加考勤信息
<hr color="#0099CC"></td>
</tr>
<%
Str str1=new Str();
String company=str1.toChinese(request.getParameter("company"));
String branch=str1.toChinese(request.getParameter("branch"));
%>
<tr align="center" bgcolor="#F9F9FB">
<td width="11%" height="24">公司</td>
<td width="17%" height="24" align="left">
<select name="company" class="txt_grey" onChange="return chg(this.value)">
<option></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>");
}
}
%>
</select></td>
<td width="16%">部门</td>
<td width="16%" align="left">
<select name="branch" class="txt_grey" onChange="return chg(this.value)">
<option></option>
<%
String sq="select * from tb_branch where BranchId='"+temp+"'";
ResultSet rss=con.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>");
}
}
%>
</select></td>
<td width="18%">员工</td>
<td width="22%" align="left">
<select name="pername" class="txt_grey">
<%
String
sql1="select * from tb_person where BranchId='"+branchid+"'and Popdeom='"+1+"'";
ResultSet rst=con.executeQuery(sql1);
while(rst.next()){
String tt=rst.getString(3);
out.println("<option>"+tt+"</option>");
}
%>
</select></td>
</tr>
<tr align="center" bgcolor="#F9F9FB">
<td height="24">上午签到</td>
<td align="left"><input name="MorSign" type="text" class="wenbenkuang"></td>
<td height="24">下午签到</td>
<td height="24" align="left"><input name="AftSign" type="text" class="wenbenkuang"></td>
<td height="24">请假类型</td>
<td height="24" align="left">
<select name="LeaveType" class="txt_grey">
<%
String sql2="select * from tb_leave";
ResultSet rs1=con.executeQuery(sql2);
while(rs1.next()){
String leave=rs1.getString(2);
out.println("<option>"+leave+"</option>");
}
%>
</select></td>
</tr>
<tr align="center" bgcolor="#F9F9FB">
<td height="24">迟到类型</td>
<td height="24" align="left"><select name="LaterType" class="txt_grey">
</select></td>
<td height="24">是否加班</td>
<td height="24" align="left"><input type="checkbox" name="OverTime" value="checkbox"></td>
<td height="24"> </td>
<td height="24" align="left"> </td>
</tr>
<tr align="center">
<td height="24" colspan="6" bgcolor="#Eff2fb"><input name="Submit" type="submit" class="btn_grey" value="签到">
<input name="Submit2" type="reset" class="btn_grey" value="取消"></td>
</tr>
</form>
<%
try{
conn.close();
conn=null;
}catch(Exception e){
}
try{
con.close();
con=null;
}catch(Exception e){
}
%>
</table>
</body>
</html>