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