Guest User

slider.jsp

a guest
Sep 17th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.94 KB | None | 0 0
  1. <%
  2.     if (session.getAttribute("codutente") == null) {
  3.         response.sendRedirect("login.jsp");
  4.     }
  5. %>
  6. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  7.     pageEncoding="ISO-8859-1"%>
  8.  
  9. <%@ page import="servlet.Infoutente"%>
  10. <%@ page import="servlet.Getimage"%>
  11. <%@ page import="servlet.Upload"%>
  12. <%
  13.     Infoutente utente = (Infoutente) request.getAttribute("foto");
  14. %>
  15.  
  16. <%-- <%@ page import="servlet.Infoutente" %>
  17. <%@ page import="servlet.Getimage" %> --%>
  18.  
  19.  
  20. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  21.  
  22. <html>
  23. <head>
  24. <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  25. <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
  26. <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" id="theme">
  27. <link rel="stylesheet" href="fileupload/jquery.fileupload-ui.css">
  28. <link rel=stylesheet href="style.css" type="text/css">
  29. <style>
  30. #immagine {
  31.     width: 600px;
  32.     height: 450px;
  33.     border: 0px solid #000000;
  34. }
  35.  
  36. #msg{
  37.  
  38. }
  39. </style>
  40.  
  41. <script type="text/javascript">
  42.  
  43.  
  44. var url= new Array();
  45. var didascalia=new Array();
  46. var data=new Array();
  47. var cod=null;
  48.  
  49. function assegnaVettore(length)
  50. {
  51.     var j=0;
  52. <%
  53. //String url="";
  54. for(int i=0; i<utente.getDimfoto(); i++)
  55. {  
  56. %>
  57.     url[j]="<%=utente.getUrl(i)%>";
  58.     didascalia[j]="<%=utente.getDidascalia(i)%>";
  59.     data[j]="<%=utente.getDatacaricamento(i)%>";
  60.     j++;
  61. <% }%>
  62. //return url;
  63.    
  64. }
  65.  
  66. var counter=0;
  67. var dim=<%=utente.getDimfoto()%>-1;
  68. function avanti()
  69. {
  70.     if(counter==dim)
  71.     {
  72.         counter=0;
  73.         immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
  74.     }else{
  75.         counter++;
  76.         immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
  77.     }
  78. }
  79.  
  80. function indietro()
  81. {
  82.     if(counter==0){
  83.         counter=dim;
  84.         immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
  85.     }else{
  86.         counter--;
  87.         immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
  88.     }
  89. }
  90.  
  91.    
  92. </script>
  93.  
  94. <title>Slider</title>
  95. </head>
  96. <%
  97.  
  98. int len=utente.getDimfoto(); %>
  99. <body onload="assegnaVettore(<%=len%>);counter=-1;avanti();">
  100.  
  101.         <jsp:useBean id="userBean" class="servlet.Infoutente" scope="session" />
  102. <jsp:setProperty property="*" name="userBean"/>
  103.     <%  userBean.setCodupload(utente.getCodupload()); %>
  104.     <center>
  105.         <div id="immagine"></div>
  106.        
  107.  
  108.         <input type="button" value="indietro" onClick="indietro();">
  109.         <input type="button" value="avanti" onClick="avanti();">
  110.         <div id="msg"></div>
  111.     </center>
  112.    
  113. <!-- <div id="upload" align="center">
  114. <br><br><br> -->
  115. <form id="file_upload" action="Up" method="POST" enctype="multipart/form-data">
  116.  <input type="text" name="uploadhi" value="<%=userBean.getCodupload()%>">
  117.     <input id="file_1" type="file" name="file_1">
  118.     <!--< div id="drop_zone_1">
  119.         <input id="file_1" type="file" name="file_1">
  120.        
  121.         <div>Carica Foto</div>
  122.     </div> -->
  123.    
  124.     <input type="submit" value="upload">
  125.     <!-- <button>Upload</button>
  126.       -->
  127.     <table id="files_1" style="background:red;"></table>
  128. <!--
  129.     <div id="progressbar" style="width: 500px; height: 30px;"></div>
  130.     <div id="risultato"
  131.         style="color: #FF3300; font-weight: bold; font-size: 15px;"></div>
  132.     <iframe id="uploadIframe" name="uploadIframe" height="300" width="500"
  133.         frameborder="0" scrolling="auto"></iframe> -->
  134.        
  135. </form>
  136. <!-- </div> -->
  137.  
  138. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
  139. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
  140. <script src="fileupload/jquery.fileupload.js"></script>
  141. <script src="fileupload/jquery.fileupload-ui.js"></script>
  142. <script>
  143.  
  144. /*global $ */
  145. /* $(function () {
  146.     var initFileUpload = function (suffix) {
  147.         $('#file_upload').fileUploadUI({
  148.             namespace: 'file_upload_' + suffix,
  149.             fileInputFilter: '#file_' + suffix,
  150.             dropZone: $('#drop_zone_' + suffix),
  151.             uploadTable: $('#files_' + suffix),
  152.             downloadTable: $('#files_' + suffix),
  153.             buildUploadRow: function (files, index) {
  154.                 return $('<tr><td>' + files[index].name + '<\/td>' +
  155.                         '<td class="file_upload_progress"><div><\/div><\/td>' +
  156.                         '<td class="file_upload_cancel">' +
  157.                         '<button class="ui-state-default ui-corner-all" title="Cancel">' +
  158.                         '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
  159.                         '<\/button><\/td><\/tr>');
  160.             },
  161.             buildDownloadRow: function (file) {
  162.                 return $('<tr><td>' + file.name + '<\/td><\/tr>');
  163.             }
  164.         });
  165.     };
  166.     initFileUpload(1);
  167. }); */
  168. </script>
  169.  
  170. </body>
  171. </html>
Advertisement
Add Comment
Please, Sign In to add comment