Web课程设计02311--精选文档_第1页
Web课程设计02311--精选文档_第2页
免费预览已结束,剩余45页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Web开发技术课程设计课题名称:企业职工工资在线管理信息系统的设计与实现学生姓名: 曹小丽 专业班级: 软件工程13201207 专业课程: web开发技术 指导老师: 陈斌全 2016年 3月 13日Web开发技术课程设计目 录第1章 系统设计目的11.1题目与要求11.2课程设计任务1第2章 系统功能模块设计22.1 职工模块22.2人事管理员模块2第3章 数据库设计33.1职工基本信息表worker.33.2岗位信息表单Job.33.3所有员工工资记录表Allwage.4第4章 各功能模块的程序设计及运行测试结果44.1职工功能模块.44.1.1职工的注册与登陆.44.1.2职工岗位工资

2、信息查询.84.1.3职工留言板.94.2人事管理员功能模块.114.2.1职工工资信息添加、查询和更新.114.2.2职工个人工资信息的更新.154.2.3留言板管理.17第5章 课程设计体会205.1问题调试.205.2体会与感想.21主要Servlet代码附录.21主要JavaBeans代码附录.30参考文献46第1章 系统设计目的1.1题目与要求Dreamweaver+JSP+SQL SERVER1.2课程设计任务1. 主要功能设计一个企业职工工资管理信息系统,该系统的用户分别是:职工和人事管理员。不同的用户拥有不同的权限,各自完成各自的管理功能,不同的用户看到不同的系统功能。用Sql

3、 server2000创建后台数据库,然后利用JSP技术编写程序实现对数据库的操作,按照要求完成所有的功能和模块。职工的主要功能模块包括:(1) 职工注册与登录(2) 职工岗位工资信息查询(3) 职工留言板人事管理员的主要功能模板包括:(1) 工资信息的查询、添加、更新(2) 职工个人工资信息的更新和维护(3) 留言板管理2. 主要数据库表单(1) 职工基本信息表单主要字段有:职工号、姓名、性别、出生日期、岗位编号、工作年限(2) 岗位信息表单主要字段有:岗位编号、岗位名称、岗位基本工资、岗位津贴、特殊津贴、月工资(岗位工资+岗位工资+岗位津贴+特殊津贴)、养老保险(月工资*8%)、医疗保险(

4、月工资*6%)、失业保险(月工资*1%)44第2章 系统功能模块设计职工工资岗位信息查询2.1 职工模块职工注册登录职工留言板注册全体职工工资信息查询和更新2.2人事管理员模块 职工个人工资信息查询和更新管理员登录留言板管理职工个人工资记录添加第3章 数据库设计3.1职工基本信息表worker3.2岗位信息表单Job3.3所有员工工资记录表Allwage第4章 各功能模块的程序设计及运行测试结果4.1职工功能模块4.1.1职工的注册与登陆程序设计代码:/登录<link rel="stylesheet" type="text/css" href=&q

5、uot;style.css"/></head><body onload="a()"><h1><p align="center"><big><big><big><big><big>企业职工工资在线管理信息系统</big></big></big></big></big></p></h1><p><br></p><d

6、iv class="login"><div class="login-top"> <h1>登录</h1><form id="form1" name="form1" method="post" action="Servlet1" ><input type="text" name="user" value="user" id="user" o

7、nfocus="this.value = ''" onblur="if (this.value = '') this.value = 'User Id'"><input type="password" name="password" id="password"value="password" onfocus="this.value = ''" onblur="if (th

8、is.value = '') this.value = 'password'"> <div class="forgot"> <h1><br> <input type="submit" value="登陆" onclick="tsubmit()"> <input name="radio" type="radio" id="radio" value="

9、;radio1" checked="checked" />职工 <input type="radio" name="radio" id="radio" value="radio2" />管理员 </h1> </form> </div> </div><div class="login-bottom"><h3><a href="register.jsp"&

