book_type_list.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "java.util.*"%>
  4. <%@ page import = "cn.js.fan.util.*"%>
  5. <%@ page import = "com.redmoon.oa.book.*"%>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  10. <title>添加图书类别</title>
  11. <link href="../common.css" rel="stylesheet" type="text/css">
  12. <%@ include file="../inc/nocache.jsp"%>
  13. <script language="JavaScript" type="text/JavaScript">
  14. <!--
  15. function openWin(url,width,height)
  16. {
  17.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=150,left=220,width="+width+",height="+height);
  18. }
  19. //-->
  20. </script>
  21. <style type="text/css">
  22. <!--
  23. .style2 {font-size: 14px}
  24. .STYLE3 {color: #FFFFFF}
  25. .STYLE4 {
  26. color: #000000;
  27. font-weight: bold;
  28. }
  29. .STYLE5 {color: #FF0000}
  30. .STYLE6 {color: #000000}
  31. -->
  32. </style>
  33. </head>
  34. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  35. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  36. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  37. <%
  38. String priv="book.all";
  39. if (!privilege.isUserPrivValid(request, priv)) {
  40. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  41. return;
  42. }
  43. String op = ParamUtil.get(request, "op");
  44. if (op.equals("add")) {
  45. BookTypeMgr btm = new BookTypeMgr();
  46. boolean re = false;
  47. try {
  48.   re = btm.create(request);
  49. }
  50. catch (ErrMsgException e) {
  51. out.print(StrUtil.Alert(e.getMessage()));
  52. }
  53. if (re)
  54. out.print(StrUtil.Alert("操作成功!"));
  55. }
  56. if (op.equals("del")) {
  57. BookTypeMgr btm = new BookTypeMgr();
  58. boolean re = false;
  59. try {
  60. re = btm.del(request);
  61. }
  62. catch (ErrMsgException e) {
  63. out.print(StrUtil.Alert(e.getMessage()));
  64. }
  65. if (re)
  66. out.print(StrUtil.Alert("操作成功!"));
  67. }
  68. %>
  69. <%@ include file="book_inc_menu_top.jsp"%>
  70. <br>
  71. <table width="541" height="89" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableframe">
  72. <tr>
  73.   <td height="23" background="../images/top-right.gif" class="right-title"><span> &nbsp;图书类别管理</span></td>
  74. </tr>
  75.  
  76.       <tr>
  77.         <td align="center"><table width="88%" height="81"  border="0" cellpadding="0" cellspacing="0" class=" STYLE3 STYLE3">
  78.           <tr>
  79.             <td class="p14"></td>
  80.           </tr>
  81.           <tr> </tr>
  82.           <tr>
  83.             <td class="p14">&nbsp;</td>
  84.           </tr>
  85.           <tr>
  86.             <td class="p14"><%
  87.   BookTypeDb btd = new BookTypeDb();
  88.   String sql = "select id from book_type";
  89.   Iterator ir = btd.list(sql).iterator();
  90.   while (ir.hasNext()) {
  91.    btd = (BookTypeDb)ir.next();%>
  92.                 <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  93.                   <tr>
  94.     <td width="59%"><%=btd.getName()%></td>
  95.                     <td width="16%"><a href="book_type_edit.jsp?id=<%=btd.getId()%>">编辑</a></td>
  96.                     <td width="11%"><a href="#" onClick="if (confirm('您确定要删除<%=btd.getName()%>吗?')) window.location.href='?op=del&id=<%=btd.getId()%>'">删除</a></td>
  97.                   </tr>
  98.                 </table>
  99.               <%}%>            </td>
  100.           </tr>
  101.         </table></td>
  102.       </tr>
  103.   
  104.   <tr> 
  105.   <tr>
  106.     <td></td>
  107.   </tr>
  108.   <form id=form1 name="form1" action="?op=add" method=post>
  109.     <td valign="top">
  110.   <tr>
  111.    <td>&nbsp;</td>
  112.   </tr>
  113.   <tr>
  114.         <td height="26" align="center"><span class="STYLE6">图书类别名称(<span class="STYLE5">*</span>)</span><span class="STYLE4">:</span>
  115.           <input name="name" width="200">
  116.           &nbsp;&nbsp;&nbsp;&nbsp;
  117.           <input name="submit" type=submit class="button1" value="添  加">
  118.     &nbsp;</span></td>
  119.       </tr>
  120.   </form>
  121. </table>
  122. </td>
  123.   </tr>
  124.   <tr> 
  125.     <td height="9">&nbsp;</td>
  126.   </tr>
  127. <br>
  128. <br>
  129. </body>
  130. </html>