-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aggiunta converti crediti + correzione bugs
- Loading branch information
Ignazio
authored and
Ignazio
committed
Jun 29, 2014
1 parent
a9e3cea
commit f39682c
Showing
7 changed files
with
239 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/webapp/WEB-INF/views/convertiCrediti.jsp=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> | ||
|
||
<div id="converti-crediti-container"> | ||
<div class="buono-spesa-list"> | ||
<div id="buono01" class="buono-spesa-item"> | ||
<div class="buono-spesa-img-box"> | ||
<img src="http://targetexecutivesearch.com/sites/default/files/images/client_logo/carrefour.jpg?1327058179"> | ||
</div> | ||
<div class="buono-spesa-post-box"> | ||
<div class="buono-spesa-post-titolo">BUONO SCONTO 5 €</div> | ||
<div class="buono-spesa-post-descrizione"> | ||
Il buono è valido per i prodotti della categoria Alimentari e Prima infanzia. | ||
<br><br> | ||
Validitá 15 giorni dall'emissione. | ||
</div> | ||
<div class="buono-spesa-post-costo"> Crediti necessari al riscatto: 50</div> | ||
<div class="addNewItemBtn genericBtn">Richiedi</div> | ||
</div> | ||
</div> | ||
<div id="buono02" class="buono-spesa-item"> | ||
<div class="buono-spesa-img-box"> | ||
<img src="http://www.butac.it/wp-content/uploads/2014/04/coop.jpg"> | ||
</div> | ||
<div class="buono-spesa-post-box"> | ||
<div class="buono-spesa-post-titolo">BUONO SCONTO 10 €</div> | ||
<div class="buono-spesa-post-descrizione"> | ||
Il buono è valido per i prodotti della categoria Tecnologia. | ||
<br><br> | ||
Validitá 10 giorni dall'emissione. | ||
</div> | ||
<div class="buono-spesa-post-costo"> Crediti necessari al riscatto: 80</div> | ||
<div class="addNewItemBtn genericBtn">Richiedi</div> | ||
</div> | ||
</div> | ||
<div id="buono03" class="buono-spesa-item"> | ||
<div class="buono-spesa-img-box"> | ||
<img src="http://www.tiendeo.it/galeria/negocio/4021/auchan.jpg"> | ||
</div> | ||
<div class="buono-spesa-post-box"> | ||
<div class="buono-spesa-post-titolo">BUONO SCONTO 5%</div> | ||
<div class="buono-spesa-post-descrizione"> | ||
Il buono è valido per tutti i prodotti. | ||
<br><br> | ||
Validitá 7 giorni dall'emissione. | ||
</div> | ||
<div class="buono-spesa-post-costo"> Crediti necessari al riscatto: 100</div> | ||
<div class="addNewItemBtn genericBtn">Richiedi</div> | ||
</div> | ||
</div> | ||
<div id="buono04" class="buono-spesa-item"> | ||
<div class="buono-spesa-img-box"> | ||
<img src="http://www.ligurianotizie.it/wp-content/uploads/2013/11/esselunga-logo-300x203.jpg"> | ||
</div> | ||
<div class="buono-spesa-post-box"> | ||
<div class="buono-spesa-post-titolo">BUONO SCONTO 50 €</div> | ||
<div class="buono-spesa-post-descrizione"> | ||
Il buono è valido per tutti i prodotti dei punti vendita Ipermercato. | ||
<br><br> | ||
Validitá 20 giorni dall'emissione. | ||
</div> | ||
<div class="buono-spesa-post-costo"> Crediti necessari al riscatto: 500</div> | ||
<div class="addNewItemBtn genericBtn">Richiedi</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script type="text/javascript"> | ||
function richiediBuono() { | ||
var creditiDisponibili = $("#logoutForm > div > p:last-child").text().split(":")[1].substring(1); | ||
var costo = $(this).parent().find(".buono-spesa-post-costo").text().split(":")[1].substring(1); | ||
|
||
if(Number(creditiDisponibili) < Number(costo)) { | ||
alert("Crediti insufficienti"); | ||
return; | ||
} | ||
|
||
$.ajax({ | ||
url:"./richiediBuono", | ||
type: 'POST', | ||
async: true, | ||
dataType: "html", | ||
data: { | ||
"id_buono" : $(this).parent().parent().attr("id"), | ||
"valore_sconto" : $(this).parent().find(".buono-spesa-post-titolo").text(), | ||
"descrizione" : $(this).parent().find(".buono-spesa-post-descrizione").text(), | ||
"costo" : costo | ||
}, | ||
success: function(returnedData) { | ||
console.log(returnedData); | ||
//$("#"+returnedData).fadeOut(); | ||
} | ||
}); | ||
|
||
var creditiResidui = Number(creditiDisponibili) - Number(costo); | ||
|
||
$("#logoutForm > div > p:last-child").text("Crediti Acquisiti: "+creditiResidui); | ||
|
||
//$("#"+$(this).parent().parent().attr("id")).fadeOut(); | ||
}; | ||
|
||
jQuery(document).ready(function($){ | ||
$(".buono-spesa-item >.buono-spesa-post-box >.addNewItemBtn").click(richiediBuono); | ||
}); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,21 @@ | ||
<%@page import="hibernate.Inserzione"%> | ||
<%@page import="hibernate.Profilo"%> | ||
<%@page import="hibernate.Utente"%> | ||
<%@page import="hibernate.Argomenti"%> | ||
<%@page import="hibernate.ArgomentiInserzione"%> | ||
<%@page import="org.springframework.web.servlet.support.RequestContextUtils"%> | ||
<%@page import="org.springframework.context.ApplicationContext"%> | ||
<%@page import="dati.Dati" %> | ||
<%@page import="java.util.Map" %> | ||
<%@page import="java.util.Set" %> | ||
<%@page contentType="text/html" pageEncoding="UTF-8"%> | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
"http://www.w3.org/TR/html4/loose.dtd"> | ||
|
||
<html> | ||
<head> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Home</title> | ||
<% | ||
Dati dati = (Dati)request.getAttribute("dati"); | ||
%> | ||
</head> | ||
<body> | ||
<% String error = (String) request.getAttribute("error"); | ||
if(null != error ) {%> | ||
<div id="hibernate.error" class="errors"><%= error %></div> | ||
<%} %> | ||
<div id="utenti"> | ||
<h1>Hello World!</h1> | ||
<p>This is the homepage!</p> | ||
<% for(Map.Entry<Integer,Inserzione> u : dati.getInserzioni().entrySet()){ %> | ||
<%= u.getValue().getDescrizione() %><br> | ||
<%= u.getValue().getProdotto().getDescrizione()%><br> | ||
<%= u.getValue().getPrezzo() %><br> | ||
<%= u.getValue().getSupermercato().getNome()%><br> | ||
<% | ||
for(ArgomentiInserzione ai : (Set<ArgomentiInserzione>)u.getValue().getArgomentiInserziones()){ | ||
%> | ||
<tr> | ||
<td>Argomento Inserzione</td> | ||
<td><%=ai.getArgomenti().getArgomento()+" = "+ai.getArgVal() %></td> | ||
</tr> | ||
<% } %> | ||
<br> | ||
<%} %> | ||
|
||
<button value="register" name="register" onclick=" | ||
path=window.location.pathname; | ||
path=path+'/register'; | ||
$.get( path, function( data ) { | ||
$( '#render' ).html( data ); | ||
});"></button> | ||
</div> | ||
<div id="render"> | ||
</div> | ||
|
||
</body> | ||
</html> | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> | ||
|
||
<div id="home" class="homeContainer" style="height: 902px;"> | ||
<h2>Benvenuto su CLEVER BUY!</h2> | ||
<div> | ||
Trova le offerte migliori e segnala i prodotti più convenienti. | ||
Potrai guadagnare tanti crediti e risparmiare ancora di più. | ||
<br><br> | ||
|
||
Clever Buy è pensata per gli amanti dello shopping e del risparmio. | ||
Potrai creare le tue liste dei desideri, durante la compilazione il sistema ti suggerirà i prodotti disponibili intorno a te al prezzo migliore. | ||
<br><br> | ||
|
||
Consulta le tue liste usando la nostra applicazione Android, è semplice, utile e GRATUITA. | ||
<br><br> | ||
|
||
Inserisci le tue inserzioni o valuta quelle che ti sono state utili, puoi guadagnare tanti crediti e ricevere buoni sconto o effettuare l'upgrade del tuo account. | ||
La versione PREMIUM offre funzionalità di ricerca avanzate, statistiche sui prodotti e tanto altro ancora... | ||
</div> | ||
<h2>ISCRIVITI SUBITO... è GRATIS!</h2> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.