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

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