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

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. <%@ page import = "com.redmoon.oa.dept.*"%>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <title>图书类别编辑</title>
  12. <link href="../common.css" rel="stylesheet" type="text/css">
  13. <%@ include file="../inc/nocache.jsp"%>
  14. <script language="JavaScript" type="text/JavaScript">
  15. <!--
  16. //-->
  17. </script>
  18. <style type="text/css">
  19. <!--
  20. .style2 {font-size: 14px}
  21. -->
  22. </style>
  23. </head>
  24. <body background="" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
  25. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  26. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  27. <%
  28. String priv = "book.all";
  29. if (!privilege.isUserPrivValid(request, priv)) {
  30. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  31. return;
  32. }
  33. String op = ParamUtil.get(request, "op");
  34. if (op.equals("modify")) {
  35. BookMgr bm = new BookMgr();
  36. boolean re = false;
  37. try {
  38. re = bm.modify(request);
  39. }
  40. catch (ErrMsgException e) {
  41. out.print(StrUtil.Alert(e.getMessage()));
  42. }
  43. if (re)
  44. out.print(StrUtil.Alert("操作成功!"));
  45. }
  46. int id = ParamUtil.getInt(request, "id");
  47. BookDb btd = new BookDb();
  48. BookTypeDb btdb = new BookTypeDb();
  49. btd = btd.getBookDb(id);
  50. int typeId = btd.getTypeId();
  51. String pubDate = DateUtil.format(btd.getPubDate(), "yyyy-MM-dd");
  52. %>
  53. <%@ include file="book_inc_menu_top.jsp"%>
  54. <br>
  55. <table width="629" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="tableframe">
  56.   <form action="book_do.jsp?op=modify" name="form1" method="post">
  57.     <tr>
  58.       <td colspan="4" class="right-title">修改图书</td>
  59.     </tr>
  60.     <tr>
  61.       <td width="74">书名: </td>
  62.       <td width="231"><input name="bookName" type="text" id="bookName" value="<%=btd.getBookName()%>" size="30" maxlength="100">
  63.       <font color=red>*<span class="TableData">
  64.       <input type=hidden name="id" value="<%=btd.getId()%>">
  65.       </span></font></td>
  66.       <td width="79">图书编号:</td>
  67.       <td width="183"><input type="text"  name="bookNum" id="bookNum" value="<%=btd.getBookNum()%>" maxlength="110" >
  68.       <font color=red>*</font></td>
  69.     </tr>
  70.     <tr>
  71.       <td>图书类别:</td>
  72.       <td><%
  73.   String opts = "";
  74.   Iterator ir = btdb.list().iterator();
  75.   while (ir.hasNext()) {
  76.     btdb = (BookTypeDb)ir.next();
  77.     opts += "<option value='" + btdb.getId() + "'>" + btdb.getName() + "</option>";
  78.   }
  79.   %>
  80.           <select name="typeId" id="typeId" >
  81.             <option selected>-----请选择-----</option>
  82.             <%=opts%>
  83.           </select>
  84.         <font color=red>*</font>
  85. <script>
  86. form1.typeId.value = "<%=btdb.getId()%>";
  87. </script>
  88. </td>
  89.       <td>图书归属:</td>
  90.       <td width="183"><select name="deptCode">
  91.         <%
  92. DeptMgr dm = new DeptMgr();
  93. DeptDb lf = dm.getDeptDb(DeptDb.ROOTCODE);
  94. DeptView dv = new DeptView(lf);
  95. dv.ShowDeptAsOptions(out, lf, lf.getLayer()); 
  96.  %>
  97.       </select>
  98. <script>
  99. form1.deptCode.value = "<%=btd.getDeptCode()%>";
  100. </script>
  101.   </td>
  102.     </tr>
  103.     <tr>
  104.       <td>作者: </td>
  105.       <td><input name="author" type="text" id="author" value="<%=btd.getAuthor()%>" size="30" maxlength="100"></td>
  106.       <td>价格:(¥)</td>
  107.       <td><input type="text" name="price" id="price" maxlength="100" value="<%=btd.getPrice()%>">
  108.           <font color=red>*</font></td>
  109.     </tr>
  110.     <tr>
  111.       <td>出版社:</td>
  112.       <td><input name="pubHouse" type="text" id="pubHouse" value="<%=btd.getPubHouse()%>" size="30" maxlength="100"></td>
  113.       <td>出版日期: </td>
  114.       <td><input name="pubDate" type="text" id="pubDate"value="<%=pubDate%>" maxlength="100">
  115.           <img style="CURSOR: hand" onClick="SelectDate('pubDate', 'yyyy-MM-dd')" src="../images/form/calendar.gif" align="absMiddle" border="0" width="26" height="26"></td>
  116.     </tr>
  117.     <tr>
  118.       <td align="left" nowrap>内容简介:</td>
  119.       <td colspan="3"><textarea  name="brief"  id="brief" style="width:100%" rows="8" ><%=btd.getBrief()%></textarea>      </td>
  120.     </tr>
  121.     <tr>
  122.       <td colspan="4" align="center"><input name="submit2" type="submit"  value="确定" >
  123.         &nbsp;
  124.         <input name="reset" type="reset"  value="重置" >      </td>
  125.     </tr>
  126.   </form>
  127. </table>
  128. <br>
  129. <br>
  130. </body>
  131. </html>