user_add.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:12k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="com.redmoon.oa.dept.*"%>
  3. <%@ page import="com.redmoon.oa.basic.*"%>
  4. <%@ page import="com.redmoon.oa.person.*"%>
  5. <%@ page import="java.util.*"%>
  6. <html>
  7. <head>
  8. <title>添加用户</title>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <link rel="stylesheet" href="../common.css" type="text/css">
  11. <script>
  12. function New(para_URL){var URL=new String(para_URL);window.open(URL,'','resizable,scrollbars')}
  13. function CheckRegName(){
  14. var Name=document.memberform.name.value;
  15. window.open("../isUserExist.jsp?name="+Name,"","width=200,height=20");
  16. }
  17. </script>
  18. </head>
  19. <body bgcolor="#FFFFFF" text="#000000" style="BACKGROUND-IMAGE:url()">
  20. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  21. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  22. <%
  23. if (!privilege.isUserPrivValid(request, "admin.user")) {
  24. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  25. return;
  26. }
  27. %>
  28. <table width=98% align=center cellspacing=0 cellpadding=0 border=0>
  29.  <Form method="POST" action="user_add_do.jsp"  name="memberform" onSubmit="return memberform_onsubmit()"><tr>
  30.       <td bgcolor=#D3D3D3> <table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor="#CCCCCC">
  31.           <tr> 
  32.             <td align=center bgcolor="#FFFFFF"> <table border=0 cellpadding=0 cellspacing=0 width=100%>
  33.                 <tr bgcolor="#0099FF"> 
  34.                   <td width="86%" height=20 bgcolor="#C4DAFF" class="stable"><b> </b>成员代号及密码 
  35.                     &nbsp;&nbsp;&nbsp;注意:此栏必须填写</td>
  36.                   <td width="14%" align="center" bgcolor="#C4DAFF" class="stable"><a href="user_list.jsp">返回职员列表</a></td>
  37.                 </tr>
  38.               </table>
  39.               <table width=100% border=0 cellpadding=0 cellspacing=1>
  40.                 <tr> 
  41.                   <td width="102" align=left bgcolor="#EEEEEE" class="stable">注册用户</td>
  42.                   <td width="300" align=left class="stable"><input type=text name="name" size=20>
  43.                     <font color="#FF0000"> * </font>
  44.                   <input name=Button type=button class="singleboarder" onClick="javascript:CheckRegName()" value='检测用户名'></td>
  45.                   <td width="142" align=left bgcolor="#EFEFEF" class="stable">真实姓名                    </td>
  46.                   <td align=left class="stable"><input type=text name=RealName size=12 maxlength=8>
  47.                   <font color="#FF0000">*</font></td>
  48.                 </tr>
  49.                 <tr align="left"> 
  50.                   <td align="left" bgcolor="#EEEEEE" class="stable">登陆密码                    </td>
  51.                   <td valign="top" class="stable"><input type=password name=Password size=20>
  52.                     <font color="#FF0000">*</font></td>
  53.                   <td valign="top" bgcolor="#EFEFEF" class="stable">请再次输入密码                    </td>
  54.                   <td valign="top" class="stable"><input type=password name=Password2 size=20>
  55.                     <font color="#FF0000"> *</font></td>
  56.                 </tr>
  57.                 <tr align="left">
  58.                   <td align="left" bgcolor="#EEEEEE" class="stable">职级</td>
  59.                   <td valign="top" class="stable"><select name="rankCode">
  60.                     <option value="">无</option>
  61.                     <%
  62. RankDb rd = new RankDb();
  63. Iterator ir = rd.list().iterator();
  64. String opts = "";
  65. while (ir.hasNext()) {
  66. rd = (RankDb)ir.next();
  67. opts += "<option value='" + rd.getCode() + "'>" + rd.getName() + "</option>";
  68. }
  69. out.print(opts);
  70. %>
  71.                   </select></td>
  72.                   <td valign="top" bgcolor="#EFEFEF" class="stable">&nbsp;</td>
  73.                   <td valign="top" class="stable">&nbsp;</td>
  74.                 </tr>
  75.               </table>
  76.               <table width=100% border=0 cellpadding=0 cellspacing=0>
  77.                 <tr bgcolor="#C4DAFF"> 
  78.                   <td height=20 class="stable"><b> </b>个人资料</td>
  79.                 </tr>
  80.               </table>
  81.               <table width=100% border=0 cellpadding=0 cellspacing=1>
  82.                 <tr> 
  83.                   <td width=100 height="25" align=left bgcolor="#EEEEEE" class="stable"> 
  84.                     性别</td>
  85.                   <td width="300" height="25" class="stable"> <input type=radio name=gender value="<%=UserDb.GENDER_MAN%>" checked>
  86.                     男 
  87.                     <input type=radio name=gender value="<%=UserDb.GENDER_WOMAN%>">
  88.                   女</td>
  89.                   <td width=142 height="25" bgcolor="#EEEEEE" class="stable"> 
  90.                     婚姻状况</td>
  91.                   <td height="25" class=stable><select name=Marriage size=1>
  92.                     <option value="1">已婚</option>
  93.                     <option value="0">未婚</option>
  94.                   </select></td>
  95.                 </tr>
  96.                 <tr> 
  97.                   <td width=100 height="28" align=left bgcolor="#EEEEEE" class="stable"> 
  98.                     出生日期</td>
  99.                   <td height="28" class="stable">
  100. <jsp:useBean id="calsheet" scope="page" class="com.redmoon.oa.CalendarSheet"/>
  101.    <select name="BirthYear">
  102.                       <option value="">请选择
  103.                       <%
  104. int curyear = calsheet.getCurYear();
  105. int curmonth = calsheet.getCurMonth();
  106. int curday = calsheet.getCurDay();
  107. int monthdays = 31;//calsheet.getDays(curmonth,curyear);
  108. String isselected = "";
  109. for (int k=curyear-80; k<=curyear+50; k++) {
  110. %>
  111.                       <option value="<%=k%>" <%=isselected%>><%=k%></option>
  112.                       <%
  113. isselected = "";
  114. }
  115. %>
  116.                     </select>
  117. <select name="BirthMonth">
  118.   <option value="">...
  119.   <%
  120.   String v = "";
  121.   for (int k=1; k<=12; k++) {
  122. v = k+"";
  123.   %>
  124.   <option value="<%=v%>" <%=isselected%>><%=k%></option>
  125.   <%
  126.    isselected = "";
  127.   }
  128.   %>
  129. </select>
  130. <select name="BirthDay">
  131.   <option value="">...
  132.   <%
  133.   for (int k=1; k<=monthdays; k++) {
  134. v = k+"";
  135.   %>
  136.   <option value="<%=v%>" <%=isselected%>><%=k%></option>
  137.   <%
  138.    isselected = "";
  139.   }
  140.   %>
  141. </select></td>
  142.                   <td width=142 height="28" bgcolor="#EEEEEE" class="stable"> 
  143.                     QQ:</td>
  144.                   <td class=stable height="28"><input type=text name=QQ size=16 maxlength="15"></td>
  145.                 </tr>
  146.                 <tr> 
  147.                   <td width=100 height="25" align=left bgcolor="#EEEEEE" class="stable"> 
  148.                     E-mail</td>
  149.                   <td height="25" class="stable"> <input type=text name=Email size=20 maxlength="50">                  </td>
  150.                   <td width=142 height="25" bgcolor="#EEEEEE" class="stable"> 
  151.                     MSN:</td>
  152.                   <td class=stable height="25"><input type=text name=MSN size=16 maxlength="15"></td>
  153.                 </tr>
  154.                 <tr> 
  155.                   <td width=100 height="25" align=left bgcolor="#EEEEEE" class="stable"> 
  156.                     电话</td>
  157.                   <td height="25" class="stable"> <input type=text name=Phone size=16 maxlength="20">                  </td>
  158.                   <td width=142 height="25" bgcolor="#EEEEEE" class="stable"> 
  159.                     手机号码</td>
  160.                   <td class=stable height="25"> <input type=text name=mobile size=16 maxlength="16">                  </td>
  161.                 </tr>
  162.                 <tr> 
  163.                   <td width=100 height="27" align=left bgcolor="#EEEEEE" class="stable"><img src=/images/c.gif width=1 height=5> 
  164.                     省份</td>
  165.                   <td height="27" valign="top" class="stable"> <select name=State size=1>
  166.                       <option value="0" selected>请选择…</option>
  167.                       <option value="安徽">安徽</option>
  168.                       <option value="北京">北京</option>
  169.                       <option value="重庆">重庆</option>
  170.                       <option value="福建">福建</option>
  171.                       <option value="甘肃">甘肃</option>
  172.                       <option value="广东">广东</option>
  173.                       <option value="广西">广西</option>
  174.                       <option value="贵州">贵州</option>
  175.                       <option value="海南">海南</option>
  176.                       <option value="河北">河北</option>
  177.                       <option value="黑龙江">黑龙江</option>
  178.                       <option value="河南">河南</option>
  179.                       <option value="湖北">湖北</option>
  180.                       <option value="湖南">湖南</option>
  181.                       <option value="内蒙古">内蒙古</option>
  182.                       <option value="江苏">江苏</option>
  183.                       <option value="江西">江西</option>
  184.                       <option value="吉林">吉林</option>
  185.                       <option value="辽宁">辽宁</option>
  186.                       <option value="宁夏">宁夏</option>
  187.                       <option value="青海">青海</option>
  188.                       <option value="山西">山西</option>
  189.                       <option value="陕西">陕西</option>
  190.                       <option value="山东">山东</option>
  191.                       <option value="上海">上海</option>
  192.                       <option value="四川">四川</option>
  193.                       <option value="天津">天津</option>
  194.                       <option value="西藏">西藏</option>
  195.                       <option value="新疆">新疆</option>
  196.                       <option value="云南">云南</option>
  197.                       <option value="浙江">浙江</option>
  198.                       <option value="其他">其他</option>
  199.                     </select> </td>
  200.                   <td height="25" align=left bgcolor="#EEEEEE" class="stable">城市</td>
  201.                   <td height="25" class="stable"><input type=text name=City size=10>                  </td>
  202.                 </tr>
  203.                 <tr>
  204.                   <td height="25" align=left bgcolor="#EEEEEE" class="stable">地址/邮政地址</td>
  205.                   <td height="25" class="stable"><input type=text name=Address size=25>                  </td> 
  206.                   <td height="36" align=left bgcolor="#EEEEEE" class="stable">邮政编码</td>
  207.                   <td height="36" class="stable"><input type=text name=postCode size=10>                  </td>
  208.                 </tr>
  209.                 <tr>
  210.                   <td height="25" align=left bgcolor="#EEEEEE" class="stable">身份证号码</td>
  211.                   <td height="25" valign="top" class="stable"><input type=text name=IDCard size=30>                  </td> 
  212.                   <td valign="top" class="stable">&nbsp;</td>
  213.                   <td valign="top" class="stable">&nbsp;</td>
  214.                 </tr>
  215.                 <tr>
  216.                   <td align=left bgcolor="#EEEEEE" class="stable"><img src=/images/c.gif width=1 height=8>兴趣爱好</td>
  217.                   <td colspan=3 class="stable"><input name="Hobbies" type=text size="30" ></td>
  218.                 </tr>
  219.               </table></td>
  220.           </tr>
  221.           <tr> 
  222.             <td bgcolor="#FFFFFF"> <table border=0 cellpadding=0 cellspacing=0 width=100%>
  223.                 <tr> 
  224.                   <td height=41 align="center"> 
  225.                     <input type=submit name=Write value=" 提 交 ">
  226.                       
  227.                     <input type=reset name=reset value=" 重 填 "> </td>
  228.                 </tr>
  229.               </table></td>
  230.           </tr>
  231.         </table></td>
  232. </tr></form></table>
  233. </body>
  234. <SCRIPT>
  235. function memberform_onsubmit()
  236. {
  237. if (memberform.RealName.value=="") {
  238. alert("请输入用户姓名");
  239. return false;
  240. }
  241. if (memberform.Password.value != memberform.Password2.value)
  242. {
  243. alert("两遍输入的口令不一致");
  244. memberform.Password.focus();
  245. return false;
  246. }
  247. return true;
  248. }
  249. </SCRIPT>
  250. </html>