Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- if (session.getAttribute("codutente") == null) {
- response.sendRedirect("login.jsp");
- }
- %>
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%@ page import="servlet.Infoutente"%>
- <%@ page import="servlet.Getimage"%>
- <%@ page import="servlet.Upload"%>
- <%
- Infoutente utente = (Infoutente) request.getAttribute("foto");
- %>
- <%-- <%@ page import="servlet.Infoutente" %>
- <%@ page import="servlet.Getimage" %> --%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
- <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
- <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" id="theme">
- <link rel="stylesheet" href="fileupload/jquery.fileupload-ui.css">
- <link rel=stylesheet href="style.css" type="text/css">
- <style>
- #immagine {
- width: 600px;
- height: 450px;
- border: 0px solid #000000;
- }
- #msg{
- }
- </style>
- <script type="text/javascript">
- var url= new Array();
- var didascalia=new Array();
- var data=new Array();
- var cod=null;
- function assegnaVettore(length)
- {
- var j=0;
- <%
- //String url="";
- for(int i=0; i<utente.getDimfoto(); i++)
- {
- %>
- url[j]="<%=utente.getUrl(i)%>";
- didascalia[j]="<%=utente.getDidascalia(i)%>";
- data[j]="<%=utente.getDatacaricamento(i)%>";
- j++;
- <% }%>
- //return url;
- }
- var counter=0;
- var dim=<%=utente.getDimfoto()%>-1;
- function avanti()
- {
- if(counter==dim)
- {
- counter=0;
- immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
- }else{
- counter++;
- immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
- }
- }
- function indietro()
- {
- if(counter==0){
- counter=dim;
- immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
- }else{
- counter--;
- immagine.innerHTML="<img border=0 src=/imagesharing/images/"+url[counter]+"><br><br>"+data[counter]+" "+didascalia[counter];
- }
- }
- </script>
- <title>Slider</title>
- </head>
- <%
- int len=utente.getDimfoto(); %>
- <body onload="assegnaVettore(<%=len%>);counter=-1;avanti();">
- <jsp:useBean id="userBean" class="servlet.Infoutente" scope="session" />
- <jsp:setProperty property="*" name="userBean"/>
- <% userBean.setCodupload(utente.getCodupload()); %>
- <center>
- <div id="immagine"></div>
- <input type="button" value="indietro" onClick="indietro();">
- <input type="button" value="avanti" onClick="avanti();">
- <div id="msg"></div>
- </center>
- <!-- <div id="upload" align="center">
- <br><br><br> -->
- <form id="file_upload" action="Up" method="POST" enctype="multipart/form-data">
- <input type="text" name="uploadhi" value="<%=userBean.getCodupload()%>">
- <input id="file_1" type="file" name="file_1">
- <!--< div id="drop_zone_1">
- <input id="file_1" type="file" name="file_1">
- <div>Carica Foto</div>
- </div> -->
- <input type="submit" value="upload">
- <!-- <button>Upload</button>
- -->
- <table id="files_1" style="background:red;"></table>
- <!--
- <div id="progressbar" style="width: 500px; height: 30px;"></div>
- <div id="risultato"
- style="color: #FF3300; font-weight: bold; font-size: 15px;"></div>
- <iframe id="uploadIframe" name="uploadIframe" height="300" width="500"
- frameborder="0" scrolling="auto"></iframe> -->
- </form>
- <!-- </div> -->
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
- <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
- <script src="fileupload/jquery.fileupload.js"></script>
- <script src="fileupload/jquery.fileupload-ui.js"></script>
- <script>
- /*global $ */
- /* $(function () {
- var initFileUpload = function (suffix) {
- $('#file_upload').fileUploadUI({
- namespace: 'file_upload_' + suffix,
- fileInputFilter: '#file_' + suffix,
- dropZone: $('#drop_zone_' + suffix),
- uploadTable: $('#files_' + suffix),
- downloadTable: $('#files_' + suffix),
- buildUploadRow: function (files, index) {
- return $('<tr><td>' + files[index].name + '<\/td>' +
- '<td class="file_upload_progress"><div><\/div><\/td>' +
- '<td class="file_upload_cancel">' +
- '<button class="ui-state-default ui-corner-all" title="Cancel">' +
- '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
- '<\/button><\/td><\/tr>');
- },
- buildDownloadRow: function (file) {
- return $('<tr><td>' + file.name + '<\/td><\/tr>');
- }
- });
- };
- initFileUpload(1);
- }); */
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment