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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=gb2312"%>
  2. <%@ page import = "java.net.URLEncoder"%>
  3. <%@ page import = "com.redmoon.oa.db.PageQuery"%>
  4. <%@ include file="inc/inc.jsp"%>
  5. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  6. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  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=gb2312">
  11. <title>审批流程</title>
  12. <link href="common.css" rel="stylesheet" type="text/css">
  13. <script language="JavaScript" type="text/JavaScript">
  14. <!--
  15. function MM_preloadImages() { //v3.0
  16.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  17.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  18.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  19. }
  20. //-->
  21. </script>
  22. <script language=javascript>
  23. <!--
  24. function openWin(url,width,height)
  25. {
  26.   var newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=120,width="+width+",height="+height);
  27. }
  28. //-->
  29. </script>
  30. </head>
  31. <body background="" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  32. <%
  33. String priv="read";
  34. if (!privilege.isUserPrivValid(request,priv))
  35. {
  36. out.println(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  37. return;
  38. }
  39. %>
  40. <table width="90%" border="0">
  41.   <tr>
  42.     <td></td>
  43.   </tr>
  44. </table>
  45. <jsp:useBean id="pdflow" scope="page" class="com.redmoon.oa.flow.PreDefinedFlow"/>
  46. <%
  47. priv="predefinedflow";
  48. boolean isPrivValid = privilege.isUserDepartmentPrivValid(request,priv);
  49. if (!isPrivValid) {
  50. out.println(fchar.makeErrMsg("您无定义流程的权限!"));
  51. return;
  52. }
  53. String op = fchar.getNullString(request.getParameter("op"));
  54. if (op.equals("add")) {
  55. if (pdflow.Add(request))
  56. out.println(fchar.Alert("增加成功!"));
  57. else
  58. out.println(fchar.Alert("增加失败!"));
  59. }
  60. if (op.equals("modify")) {
  61. if (pdflow.Modify(request))
  62. out.println(fchar.Alert("修改成功!"));
  63. else
  64. out.println(fchar.Alert("修改失败!"));
  65. }
  66. if (op.equals("delete")) {
  67. if (pdflow.Delete(request))
  68. out.println(fchar.Alert("删除成功!"));
  69. else
  70. out.println(fchar.Alert("删除失败!"));
  71. }
  72. %>
  73. <table width="494" height="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  74.   <tr> 
  75.     <td height="23" valign="bottom" background="images/tab-b-top.gif">     <span class="right-title">预 
  76.       定 义 审 批 流 程</span></td>
  77.   </tr>
  78.   <tr> 
  79.     <td valign="top" background="images/tab-b-back.gif">
  80. <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  81.     <form name="form1" method="post" action="?op=add">
  82.     <tr>
  83.             <td height="28" align="center">流程名称&nbsp; 
  84.               <input type="text" name="title">
  85.               &nbsp; 
  86.               <input name="Submit" type="submit" class="singleboarder" value="增加流程">
  87.            
  88.             </td>
  89.   </tr> </form>
  90. </table>
  91.       <%
  92. PageQuery pagebean = new PageQuery("ttoa");
  93. String sql;
  94. String myname = privilege.getUser(request);
  95. String department_id = privilege.getDepartmentID(request);
  96. sql = "select id,title from predefined_flow where department_id="+department_id;
  97. int pagesize = 10;
  98. pagebean.setPageSize(pagesize);
  99. String Query = fchar.getNullString(request.getParameter("Query"));
  100. if (!Query.equals(""))
  101. sql = Query;
  102. ResultSet rs=pagebean.myQuery(sql,request) ; 
  103. pagebean.PageLegend(response);
  104. int curpage,totalpages;
  105. curpage = pagebean.getCurrentPages();
  106. totalpages = pagebean.getTotalPages();
  107. if (totalpages==0)
  108. {
  109. curpage = 1;
  110. totalpages = 1;
  111. }
  112. int i = 0;
  113. String id="";
  114. String title="";
  115. try
  116. {
  117.   if (rs!=null )
  118.   {
  119.     if (pagebean.getTotalPages()>0)
  120. {
  121. %>
  122.       <br>
  123.       <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  124.         <tr> 
  125.           <td width="47"><img src="images/title1-l.gif" width="47" height="25"></td>
  126.           <td valign="top" background="images/title1-back.gif"><div align="center" class="title1">找到符合条件的记录 
  127.               <b><%=pagebean.getTotal() %></b> 条 每页显示 <b><%=pagebean.getPageSize() %></b> 
  128.               条 页次 <b><%=curpage %>/<%=totalpages %></b></div></td>
  129.           <td width="47"><img src="images/title1-r.gif" width="47" height="25"></td>
  130.         </tr>
  131.       </table>
  132.       <br> <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="pt1">
  133.         <tr> 
  134.           <td width="632" height="24" background=""><table width="98%" border="0" align="center" cellpadding="2" cellspacing="0" class="stable">
  135.               <tr align="center" bgcolor="#C4DAFF" class="stable"> 
  136.                 <td width="18%" height="22" class="stable"> <div align="center">ID</div></td>
  137.                 <td width="54%" class="stable">标题</td>
  138.                 <td width="28%" class="stable">设定流程</td>
  139.               </tr>
  140.             </table></td>
  141.         </tr>
  142.         <tr> 
  143.           <td valign="top" background=""> 
  144.             <%
  145. do
  146. {
  147. i++;
  148. id = rs.getString(1);
  149. title = rs.getString(2);
  150. %>
  151.             <table width="98%" border="0" align="center" cellpadding="2" cellspacing="0" class="stable">
  152. <form action="?op=modify" method=post>
  153.               <tr bgcolor="#EEEEEE" class="stable"> 
  154.                 <td width="19%" class="stable"><%=id%><input type=hidden name=id value="<%=id%>"></td>
  155.                 <td width="53%" bgcolor="#EEEEEE" class="stable"><input name=title class="singleboarder" value="<%=title%>" size=40></td>
  156.                 <td width="28%" bgcolor="#EEEEEE" class="stable"><input name="Submit2" type="submit" class="singleboarder" value="修改">
  157.                     <input name="Submit3" type="button" class="singleboarder" onClick="javascript:window.location.href='predefinedflow.jsp?op=delete&id=<%=id%>'" value="删除">
  158.                     <input name="Submit4" type="button" class="singleboarder" onClick="javascript:window.location.href='predefinedflow_edit.jsp?predefined_flow_id=<%=id%>'" value="定义">
  159.                   </td>
  160.               </tr>
  161.  </form>
  162.             </table>
  163.             <%
  164. }
  165. while(i<pagesize && rs.next());
  166. }
  167. else
  168. out.println(fchar.p_center("<BR><BR><BR><BR>暂无文件!"));
  169.   }
  170.   else
  171. out.println(fchar.p_center("<BR><BR><BR><BR>暂无文件!"));
  172.   
  173. }
  174. catch(SQLException e)
  175. {
  176.   out.print("出错: ");
  177.   out.print(e);
  178.   out.print(e.getMessage());
  179. }
  180. if (rs!=null)
  181. {
  182. rs.close();
  183. rs = null;
  184. }
  185. pagebean.clear();
  186. %>
  187.           </td>
  188.         </tr>
  189.         <tr> 
  190.           <td height="13" background="" class="pt1">&nbsp;</td>
  191.         </tr>
  192.       </table>
  193. </td>
  194.   </tr>
  195.   <tr> 
  196.     <td height="9"><img src="images/tab-b-bot.gif" width="494" height="9"></td>
  197.   </tr>
  198. </table>
  199. <table width="61%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  200.   <tr> 
  201.     <td width="2%" height="23">&nbsp;</td>
  202.     <td width="91%" valign="baseline" height="23"> 
  203.       <div align="right"> 
  204.         <%
  205.   String querystr = "";
  206.   %>
  207.         <%if(!pagebean.getFirstPage().equals("none")) {%>
  208.         <a href="predefinedflow.jsp?<%=pagebean.getFirstPage()+querystr%>"><img src="images/first.gif" width="41" height="12" border="0"></a> 
  209.         <% }
  210.     if(!pagebean.getPrevPage().equals("none")){
  211.      %>
  212.         &nbsp;<a href="predefinedflow.jsp?<%=pagebean.getPrevPage()+querystr%>"><img src="images/forward.gif" width="47" height="12" border="0"></a> 
  213.         <% } 
  214.     
  215.   if(!pagebean.getNextPage().equals("none")){%>
  216.         &nbsp;<a href="predefinedflow.jsp?<%=pagebean.getNextPage()+querystr%>"><img src="images/next.gif" width="47" height="12" border="0"></a> 
  217.         <% }
  218.                   if(!pagebean.getLastPage().equals("none")){   %>
  219.         &nbsp;<a href="predefinedflow.jsp?<%=pagebean.getLastPage()+querystr%>"><img src="images/last.gif" width="41" height="12" border="0"></a> 
  220.         <% }%>
  221.         &nbsp;</div></td>
  222.     <td width="7%" height="23"></td>
  223.   </tr>
  224. </table>
  225. </body>
  226. </html>