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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="com.redmoon.oa.netdisk.*" %>
  3. <%@ page import="java.util.*" %>
  4. <%@ page import="cn.js.fan.util.*" %>
  5. <%@ page import="cn.js.fan.web.*" %>
  6. <%@ page import="com.redmoon.oa.address.*"%>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  8. <html>
  9. <head>
  10. <LINK href="../common.css" type=text/css rel=stylesheet>
  11. <LINK href="default.css" type=text/css rel=stylesheet>
  12. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  13. <title>通讯录框架-左侧</title>
  14. <style type="text/css">
  15. <!--
  16. body {
  17. margin-left: 0px;
  18. margin-right: 0px;
  19. margin-bottom: 0px;
  20. }
  21. .menutitle{
  22. cursor:pointer;
  23. margin-bottom: 5px;
  24. background-color:#ECECFF;
  25. color:#000000;
  26. width:140px;
  27. padding:2px;
  28. text-align:center;
  29. font-weight:bold;
  30. /*/*/border:1px solid #000000;/* */
  31. }
  32. .submenu{
  33. margin-bottom: 0.1em;
  34. }
  35. -->
  36. </style>
  37. </head>
  38. <script type="text/javascript">
  39. /***********************************************
  40. * Switch Menu script- by Martial B of http://getElementById.com/
  41. * Modified by Dynamic Drive for format & NS4/IE4 compatibility
  42. * Visit http://www.dynamicdrive.com/ for full source code
  43. ***********************************************/
  44. var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
  45. var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
  46. if (document.getElementById){ //DynamicDrive.com change
  47. document.write('<style type="text/css">n')
  48. document.write('.submenu{display: none;}n')
  49. document.write('</style>n')
  50. }
  51. function SwitchMenu(obj){
  52. if(document.getElementById){
  53. var el = document.getElementById(obj);
  54. var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
  55. if(el.style.display != "block"){ //DynamicDrive.com change
  56. for (var i=0; i<ar.length; i++){
  57. if (ar[i].className=="submenu") //DynamicDrive.com change
  58. ar[i].style.display = "none";
  59. }
  60. el.style.display = "block";
  61. }else{
  62. el.style.display = "none";
  63. }
  64. }
  65. }
  66. function get_cookie(Name) { 
  67. var search = Name + "="
  68. var returnvalue = "";
  69. if (document.cookie.length > 0) {
  70. offset = document.cookie.indexOf(search)
  71. if (offset != -1) { 
  72. offset += search.length
  73. end = document.cookie.indexOf(";", offset);
  74. if (end == -1) end = document.cookie.length;
  75. returnvalue=unescape(document.cookie.substring(offset, end))
  76. }
  77. }
  78. return returnvalue;
  79. }
  80. function onloadfunction(){
  81. if (persistmenu=="yes"){
  82. var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
  83. var cookievalue=get_cookie(cookiename)
  84. if (cookievalue!="")
  85. document.getElementById(cookievalue).style.display="block"
  86. }
  87. }
  88. function savemenustate(){
  89. var inc=1, blockid=""
  90. while (document.getElementById("sub"+inc)){
  91. if (document.getElementById("sub"+inc).style.display=="block"){
  92. blockid="sub"+inc
  93. break
  94. }
  95. inc++
  96. }
  97. var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
  98. var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
  99. document.cookie=cookiename+"="+cookievalue
  100. }
  101. if (window.addEventListener)
  102. window.addEventListener("load", onloadfunction, false)
  103. else if (window.attachEvent)
  104. window.attachEvent("onload", onloadfunction)
  105. else if (document.getElementById)
  106. window.onload=onloadfunction
  107. if (persistmenu=="yes" && document.getElementById)
  108. window.onunload=savemenustate
  109. </script>
  110. <body>
  111. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  112. <%
  113. String priv = "read";
  114. if (!privilege.isUserPrivValid(request, priv))
  115. {
  116. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  117. return;
  118. }
  119. String strtype = ParamUtil.get(request, "type");
  120. int type = AddressDb.TYPE_USER;
  121. if (!strtype.equals(""))
  122. type = Integer.parseInt(strtype);
  123. String mode = ParamUtil.get(request, "mode");
  124. if (!mode.equals("show")) {
  125. if (type==AddressDb.TYPE_PUBLIC) {
  126. if (!privilege.isUserPrivValid(request, "admin.address.public")) {
  127. out.print(SkinUtil.makeErrMsg(request, SkinUtil.LoadString(request, "pvg_invalid")));
  128. return;
  129. }
  130. }
  131. }
  132. %>
  133. <table width="100%"  border="0">
  134.   <tr>
  135.     <td align="left"><div class="tableframe" id="masterdiv">
  136.       <table width="100%" style="cursor:hand" border="0" cellpadding="0" cellspacing="1" onclick="SwitchMenu('sub1')">
  137.         <tr>
  138.           <td height="25" align="center" bgcolor="#5286BD"><strong><font color="#ffffff"><%=(type==AddressDb.TYPE_PUBLIC)?"公共":""%>通讯录分组</font></strong></td>
  139.         </tr>
  140.       </table>
  141.       <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="submenu" id="sub1">
  142.         <tr>
  143.           <td height="22" align="center"><a href="address.jsp?groupType=0&type=<%=strtype%>&mode=<%=mode%>" target="mainAddressFrame">全部</a></td>
  144.         </tr>
  145.         <%
  146. String groupType = "";
  147. AddressTypeDb atd = new AddressTypeDb();
  148. String userName = privilege.getUser(request);
  149. if (type==AddressDb.TYPE_PUBLIC)
  150. userName = AddressTypeDb.PUBLIC;
  151. String sql1 = "select id from address_type where USER_NAME=" + StrUtil.sqlstr(userName);
  152. Iterator ir1 = atd.list(sql1).iterator();
  153. while (ir1.hasNext()) {
  154. atd = (AddressTypeDb)ir1.next();
  155. groupType = atd.getName();
  156. int typeId = atd.getId();
  157.   %>
  158.         <tr>
  159.           <td height="22" align="center"><a href="address.jsp?groupType=<%=typeId%>&type=<%=strtype%>&mode=<%=mode%>" target="mainAddressFrame"> <%=groupType%></a></td>
  160.         </tr>
  161.         <%}%>
  162.       </table>
  163.       <table width="100%" style="cursor:hand" border="0" cellpadding="0" cellspacing="1" onclick="SwitchMenu('sub2')">
  164.         <tr>
  165.           <td height="25" align="center" bgcolor="#5286BD"><strong><font color="#ffffff"><%=(type==AddressDb.TYPE_PUBLIC)?"公共":""%>通讯录管理</font></strong></td>
  166.         </tr>
  167.       </table>
  168.       <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="submenu" id="sub2">
  169.         <tr>
  170.           <td height="22" align="center"><a href="address_add.jsp?type=<%=type%>" target="mainAddressFrame">添加</a></td>
  171.         </tr>
  172.   <tr>
  173.           <td height="22" align="center"><a href="address_search.jsp?type=<%=type%>" target="mainAddressFrame">查询</a></td>
  174.          </tr>
  175.   <tr>
  176.           <td height="22" align="center"><a href="address_type_list.jsp?type=<%=type%>" target="mainAddressFrame">类别管理</a></td>
  177.         </tr>
  178.       </table>
  179.     </div> </td>
  180.   </tr>
  181. </table>
  182. </body>
  183. </html>