home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Shareware / Programare / bugzero / jsp / attachment.jsp < prev    next >
Text File  |  2004-12-03  |  3KB  |  99 lines

  1. <%@ page language="java"
  2.     session="true"
  3.     import="com.websina.util.*,com.websina.bean.*,com.websina.util.log.Log"
  4.     errorPage="error.jsp" 
  5. %>
  6. <%@ include file="_charset.jspf" %>
  7. <%@ include file="_cache.jspf" %>
  8. <%
  9.   String contextPath = request.getContextPath();
  10.   String formId = request.getParameter("formId");
  11.   IssueForm issueForm = null;
  12.   if(formId != null) { 
  13.     issueForm = (IssueForm)session.getAttribute("issueForm"+formId);
  14.   }
  15.   if (issueForm == null) {
  16.     out.print("<center><font color=red><b>");
  17.     out.print("Sorry, you are in an invalid state");
  18.     out.print("</b></font></center>");
  19.     return;
  20.   }
  21.  
  22. %>
  23. <html>
  24. <head>
  25. <title>File Attachment</title>
  26. <meta http-equiv=Content-Type content="text/html">
  27. <script LANGUAGE="JavaScript" src="script/attachment.js"></script>
  28. <LINK rel="StyleSheet" href="css/styles.css" type="text/css">
  29. </head>
  30.  
  31. <body bgcolor="#ffffff">
  32. <center>
  33.  <br>
  34. <table cellspacing=0 cellpadding=2 border=0>    
  35. <tr><td>
  36. <b>File Attachment</b>
  37. </td></tr><tr><td>
  38. <table cellspacing=0 cellpadding=2 border=0 class="box">    
  39. <tr class="header"><td colspan=3>
  40. Attach a file in two steps, repeating the steps as needed to attach multiple files.
  41. Click OK when you are done  
  42. </font> 
  43. </td></tr>
  44. <tr><td colspan=3> </td></tr>
  45. <tr><td>
  46. 1. Click <b>Browse</b> to select the file, or<br>
  47.    type the path to the file in the field below.
  48. </td><td colspan=2>
  49. 2. Click <b>Attach</b> to move the file
  50.    <br>   to the Attached Files box.
  51. </td></tr>
  52. <tr><td colspan=3> </td></tr>
  53. <tr><td colspan=2>
  54.  Find File</td>
  55. <td>Attached Files</td></tr>
  56. <tr><td>
  57. <form method="POST" ENCTYPE="multipart/form-data"
  58.       action="<%=contextPath%>/servlet/upload?id=<%=formId%>">
  59. <input type=file size=32 name=attachment></td>
  60. <td align=center>
  61. <input type=submit class="button" value=" Attach "></td>
  62. </td>
  63. </form>
  64. <form method="POST" name="attachForm"
  65.       action="<%=contextPath%>/servlet/upload?id=<%=formId%>">
  66.   <input type="hidden" name="action">
  67. <td rowspan=3>
  68.  <select name=attached_files size=5 multiple>
  69.   <% 
  70.      Attachment attachment = issueForm.getAttachment();
  71.      if (attachment != null) {
  72.   %>
  73.    <%=ListMaker.makeOptionList(attachment.getAllFilenames()) %>
  74.   <% } %>
  75.  </select></td>
  76. </tr>
  77. <tr><td> </td>
  78. <td align=center><input type=button class="button" value="Remove" 
  79. onClick="do_remove(attachForm)">
  80. </td></tr>
  81. <tr><td colspan=2 height=32> </td></tr>
  82. <tr><td colspan=3 align=center height=30>
  83. <input type=button class="button" value="  OK  " onClick="do_ok(attachForm)">
  84. <input type=button class="button" value="Cancel" onClick="do_cancel(attachForm)">
  85. </td></tr>
  86. </form>
  87. <% String msg = request.getParameter("msg");
  88.    if (msg != null) {
  89. %>
  90. <tr><td colspan=3 align=center>
  91. <font color=red><b><%=msg%></b></font> 
  92. </td></tr>
  93. <% } %>
  94. </table>
  95. </td></tr></table>
  96. </center>
  97. </body>
  98. </html>
  99.