FavoritesManage.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:10k
源码类别:

OA系统

开发平台:

Java

  1. <%@ page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="com.gforce.gfoa.*,com.gforce.currency.*,java.util.*" %>
  3. <jsp:include page="/CheckLogin.jsp" flush="true"/> <% Session m_session = new Session(session); %>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
  7. <title>收藏夹管理-- GForce OA 2.0</title>
  8. <link href="/css/txt.jsp" rel="stylesheet" type="text/css">
  9. <script language="JavaScript" src="/js/changestyle.js">
  10. </script>
  11. <script language="JavaScript" type="text/javascript">
  12. function checkaddFavorites()
  13. {
  14.     if(document.addFavorites.Name.value=='')
  15.     {
  16.         alert("请输入收藏夹信息名称!");
  17.         document.addFavorites.Name.focus();
  18.         return false;
  19.     }
  20.     if(document.addFavorites.URL.value=='')
  21.     {
  22.         alert("请输入网址!");
  23.         document.addFavorites.URL.focus();
  24.         return false;
  25.     }
  26.     if(document.addFavorites.KindsID.value=='0' || document.addFavorites.KindsID.value==0)
  27.     {
  28.         alert("请选择收藏分类!");
  29.         document.addFavorites.KindsID.focus();
  30.         return false;
  31.     }
  32.     var now = new Date();
  33.     document.addFavorites.LastViewTime.value= now.getYear() + "-" + (now.getMonth()+1) + "-" + now.getDate() + " " + now.getHours() + ":" + now.getMinutes();
  34. }
  35. </script>
  36. </head>
  37. <body bgcolor="<%=m_session.GetString("BackColor")%>" leftmargin="0" topmargin="0">
  38. <table width="100%" height="100%" border="0" align="center" cellspacing="0">
  39.     <tr>
  40.         <td align="center" valign="top"><p>&nbsp;</p>
  41. <%
  42. Request t_request = new Request(request);
  43. int intUserID = m_session.GetInt("UserID");
  44. int intKindsID = t_request.GetInt("KindsID");
  45. String strKindsIDs = "";
  46. if(intKindsID<1)
  47. {
  48.     Vector vtKinds = FavoritesKindManager.getAllRecord(intUserID);
  49.     if(vtKinds.size()>0)
  50.     {
  51.     out.println("<table width="90%" border="1" cellpadding="3" cellspacing="1" style="">");
  52.     out.println("<tr align="center" valign="middle" bgcolor="" + m_session.GetString("TitleColor") + ""><th colspan="5">收藏夹分类</th></tr>");
  53.     int i=0;
  54.     for(;i < vtKinds.size() ; i++)
  55.     {
  56.         if((i + 1) % 5 == 1) out.println("<tr class="DataRowsSingle" align="center" valign="middle">");
  57.         out.println("<td border="0" class="DataCols" onmouseover="mouseontd(this);" onmouseout="mouseouttd(this,'DataCols');" width="20%" title="" + ((Vector)vtKinds.get(i)).get(1).toString() + "" onclick="window.open('FavoritesManage.jsp?KindsID="  + ((Vector)vtKinds.get(i)).get(0).toString() + "','_self');"><a>" + ((Vector)vtKinds.get(i)).get(1).toString() + "</a></td>");
  58.         if((i + 1) % 5 == 0) out.println("</tr>");
  59.         strKindsIDs += "," + ((Vector)vtKinds.get(i)).get(0).toString();
  60.     }
  61.     if((i) % 5 != 0)
  62.     {
  63.         i= (i) % 5;
  64.         for(;i<5;i++) out.println("<td border="0" class="DataCols" onmouseover="mouseontd(this);" onmouseout="mouseouttd(this,'DataCols');" width="20%">&nbsp;</td>");
  65.         out.println("</tr>");
  66.     }
  67.     out.println("</table><br>");
  68.     strKindsIDs = strKindsIDs.substring(1);
  69.     }
  70. }
  71. else
  72. {
  73.     strKindsIDs = intKindsID + "";
  74.     out.println("<table width="90%" border="1" cellpadding="1" cellspacing="1" bordercolordark="#ffffff" bordercolorlight="#0A0A0A" style="">");
  75.     out.println("<tr align="center" valign="middle" bgcolor="" + m_session.GetString("TitleColor") + ""><th colspan="5">收藏夹分类:"+FavoritesKindManager.getKindNameByID(intKindsID)+"</th></tr>");
  76.     out.println("<tr class="DataRowsDouble" align="left" valign="middle"><td colspan="5"><a href="FavoritesManage.jsp">返回收藏夹根目录</a></td></tr>");
  77. }
  78. if(strKindsIDs.length()>0)
  79. {
  80. Vector vt = FavoritesManager.getAllRecord(intKindsID);
  81. %>
  82.             <table width="90%" border="1" cellpadding="3" cellspacing="0" bordercolordark="#ffffff" bordercolorlight="#0a0a0a" style="">
  83.                 <tr align="center" valign="middle" bgcolor="<%=m_session.GetString("TitleColor")%>">
  84.                     <th width="3%" height="24" nowrap><img src="/images/white.gif" width="12"></th>
  85.                     <th width="5%" nowrap><font color="#000000">序号</font></th>
  86.                     <th width="40%" nowrap><font color="#000000">收藏名称</font></th>
  87.                     <th width="10%" nowrap><font color="#000000">最后浏览时间</font></th>
  88.                     <th width="5%" nowrap><font color="#000000">浏览次数</font></th>
  89.                     <th width="11%" nowrap><font color="#000000">修改</font></th>
  90.                     <th width="11%" nowrap><font color="#000000">删除</font></th>
  91.                 </tr>
  92.                 <%
  93. for(int i=0;i<vt.size();i++)
  94. {
  95.     String strID = ((Vector)vt.get(i)).get(0).toString();
  96.     if(i % 2 == 0)
  97.         out.println("<tr id="Row"+ i+ "" class="DataRowsSingle" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsSingle');">");
  98.     else
  99.         out.println("<tr id="Row"+ i+ "" class="DataRowsDouble" onmouseover="mouseon(this,'image" + i + "');" onmouseout="mouseout(this,'image" + i + "','DataRowsDouble');">");
  100.     out.println("<td align="right" valign="middle"><img id="image" + i + "" src="../images/lastpost1.gif" style="display:none;"> </td>");
  101.     out.println("<td align="center" valign="middle">" + (i+1) + "</td>");
  102.     out.println("<td align="center" valign="middle" nowrap title="" + ((Vector)vt.get(i)).get(2).toString() + "" onclick="window.open('FavoritesLink.jsp?ID=" + strID + "','_blank')">" + ((Vector)vt.get(i)).get(1).toString() + "</td>");
  103.     out.println("<td align="center" valign="middle" nowrap>" + StringNew.GetDateString(((Vector)vt.get(i)).get(3).toString(),"MM月dd日HH:mm")  + "</td>");
  104.     out.println("<td align="center" valign="middle" nowrap>" + ((Vector)vt.get(i)).get(4).toString()+ "</td>");
  105.     if(intKindsID>0)
  106.     {
  107.       out.println("<td align="center" valign="middle" nowrap><a href="EditFavorites.jsp?ID=" + strID + "">修改</a></td>");
  108.       out.println("<td align="center" valign="middle" nowrap><a href="DelFavorites.jsp?ID=" + strID + "&KindsID=" + intKindsID + "" onclick="return confirm('您确实要删除该收藏信息吗?');">删除</a></td>");
  109.     }
  110.     else
  111.     {
  112.       out.println("<td align="center" valign="middle" nowrap>&nbsp;</td>");
  113.       out.println("<td align="center" valign="middle" nowrap>&nbsp;</td>");
  114.     }
  115.     out.println("</tr>");
  116. }
  117. %>
  118.             </table>
  119.             <form name="addFavorites" action="AddFavoritesAction.jsp" method="post" onSubmit="javascript:return checkaddFavorites();">
  120.             <table  border="1" cellpadding="1" cellspacing="1" width="90%">
  121.                 <tr>
  122.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">收&nbsp;藏&nbsp;名&nbsp;称:&nbsp;</font></td>
  123.                     <td align="left" valign="middle" width="70%" nowrap>
  124.                         &nbsp;<input name="Name" type="text" maxlength="40" size="70">
  125.                     </td>
  126.                 </tr>
  127.                 <tr>
  128.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">链&nbsp;接&nbsp;网&nbsp;址:&nbsp;</font></td>
  129.                     <td align="left" valign="middle" width="70%" nowrap>
  130.                         &nbsp;<input name="URL" type="text" maxlength="40" size="70">
  131.                         <input name="LastViewTime" type="hidden" value="<%=StringNew.GetDateString(new Date(),"yyyy-MM-dd HH:mm")%>">
  132.                     </td>
  133.                 </tr>
  134.                 <tr>
  135.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">收&nbsp;藏&nbsp;分&nbsp;类:&nbsp;</font></td>
  136.                     <td align="left" valign="middle" width="70%" nowrap>
  137.                         &nbsp;<select name="KindsID">
  138. <option value="0" <%if(intKindsID==0)out.print("selected");%>>请选择收藏分类</option>
  139. <%
  140. Vector vtKinds = FavoritesKindManager.getAllRecord(intUserID);
  141. for(int i=0;i<vtKinds.size();i++)
  142. {
  143.     if(((Vector)vtKinds.get(i)).get(0).toString().equalsIgnoreCase("" + intKindsID))
  144.         out.println("<option value="" + ((Vector)vtKinds.get(i)).get(0).toString() + "" selected>" + ((Vector)vtKinds.get(i)).get(1).toString() + "</option>");
  145.     else
  146.         out.println("<option value="" + ((Vector)vtKinds.get(i)).get(0).toString() + "">" + ((Vector)vtKinds.get(i)).get(1).toString() + "</option>");
  147. }
  148. %>
  149.                         </select>
  150.                     </td>
  151.                 </tr>
  152.                 <tr>
  153.                     <td align="right" valign="middle" width="14%"><font color="#0A0A0A">是&nbsp;否&nbsp;共&nbsp;享:&nbsp;</font></td>
  154.                     <td align="left" valign="middle" width="70%" nowrap>
  155.                         <font color="#0A0A0A">&nbsp;<input name="IsOpen" type="radio" value="1">公开共享&nbsp;&nbsp;&nbsp;&nbsp;<input name="IsOpen" type="radio" value="0" checked>私人保密</font>
  156.                     </td>
  157.                 </tr>
  158.             </table>
  159.             <table width="90%" border="0">
  160.                 <tr>
  161.                     <td>&nbsp;</td>
  162.                </tr>
  163.                 <tr>
  164.                   <td>&nbsp;</td>
  165.                    <td align="right" valign="middle" nowrap>
  166.                    <input type="submit" value="添 加" style="background-color: #FFFFFF; border: 1 solid #000000">&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="重 填" style="background-color: #FFFFFF; border: 1 solid #000000">
  167.                     </td>
  168.                 </tr>
  169.                 <tr>
  170.                     <td align="right" valign="middle">&nbsp;</td>
  171.                </tr>
  172.             </table>
  173.             </form>
  174. <%
  175. }
  176. else
  177. {
  178.     out.println("<script language="javascript">alert("您还没有建立收藏夹分类,请先建立收藏夹分类!");window.location="FavoritesKindManage.jsp";</script>");
  179. }
  180. %>
  181.         </td>
  182.     </tr>
  183. </table>
  184. </body>
  185. </html>