10、gt;在这里注册?</a></h3></div></div></body><script language="javascript">function tsubmit() var myForm=document.getElementById("form1"); var userName=document.getElementById("user").value; var password=document.getElementById("password

11、").value; var regPassWord = /a-zA-Z0-9+$/; if(userName.length>8) alert("请填写正确的用户名!(最长8位)"); document.getElementById("userName").value="" document.getElementById("userName").focus(); else if(!regPassWord.test(password)|password.lenth>16|password.leng

12、th<4) alert("请填写正确的用户名密码!(4-16位的数字或字母)"); document.getElementById("password").value="" document.getElementById("password").focus(); else /myForm.action="login.jsp" myForm.submit(); /注册<body ><div class="dataEye"><div class

13、="loginbox registbox"> <div class="login-content reg-content"> <div class="loginbox-title"><h3> 注册</h3></div><form id="signupForm" name="signupForm" method="post" action="Servlet2" ><div c

14、lass="login-error"></div><div class="row"><input type="text" name="user" placeholder="用户名" class="input-text-user noPic input-click" id="user" required></div><div class="row"> <input t

15、ype="password" name="password" placeholder="密码" class="input-text-password noPic input-click" id="password" required></div><div class="row"><input type="password" name="passwordAgain" placeholder="

16、确认密码" class="input-text-password noPic input-click" id="passwordAgain" required></div><div class="row"><input type="text" name="name" placeholder="姓名" class="input-text-user noPic input-click" id="name&

17、quot; required></div><div class="row"><input type="text" name="tel" placeholder="联系电话" class="input-text-user noPic input-click" id="tel" required></div><div class="row tips"><input type="c

18、heckbox" id="checkBox" checked="checked"><label>我已阅读并同意<a href="#" target="_blank">隐私政策、服务条款</a></label></div><div class="row btnArea"><input type="button" class="login-btn" value=&qu

19、ot;注册" onclick="checkForm()"></div></form> </div><div class="go-regist">已有帐号,请<a href="login.jsp" class="link">登录</a></div> </div></div></div></body><script type = 'text/javaScrip

20、t'>function checkForm() var b = true;var myForm=document.getElementById("signupForm"); var userName=document.getElementById("user").value; var password=document.getElementById("password").value; var AgainPassword=document.getElementById("passwordAgain")

21、.value; var Name=document.getElementById("name").value; var regPassWord = /a-zA-Z0-9+$/; if(userName.length>8|!userName) alert("用户名为空或用户名格式错误(最长8位)"); document.getElementById("userName").value="" document.getElementById("userName").focus(); b = fa

22、lse; else if(!regPassWord.test(password)|password.lenth>16|password.length<4) alert("密码为空或请用户密码格式错误(4-16位的数字或字母)"); document.getElementById("password").value="" document.getElementById("password").focus(); b= false; else if(password!=AgainPassword) alert

23、("您两次输入的密码不一样,请重新输入!"); document.getElementById("passwordAgain").value="" document.getElementById("passwordAgain").focus(); b = false; else if(!Name) alert("姓名不能為空!"); b=false; if(b) alert("注册成功!"); myForm.submit(); </script></html

24、>/ServletWebServlet("/Servlet2")public class Servlet2 extends HttpServlet private static final long serialVersionUID = 1L; /* * see HttpServlet#HttpServlet() */ public Servlet2() super(); / TODO Auto-generated constructor stub /* * see HttpServlet#doGet(HttpServletRequest request, HttpS

25、ervletResponse response) */protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException / TODO Auto-generated method stubrequest.setCharacterEncoding("UTF-8");response.setContentType("text/html;charset=utf-8");InsertInformati

