CategoryManage.jsp~7~
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

JavaScript

  1. <%@ page contentType="text/html; charset=GBK" %>
  2. <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
  3. <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  4. <%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
  5. <html>
  6. <head>
  7. <title>NewsCategory</title>
  8. <script type="text/javascript">
  9. function SaveCategory(){
  10.   var form = document.getElementById('categoryActionForm');
  11.   var style = document.getElementById("hidStyle").value;
  12.   if(document.getElementById("txtCatName").value == ""){
  13.     alert("分类名没有填写");
  14.     return false;
  15.   }
  16.   if(document.getElementById("txtOrder").value == ""){
  17.     alert("分类排序顺序没有填写");
  18.     return false;
  19.   }
  20.   form.action = "<%=request.getContextPath() %>/Manage/Category.do?todo=EditNewsCategory&style=" + style;
  21. }
  22. function DeleteCategory(count,catID){
  23.   var form = document.getElementById('categoryActionForm');
  24.   var style = document.getElementById("hidStyle").value;
  25.   var v = Number(count);
  26.   var Key = '<c:out value="${param.Key}" />';
  27.   if(v == "0"){
  28.     if(Key == ""){
  29.       form.action = "<%=request.getContextPath() %>/Manage/Category.do?todo=DeleteCategory&Style=" + style + "&catID=" + catID;
  30.     }else{
  31.       form.action = "<%=request.getContextPath() %>/Manage/Category.do?todo=DeleteCategory&Key=" + Key + "&catID=" + catID;
  32.     }
  33.     form.submit();
  34.   }else{
  35.     alert("分类下有记录,必须将记录移到其他分类或删除后方可删除该分类");
  36.     return false;
  37.   }
  38. }
  39. </script>
  40. <link href="<%=request.getContextPath() %>/Manage/Css/skinv2.0.css" rel="stylesheet" type="text/css" />
  41. </head>
  42. <body bgcolor="#ffffff">
  43. <html:form method="post" action="/Manage/Category.do?todo=OpenCategoryByKey" enctype="multipart/form-data">
  44. <table cellspacing="0" cellpadding="0" width="100%" border="0">
  45.   <tr bgcolor="#cfdbe8">
  46.     <td style="WIDTH: 20px" width="20" bgcolor="#cfdbe8" height="19">&nbsp;<img height="10" src="<%=request.getContextPath() %>/Manage/images/icon.gif" width="12" alt="" /></td>
  47.     <td valign="middle" bgcolor="#cfdbe8" colspan="2">&nbsp; 企业荣誉管理</td>
  48.   </tr>
  49.   <tr>
  50.     <td style="HEIGHT: 31px" valign="top" align="left" height="80">&nbsp;</td>
  51.     <td style="HEIGHT: 31px" valign="middle" align="left" colspan="2">
  52.       &nbsp;<img src="<%=request.getContextPath() %>/Manage/images/edit.gif" align="middle" alt="" />&nbsp;录入年份
  53.     </td>
  54.   </tr>
  55.   <tr>
  56.     <td style="HEIGHT: 1px" valign="top" align="left"></td>
  57.     <td style="HEIGHT: 1px" valign="top" align="left" width="820" bgcolor="#cfdbe8"></td>
  58.     <td style="HEIGHT: 1px; width: 144px;" valign="top" align="left"></td>
  59.   </tr>
  60.   <tr>
  61.     <td style="HEIGHT: 381px" valign="top" align="left"></td>
  62.     <td style="HEIGHT: 381px" valign="top" align="left" colspan="2">
  63.       <br/>
  64.       <table align="left" bgcolor="#cccccc" border="0" cellpadding="1" cellspacing="1" width="98%">
  65.         <tr bgcolor="#ffffff">
  66.           <td style="height: 25px; width: 117px;">
  67.           &nbsp; 添加分类:
  68.           </td>
  69.           <td style="height: 23px">
  70.             <input type="text" id="txtCatName" name="categoryName" value='<c:out value="${cat.cat_Name}" />' />
  71.             <input type="submit" id="btnSaveCategory" value="保存" onclick="return SaveCategory();" />
  72.             <input type="hidden" name="categoryID" value='<c:out value="${cat.cat_ID}" />' />
  73.             <input type="hidden" id="hidStyle" name="style" value='<c:out value="${style}" />' />
  74.             <input type="hidden" id="hidSuperior" name="superior" value='<c:out value="${superior}" />' />
  75.           </td>
  76.         </tr>
  77.         <tr bgcolor="#ffffff">
  78.           <td style="height: 25px; width: 117px;">
  79.           &nbsp; 分类排序:
  80.           </td>
  81.           <td style="height: 23px">
  82.             <input type="text" id="txtOrder" name="order" value='<c:out value="${cat.cat_Order}" />' />
  83.           </td>
  84.         </tr>
  85.         <tr bgcolor="#ffffff">
  86.           <td style="height: 25px; width: 117px;">
  87.           &nbsp; 现有分类:
  88.           </td>
  89.           <td style="height: 23px">
  90.             <table width="460" border="0" cellpadding="0" cellspacing="0" class="table_Left">
  91.               <tr>
  92.                 <td height="25" width="200" align="center" bgcolor="#5983B0" class="STYLE1 table_Right"><strong>分类名</strong></td>
  93.                 <td width="100" align="center" bgcolor="#5983B0" class="STYLE1 table_Right"><strong>记录数</strong></td>
  94.                 <td width="160" align="center" bgcolor="#5983B0" class="STYLE1 table_Right"><strong>操作</strong></td>
  95.               </tr>
  96.             </table>
  97.             <div id="divList">
  98.               <c:forEach var="cat" items="${list}" varStatus="status">
  99.                 <table width="460" border="0" cellpadding="0" cellspacing="0" class="table_Left">
  100.                   <tr>
  101.                     <td width="200" class="table_Right" height="25">
  102.                       &nbsp;<c:out value="${cat.cat_Name}" />
  103.                     </td>
  104.                     <td width="100" class="table_Right">
  105.                       &nbsp;<c:out value="${cat.newsCount}" />
  106.                     </td>
  107.                     <td width="160" align="center" class="table_Right">
  108.                       <a href='<%=request.getContextPath() %>/Manage/'>编辑</a>
  109.                       &nbsp;|&nbsp;
  110.                       <a href='javascript:DeleteCategory(<c:out value="${cat.newsCount}" />,<c:out value="${cat.cat_ID}" />)'>删除</a>
  111.                       &nbsp;|&nbsp;
  112.                       <a href='<%=request.getContextPath() %>/Manage/News.do?todo=OpenNewsList&CatID=<c:out value="${cat.cat_ID}" />'>信息</a>
  113.                     </td>
  114.                   </tr>
  115.                 </table>
  116.               </c:forEach>
  117.             </div>
  118.           </td>
  119.         </tr>
  120.       </table>
  121.     </td>
  122.   </tr>
  123. </table>
  124. </html:form>
  125. </body>
  126. </html>