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

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