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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="com.redmoon.oa.person.*"%>
  4. <%@ page import="com.redmoon.oa.dept.*"%>
  5. <%@ page import="cn.js.fan.util.*"%>
  6. <%@ page import="cn.js.fan.security.*"%>
  7. <%@ page import="com.redmoon.oa.basic.*"%>
  8. <html>
  9. <head>
  10. <title>编辑用户信息</title>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <link rel="stylesheet" href="../common.css" type="text/css">
  13. <script>
  14. function New(para_URL){var URL=new String(para_URL);window.open(URL,'','resizable,scrollbars')}
  15. function check_checkbox(myitem,myvalue)
  16. {
  17.      var checkboxs = document.all.item(myitem);
  18.  
  19.  var myary = myvalue.split("|");
  20.  
  21.      if (checkboxs!=null)
  22.      {
  23.        for (i=0; i<checkboxs.length; i++)
  24.           {
  25.             if (checkboxs[i].type=="checkbox" )
  26.               {
  27. for (k=0; k<myary.length; k++) {
  28.  if (checkboxs[i].value==myary[k])
  29.                  checkboxs[i].checked = true
  30. }
  31.               }
  32.           }
  33.      }
  34. }
  35. </script>
  36. <style type="text/css">
  37. <!--
  38. .style1 {color: #000000}
  39. -->
  40. </style>
  41. </head>
  42. <body bgcolor="#FFFFFF" text="#000000">
  43. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  44. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  45. <%
  46. //String priv="admin";
  47. //if (!privilege.isUserPrivValid(request,priv))
  48. //{
  49. // out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  50. // return;
  51. //}
  52. %>
  53. <div id="newdiv" name="newdiv">
  54. <%
  55. String username = ParamUtil.get(request, "name");
  56. if (!SecurityUtil.isValidSqlParam(username)) {
  57. out.print(StrUtil.Alert("参数非法!"));
  58. return;
  59. }
  60. UserMgr um = new UserMgr();
  61. UserDb user = um.getUserDb(username);
  62. if (user==null || !user.isLoaded()) {
  63. out.print(StrUtil.Alert_Back("该用户已不存在!"));
  64. return;
  65. }
  66. %>
  67. <table width=98% align=center cellspacing=0 cellpadding=0 border=0>
  68.  <Form method="POST" action="user_edit_do.jsp"  name="memberform" onSubmit="return memberform_onsubmit()"><tr>
  69.       <td bgcolor=#D3D3D3> <table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor="#CCCCCC">
  70.           <tr> 
  71.             <td align=center bgcolor="#FFFFFF"> <table border=0 cellpadding=0 cellspacing=0 width=100%>
  72.                 <tr bgcolor="#C4DAFF"> 
  73.                   <td width="82%" height=24 bgcolor="#C4DAFF" class="stable"><b> </b>职员信息
  74.                     </td>
  75.                   <td width="18%" align="center" bgcolor="#C4DAFF" class="stable"><a href="user_list.jsp">返回职员列表</a></td>
  76.                 </tr>
  77.               </table>
  78.               <table width=100% border=0 cellpadding=2 cellspacing=0>
  79.                 <tr> 
  80.                   <td width="100" align=left bgcolor="#eeeeee" class="stable">用户名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  81.                   <td width="300" class="stable"><%=user.getName()%>
  82.                     <input type=hidden name="name" size=20 value="<%=user.getName()%>"></td>
  83.                   <td class="stable">启用帐号 
  84.                     <select name=isValid size=1>
  85.                       <option value="1" selected>是</option>
  86.                       <option value="0">否</option>
  87.                   </select> <script language="javascript">
  88. <!--
  89. memberform.isValid.value = "<%=user.getValid()%>"
  90. //-->
  91. </script> 
  92.                   &nbsp;&nbsp;<a href="user_op.jsp?op=edit&name=<%=StrUtil.UrlEncode(user.getName())%>">分配权限</a> </td>
  93.                 </tr>
  94.                 <tr class="stable"> 
  95.                   <td align="left" valign="top" bgcolor="#eeeeee" class="stable"> 登陆密码                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  96.                   <td colspan="2" valign="top" class="stable"><input type=password name=Password size=20>
  97.                     <font color="#FF0000">*</font> 请再次输入密码
  98.                     <input type=password name=Password2 size=20>
  99.                     <font color="#FF0000"> * 
  100. (如不需更改密码,则不用填写) </font> </td>
  101.                 </tr>
  102.                 <tr class="stable"> 
  103.                   <td height="22" align=left valign="top" bgcolor="#eeeeee" class="stable"> 
  104.                     真实姓名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  105.                   <td height="22" align=left valign="top" class="stable"><input type=text name=RealName size=12 maxlength=8 value="<%=user.getRealName()%>"></td>
  106.                   <td height="22" align=left valign="top" class="stable">磁盘份额&nbsp;
  107.                   <input name="diskSpaceAllowed" value="<%=user.getDiskSpaceAllowed()%>">字节</td>
  108.                 </tr>
  109.                 <tr class="stable">
  110.                   <td height="22" align=left valign="top" bgcolor="#eeeeee" class="stable">职级</td>
  111.                   <td height="22" align=left valign="top" class="stable"><select name="rankCode">
  112.                     <option value="">无</option>
  113.                     <%
  114. RankDb rd = new RankDb();
  115. Iterator ir = rd.list().iterator();
  116. String opts = "";
  117. while (ir.hasNext()) {
  118. rd = (RankDb)ir.next();
  119. opts += "<option value='" + rd.getCode() + "'>" + rd.getName() + "</option>";
  120. }
  121. out.print(opts);
  122. %>
  123.                   </select>
  124.   <script>
  125.   memberform.rankCode.value = "<%=user.getRankCode()%>";
  126.   </script>
  127.   </td>
  128.                   <td height="22" align=left valign="top" class="stable">&nbsp;</td>
  129.                 </tr>
  130.               </table>
  131.               <table width=100% border=0 cellpadding=0 cellspacing=0>
  132.                 <tr> 
  133.                   <td height=24 bgcolor="#C4DAFF" class="stable"><b> </b>个人资料</td>
  134.                 </tr>
  135.               </table>
  136.               <table width=100% border=0 cellpadding=2 cellspacing=0>
  137.                 <tr> 
  138.                   <td width=100 height="25" align=left bgcolor="#eeeeee" class="stable"> 
  139.                     性别</td>
  140.                   <td width="300" height="25" class="stable"> <% 
  141.   String isM = "";
  142.   String isF="";
  143.   if (user.getGender()==0)
  144.    isM = "checked";
  145.   else
  146.    isF = "checked";
  147.   %> <input type=radio name=gender value=0 <%=isM%>>
  148.                     男 
  149.                     <input type=radio name=gender value=1 <%=isF%>>
  150.                   女</td>
  151.                   <td width="115" height="28" align="left" bgcolor="#eeeeee" class="stable">婚姻状况</td>
  152.                   <td height="28" class=stable><select name=Marriage size=1>
  153.                       <option value="" selected>请选...</option>
  154.                       <option value="0">已婚</option>
  155.                       <option value="1">未婚</option>
  156.                     </select>
  157.                   <script language="JavaScript">
  158. <!--
  159. memberform.Marriage.value="<%=user.getMarriaged()%>";
  160. //-->
  161. </script></td>
  162.                 </tr>
  163.                 <tr> 
  164.                   <td width=102 height="28" align=left bgcolor="#eeeeee" class="stable"> 
  165.                     出生日期</td>
  166.                   <td height="28" class="stable"> 
  167.   <%
  168. Date bd = user.getBirthday();
  169. String y="",m="",d="";
  170. if (bd!=null) {
  171. Calendar cal = Calendar.getInstance();
  172. cal.setTime(bd);
  173. y = "" + cal.get(cal.YEAR);
  174. m = "" + (cal.get(cal.MONTH) + 1);
  175. d = "" + cal.get(cal.DAY_OF_MONTH);
  176. }
  177.   %>
  178. <jsp:useBean id="calsheet" scope="page" class="com.redmoon.oa.CalendarSheet"/>
  179.                     <select name="BirthYear">
  180. <option value="">请选择</optoin>
  181.                       <%
  182. int curyear = calsheet.getCurYear();
  183. int curmonth = calsheet.getCurMonth();
  184. int curday = calsheet.getCurDay();
  185. int monthdays = 31;// calsheet.getDays(curmonth,curyear);
  186. String isselected = "";
  187. for (int k=curyear-80; k<=curyear+50; k++) {
  188. if ((k+"").equals(y))
  189. isselected = "selected";
  190. %>
  191.                       <option value="<%=k%>" <%=isselected%>><%=k%></option>
  192.                       <%
  193. isselected = "";
  194. }
  195. %>
  196.                     </select>
  197. <select name="BirthMonth">
  198. <option value="">...</optoin>
  199.   <%
  200.   String v = "";
  201.   for (int k=1; k<=12; k++) {
  202.    if ((k+"").equals(m))
  203. isselected = "selected";
  204. v = k+"";
  205.   %>
  206.   <option value="<%=v%>" <%=isselected%>><%=k%></option>
  207.   <%
  208.    isselected = "";
  209.   }
  210.   %>
  211. </select>
  212. <select name="BirthDay">
  213. <option value="">...</optoin>
  214.   <%
  215.   for (int k=1; k<=monthdays; k++) {
  216.    if ((k+"").equals(d))
  217. isselected="selected";
  218. v = k+"";
  219.   %>
  220.   <option value="<%=v%>" <%=isselected%>><%=k%></option>
  221.   <%
  222.    isselected = "";
  223.   }
  224.   %>
  225. </select>
  226. 日 &nbsp;</td>
  227.                   <td width="115" height="25" align="left" bgcolor="#eeeeee" class="stable">QQ</td>
  228.                   <td height="25" align="left" class=stable><input type=text name=QQ size=16 maxlength="15" value="<%=user.getQQ()%>">                  </td>
  229.                 </tr>
  230.                 <tr> 
  231.                   <td width=102 height="25" align=left bgcolor="#eeeeee" class="stable"> 
  232.                     E-mail</td>
  233.                   <td height="25" class="stable"> <input type=text name=Email size=20 maxlength="50" value="<%=StrUtil.getNullString(user.getEmail())%>">                  </td>
  234.                   <td width=115 height="25" align="left" bgcolor="#eeeeee" class="stable">MSN</td>
  235.                   <td class=stable height="25"><input type=text name=MSN size=16 maxlength="16" value="<%=StrUtil.getNullString(user.getMSN())%>"></td>
  236.                 </tr>
  237.                 <tr> 
  238.                   <td width=102 height="25" align=left bgcolor="#eeeeee" class="stable"> 
  239.                     电话</td>
  240.                   <td height="25" class="stable"> <input type=text name=Phone size=16 maxlength="20" value="<%=StrUtil.getNullString(user.getPhone())%>">                  </td>
  241.                   <td width=115 height="25" align="left" bgcolor="#eeeeee" class="stable"> 
  242.                     手机号码</td>
  243.                   <td class=stable height="25"> <input type=text name=mobile size=16 maxlength="16" value="<%=user.getMobile()%>">
  244.                     <font color="#FF0000">
  245.                     <input type="hidden" name="RealPic" value="1">
  246.                   </font>                  </td>
  247.                 </tr>
  248.                 <tr> 
  249.                   <td width=102 height="27" align=left bgcolor="#eeeeee" class="stable">省份</td>
  250.                   <td height="27" valign="top" class="stable"> <select name=State size=1>
  251.                       <option value="" selected>请选择…</option>
  252.                       <option value="安徽">安徽</option>
  253.                       <option value="北京">北京</option>
  254.                       <option value="重庆">重庆</option>
  255.                       <option value="福建">福建</option>
  256.                       <option value="甘肃">甘肃</option>
  257.                       <option value="广东">广东</option>
  258.                       <option value="广西">广西</option>
  259.                       <option value="贵州">贵州</option>
  260.                       <option value="海南">海南</option>
  261.                       <option value="河北">河北</option>
  262.                       <option value="黑龙江">黑龙江</option>
  263.                       <option value="河南">河南</option>
  264.                       <option value="湖北">湖北</option>
  265.                       <option value="湖南">湖南</option>
  266.                       <option value="内蒙古">内蒙古</option>
  267.                       <option value="江苏">江苏</option>
  268.                       <option value="江西">江西</option>
  269.                       <option value="吉林">吉林</option>
  270.                       <option value="辽宁">辽宁</option>
  271.                       <option value="宁夏">宁夏</option>
  272.                       <option value="青海">青海</option>
  273.                       <option value="山西">山西</option>
  274.                       <option value="陕西">陕西</option>
  275.                       <option value="山东">山东</option>
  276.                       <option value="上海">上海</option>
  277.                       <option value="四川">四川</option>
  278.                       <option value="天津">天津</option>
  279.                       <option value="西藏">西藏</option>
  280.                       <option value="新疆">新疆</option>
  281.                       <option value="云南">云南</option>
  282.                       <option value="浙江">浙江</option>
  283.                       <option value="其他">其他</option>
  284.                     </select> <script language="JavaScript">
  285. <!--
  286. memberform.State.value="<%=StrUtil.getNullString(user.getState())%>"
  287. //-->
  288. </script> </td>
  289.                   <td width="115" align="left" valign="top" bgcolor="#eeeeee" class="stable">城市
  290.                   <br></td>
  291.                   <td valign="top" class="stable"><input type=text name=City size=10 value="<%=StrUtil.getNullString(user.getCity())%>"></td>
  292.                 </tr>
  293.                 <tr> 
  294.                   <td width=102 height="25" align=left bgcolor="#eeeeee" class="stable">地址/邮政地址</td>
  295.                   <td height="25" valign="top" class="stable"><input type=text name=Address size=25 value="<%=StrUtil.getNullString(user.getAddress())%>"></td>
  296.                   <td width="115" align="left" valign="top" bgcolor="#eeeeee" class="stable">邮政编码</td>
  297.                   <td valign="top" class="stable"><input type=text name=postCode size=10 value="<%=user.getPostCode()%>"></td>
  298.                 </tr>
  299.                 <tr> 
  300.                   <td width=102 height="25" align=left bgcolor="#eeeeee" class="stable">身份证号码</td>
  301.                   <td height="25" class="stable"><input type=text name=IDCard size=30 value="<%=StrUtil.getNullString(user.getIDCard())%>"></td>
  302.                   <td valign="top" bgcolor="#eeeeee" class="stable">&nbsp;</td>
  303.                   <td valign="top" class="stable">&nbsp;</td>
  304.                 </tr>
  305.                 
  306.                 <tr> 
  307.                   <td width=102 align=left valign="top" bgcolor="#eeeeee" class="stable"><img src="images/c.gif" width=1 height=8>兴趣爱好</td>
  308.                   <td colspan=3><input type=text size="30" name="Hobbies" value="<%=user.getHobbies()%>" ></td>
  309.                 </tr>
  310.               </table></td>
  311.           </tr>
  312.           <tr> 
  313.             <td bgcolor="#FFFFFF"> <table border=0 cellpadding=0 cellspacing=0 width=100%>
  314.                 
  315.                 <tr> 
  316.                   <td height=41 align="center">  
  317.                     <input type=submit name=Write value=" 提 交 ">
  318.                       
  319.                     <input type=reset name=reset value=" 重 填 "> </td>
  320.                 </tr>
  321.               </table></td>
  322.           </tr>
  323.         </table></td>
  324. </tr></form></table>
  325. </body>
  326. <SCRIPT>
  327. function memberform_onsubmit()
  328. {
  329. if (memberform.RealName.value=="") {
  330. alert("请输入用户姓名");
  331. return false;
  332. }
  333. if (memberform.Password.value != memberform.Password2.value)
  334. {
  335. alert("两遍输入的口令不一致");
  336. memberform.Password.focus();
  337. return false;
  338. }
  339. return true;
  340. }
  341. </SCRIPT>
  342. </html>