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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.util.*"%>
  3. <%@ page import = "cn.js.fan.web.*"%>
  4. <%@ page import = "cn.js.fan.db.*"%>
  5. <%@ page import = "cn.js.fan.util.*"%>
  6. <%@ page import = "com.redmoon.oa.address.*"%>
  7. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>通讯录</title>
  13. <link href="../common.css" rel="stylesheet" type="text/css">
  14. <%@ include file="../inc/nocache.jsp"%>
  15. <%
  16. String strtype = ParamUtil.get(request, "type");
  17. int type = AddressDb.TYPE_USER;
  18. if (!strtype.equals(""))
  19. type = Integer.parseInt(strtype);
  20. if (type==AddressDb.TYPE_PUBLIC) {
  21. if (!privilege.isUserPrivValid(request, "admin.address.public")) {
  22. out.print(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, "pvg_invalid")));
  23. return;
  24. }
  25. }
  26. %>
  27. <%
  28.         String op = ParamUtil.get(request, "op");
  29. AddressMgr am = new AddressMgr();
  30. boolean re = false;
  31. if (op.equals("add")) {
  32. try {
  33. re = am.create(request);
  34. }
  35. catch (ErrMsgException e) {
  36. out.print(StrUtil.Alert(e.getMessage()));
  37. }
  38. if (re) {
  39. out.print(StrUtil.Alert("添加成功,请继续添加!"));
  40. }
  41. }
  42. %>
  43. </head>
  44. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  45. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  46.   <tr> 
  47.     <td width="100%" height="23" valign="middle" class="right-title"> <span>通 
  48.       讯 录 </span></td>
  49.   </tr>
  50.   <tr> 
  51.     <td valign="top">
  52.  <form name="form1" action="?op=add" method="post" onSubmit="return form1_onsubmit()">
  53.    <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="stable">
  54.          <tr bgcolor="#C4DAFF">
  55.            <td height="21" colspan="4" align="left" bgcolor="#C4DAFF" class="stable"><strong>类别</strong></td>
  56.          </tr>
  57.          <tr bgcolor="#EEEEEE">
  58.            <td height="19" align="center" class="stable">类&nbsp;&nbsp;别</td>
  59.            <td height="19" colspan="3" class="stable"><%
  60.   AddressTypeDb atd = new AddressTypeDb();
  61.   String opts = "";
  62.   String who = privilege.getUser(request);
  63.   if (type==AddressDb.TYPE_PUBLIC)
  64. who = AddressTypeDb.PUBLIC;
  65.   String sql = "select id from address_type where USER_NAME=" + StrUtil.sqlstr(who);
  66.   Iterator ir = atd.list(sql).iterator();
  67.   while (ir.hasNext()) {
  68.  atd = (AddressTypeDb)ir.next();
  69.  opts += "<option value='" + atd.getId() + "'>" + atd.getName() + "</option>";
  70.   }
  71. %>
  72.                <select name="typeId" id="typeId" >
  73.                  <option selected>-----请选择-----</option>
  74.                  <%=opts%>
  75.              </select></td>
  76.          </tr>
  77.          <tr bgcolor="#C4DAFF">
  78.            <td height="21" colspan="4" align="left" bgcolor="#C4DAFF" class="stable"><strong>个人信息</strong></td>
  79.          </tr>
  80.          <tr bgcolor="#EEEEEE">
  81.            <td  height="19" align="center" class="stable">姓&nbsp;&nbsp;名</td>
  82.            <td  height="19" class="stable"><input name="person" class="singleboarder" size=25>
  83.                <input type=hidden name="type" value="<%=type%>"></td>
  84.          </tr>
  85.          <tr bgcolor="#EEEEEE">
  86.            <td height="19" align="center" class="stable">昵&nbsp;&nbsp;称</td>
  87.            <td height="19" colspan="3" class="stable"><input name="nickname" class="singleboarder" size=25></td>
  88.          </tr>
  89.          <tr bgcolor="#EEEEEE">
  90.            <td height="19" align="center" class="stable">部门 </td>
  91.            <td height="19" colspan="3" class="stable"><input name="department" class="singleboarder" size=35></td>
  92.          </tr>
  93.          <tr bgcolor="#EEEEEE">
  94.            <td height="19" align="center" class="stable">科室</td>
  95.            <td height="19" colspan="3" class="stable"><input name="company" class="singleboarder" size=35></td>
  96.          </tr>
  97.         <tr bgcolor="#EEEEEE">
  98.            <td height="19" align="center" class="stable">职&nbsp;&nbsp;务</td>
  99.            <td height="19" colspan="3" class="stable"><input name="job" class="singleboarder" size=35></td>
  100.          </tr>
  101.  <tr bgcolor="#EEEEEE">
  102.            <td height="19" align="center" class="stable">办公室电话</td>
  103.            <td height="19" colspan="3" class="stable"><input name="operationPhone" class="singleboarder" size=35></td>
  104.          </tr>
  105.          <tr bgcolor="#EEEEEE">
  106.            <td height="19" align="center" class="stable">手机</td>
  107.            <td height="19" colspan="3" class="stable"><input name="mobile" class="singleboarder" size=35></td>
  108.          </tr>
  109.          <tr bgcolor="#EEEEEE">
  110.            <td height="19" align="center" class="stable">小灵通</td>
  111.            <td height="19" colspan="3" class="stable"><input name="beepPager" class="singleboarder" size=35></td>
  112.          </tr>
  113.          <tr bgcolor="#EEEEEE">
  114.            <td height="19" align="center" class="stable">Email</td>
  115.            <td height="19" colspan="3" class="stable"><input name="email" class="singleboarder" size=35></td>
  116.          </tr>
  117.          <tr bgcolor="#EEEEEE">
  118.            <td height="19" align="center" class="stable">住宅地址</td>
  119.            <td height="19" colspan="3" class="stable"><input name="street" class="singleboarder" size=35></td>
  120.          </tr>
  121.          <tr bgcolor="#EEEEEE">
  122.            <td height="19" align="center" class="stable">住宅电话</td>
  123.            <td height="19" colspan="3" class="stable"><input name="tel" class="singleboarder" size=25></td>
  124.          </tr>
  125.          <tr bgcolor="#EEEEEE">
  126.            <td height="19" align="center" class="stable">住宅传真</td>
  127.            <td height="19" colspan="3" class="stable"><input name="fax" class="singleboarder" size=35></td>
  128.          </tr>
  129.          <tr bgcolor="#EEEEEE">
  130.            <td height="19" align="center" class="stable">QQ</td>
  131.            <td height="19" colspan="3" class="stable"><input name="QQ" class="singleboarder" size=25></td>
  132.          </tr>
  133.          <tr bgcolor="#EEEEEE">
  134.            <td height="19" align="center" class="stable">MSN</td>
  135.            <td height="19" colspan="3" class="stable"><input name="MSN" class="singleboarder" size=25></td>
  136.          </tr>
  137.          <tr bgcolor="#EEEEEE">
  138.            <td height="19" align="center" class="stable">网页</td>
  139.            <td height="19" colspan="3" class="stable"><input name="web" class="singleboarder" size=35></td>
  140.          </tr>
  141.          <tr bgcolor="#EEEEEE">
  142.            <td height="19" align="center" class="stable">邮政编码</td>
  143.            <td height="19" colspan="3" class="stable"><input name="companyPostcode" class="singleboarder" size=35></td>
  144.          </tr>
  145.          <tr bgcolor="#EEEEEE">
  146.            <td height="19" align="center" class="stable">业务传真</td>
  147.            <td height="19" colspan="3" class="stable"><input name="operationFax" class="singleboarder" size=35></td>
  148.          </tr>
  149.          <tr bgcolor="#EEEEEE">
  150.            <td height="19" align="center" class="stable">地&nbsp;&nbsp;址</td>
  151.            <td height="19" colspan="3" class="stable"><input name="address" class="singleboarder" size=45></td>
  152.          </tr>
  153.          <tr bgcolor="#EEEEEE">
  154.            <td height="17" align="center" class="stable">附注</td>
  155.            <td height="17" colspan="3" bgcolor="#EEEEEE" class="stable"><textarea name="introduction" cols="50" class="singleboarder" rows="8"></textarea> </td>
  156.          </tr>
  157.          <tr bgcolor="#EEEEEE">
  158.            <td colspan="4" align="center" class="stable"><input name="submit" type=submit class="singleboarder" value="发送">
  159.              &nbsp;&nbsp;&nbsp;
  160.              <input name="reset" type=reset class="singleboarder" value="取消">           </td>
  161.          </tr>
  162.        </table>
  163.  </form>    </td>
  164.   </tr>
  165. </table>
  166. </body>
  167. <script>
  168. function form1_onsubmit() {
  169. if (form1.typeId.value=="") {
  170. alert("类别不能为空!");
  171. return false;
  172. }
  173. }
  174. </script>
  175. </html>