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