26、on data=new InsertInformation();SelectInformation num=new SelectInformation();String user=request.getParameter("user");String password=request.getParameter("password");String passwordAgain=request.getParameter("passwordAgain");String name=request.getParameter("name

27、");String tel=request.getParameter("tel");if(data.InsertData(num.Length(),user,password,passwordAgain,name,tel)=true)request.getRequestDispatcher("/login.jsp").forward(request, response);elserequest.getRequestDispatcher("RegisterFail.jsp").forward(request, response

28、);/* * see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException / TODO Auto-generated method stubdoGet(request, response);4.1.2职工岗位工资信息查询<body onload=&quo

29、t;session()"><center><big><big>职工岗位工资信息查询</big></big></br><input type="button" name="button" id="button" value="返回主菜单" onclick="ons8()" style="background-color:transparent"/><input type=&

30、quot;button" name="button" id="button" value="查看留言板" onclick="ons9()" style="background-color:transparent"/></center><div align="center"> <table border="0"> <tr width="50px" bycolor="#00

31、ffff"> <td width="70px" height="50px">岗位编号</td> <td>岗位名称</td> <td>岗位基本工资</td> <td>岗位津贴</td> <td>月工资</td> <td>养老保险</td> <td>医疗保险</td> <td>失业保险</td> </tr><% String str=n

32、ew String 100100; str=(String)request.getAttribute("str"); for(int i=1;i<=10;i+) out.print("<tr>"); if(stri1=null) break; for(int j=1;j<=8;j+)%> <td><%=strij%></td> <% out.print("</tr>"); %></table></div></body

33、><script language="javascript">function session()var name=<%=session.getAttribute("WorkName")%>if(name=null)alert("您还没有登录,请登录!");window.location.href='login.jsp'function ons8()window.location.href='WorkMenu.jsp'function ons9()window.locati

34、on.href='resServlet'</script></html>4.1.3职工留言板<body class="a1" onload="session()" ><center><big><big><big>留言板</big></big></big><br><br><input type="button" name="button" id=&quo

35、t;button" value="返回主菜单" onclick="ons6()" style="background-color:transparent"/><input type="button" name="button" id="button" value="查看职工工资信息" onclick="ons7()" style="background-color:transparent"/&g

36、t; </center> <div class="layout"><form id="form2" name="form2" method="post" action="manageServlet"><textarea name="textarea" id="textarea" cols="35" rows="8" style="background-color:#

37、FFC"></textarea><input type="submit" name="button" id="button" value="提交" /></form></div><div class="layout2">您的留言回复:<br><table ><tr><%if(request.getAttribute("massage")=null)%>&

38、lt;td>您提交的留言还没有得到回复</td><% else %><td wih="200px" bgcolor="#FFFF99" ><%=request.getAttribute("massage")%></td></table></div></body><script language="javascript">function session()var name=<%=session.g

39、etAttribute("WorkName")%>if(name=null)alert("您还没有登录,请登录!");window.location.href='login.jsp'function ons6()window.location.href='WorkMenu.jsp'function ons7()window.location.href='jobInformationServlet'</script>4.2人事管理员功能模块4.2.1职工工资信息添加、查询和更新/添加<

40、body text="#D6ffff" class="a1" onload="session()"><div align="center"> <h1>添加员工工资信息表 </h1><br><br></div><div align="center"> <form id="form1" name="form1" method="post" act

41、ion="InsertWageServlet"> <p>职工姓名 <input type="text" name="name" /><br> <p>月份 <input type="text" name="month"/> </p> <p>岗位名称 <select name="jobNum" id="textfield4" > <option valu

42、e="001">会计</option> <option value="002">出纳</option> <option value="003">主任</option> <option value="004">组长</option> <option value="005">销售员</option> <option value="006">程序员</

43、option> </p></select> <p>特殊津贴 <input type="text" name="teshu" id="textfield5" /> <br> </p> <p> <input type="submit" name="button2" id="button2" value="添加" /> </p> </form&

44、gt; <input type="submit" name="button" id="button" value="返回主菜单" onclick="ons1()" /></div></body></body><script language="javascript">function session()var name=<%=session.getAttribute("AdminId")%&

45、gt;if(name=null)alert("您还没有登录,请登录!");window.location.href='login.jsp'function ons1()window.location.href='AdminMenu.jsp'</script>/职工工资信息的查询<div align="center"> <table border="0"> <tr bgcolor="#87cefa"width="100px"

46、height="80px"> <th height="40px">职工姓名</th> <th>岗位名称</th> <th>基本工资</th> <th>特殊津贴</th> <th>月工资</th> <th>是否更新</th> </tr> <% String str=new String 100100; str=(String)request.getAttribute("massag

47、e"); for(int i=1;i<=20;i+) if(stri1=null) break;%> <tr> <td height="60px"><input type="button" value="<%=stri1%>" onclick="onclick1('<%=stri1%>')" style="background-color:transparent"/></td> <

48、td><input type="text" id="zhiye<%=i %>" value="<%=stri2%>"style="background-color:transparent"/></td> <td><%=stri3%></td> <td><input type="text" value="<%=stri4%>"style="backg

49、round-color:transparent"/></td> <td><%=stri5%></td><td id=""><input type="button" value="是" onclick="onClicka('<%=stri1.trim()%>','<%=stri2.trim()%>','<%=stri4%>',<%=1%>)"

50、style="background-color:transparent"/></td><% out.print("</tr>"); %></table></div></body>/工资信息的更新<table border="0"> <tr bgcolor="#87cefa"width="100px"height="80px"> <th height="40px

51、">职工姓名</th> <th>岗位名称</th> <th>基本工资</th> <th>特殊津贴</th> <th>月工资</th> <th>是否更新</th> </tr> <% String str=new String 100100; str=(String)request.getAttribute("massage"); for(int i=1;i<=20;i+) if(stri1=null) br

52、eak;%> <tr> <td height="60px"><input type="button" value="<%=stri1%>" onclick="onclick1('<%=stri1%>')" style="background-color:transparent"/></td> <td><input type="text" id="zhiye

53、<%=i %>" value="<%=stri2%>"style="background-color:transparent"/></td> <td><%=stri3%></td> <td><input type="text" value="<%=stri4%>"style="background-color:transparent"/></td> <td

54、><%=stri5%></td><td id=""><input type="button" value="是" onclick="onClicka('<%=stri1.trim()%>','<%=stri2.trim()%>','<%=stri4%>',<%=1%>)"style="background-color:transparent"/>&

55、lt;/td><% out.print("</tr>"); %></table></div></body><script language="JavaScript" charset="utf-8">function onClicka(workname,name,jintie,i)name = document.getElementById("zhiye"+i).value;var s ='updateWorkWageServlet

56、?workname='+workname+'&name='+name+'&jintie='+jintie;window.location.href=s;function onclick1(name)var s ='onclickSelectServlet?workname='+name;window.location.href=s;4.2.2职工个人工资信息的更新 <table border="0"> <tr bgcolor="#e6e6fa" > <t

57、h height="40px" width="70px">月份</th> <th>岗位名称</th> <th>基本工资</th> <th>岗位津贴</th> <th>特殊津贴</th> <th>工作年限</th> <th>月工资</th> <th>养老保险</th> <th>医疗保险</th> <th>失业保险</th> &

58、lt;th>是否更新</th> </tr> <% String str=new String 100100; str=(String)request.getAttribute("str"); for(int i=1;i<=10;i+) out.print("<tr>"); if(stri1=null) break; float aa=Float.parseFloat(stri3)+Float.parseFloat(stri4)+Float.parseFloat(stri5); float bb=(fl

59、oat)Math.round(0.08*aa*100)/100); float cc=(float)Math.round(0.06*aa*100)/100); float dd=(float)Math.round(0.01*aa*100)/100); %> <tr> <td><%=stri1%></td> <td><input type="text" value="<%=stri2%>"style="background-color:transparent&qu

60、ot;/></td> <td><%=stri3%></td> <td><%=stri4%></td> <td><input type="text" id="teshu<%=i %>" value="<%=stri5%>"style="background-color:transparent"/></td> <td><%=stri6%></

61、td> <td><%=aa%></td> <td><%=bb%></td> <td><%=cc%></td> <td><%=dd%></td> <td height="60px"><input type="button" value="是" onclick="onclick2('<%=stri5%>','<%=stri

62、1%>',<%=i %>)" style="background-color:transparent"/></td> <% out.print("</tr>"); %> </tr> </table></div></body><script language="JavaScript" charset="utf-8">function onclick2(teshu,month,i)t

63、eshu=document.getElementById("teshu"+i).value;var s ='updateSomebodyWageServlet?TeshuWage='+teshu+'&yMonth='+month;window.location.href=s;function ons9()window.location.href='SelectWorkWageServlet'4.2.3留言板管理<form action="" method="post">

64、;<center><table border="0" cellpadding="1" cellspacing="10" hspace="20"> <caption> 员工留言管理 </caption> <tr bgcolor="b0c4d1"> <th width="51" height="34" scope="col">留言编号</th> <th

65、 width="56" scope="col">姓名</th> <th width="279" scope="col">留言内容</th> <th width="100" scope="col">时间</th> <th width="301" scope="col">回复</th> <th width="43" scope="col">是否回复</th> <th width="42" scope="col">是否删除</th&g

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论