<!-- Carrello.jsp -->

<HTML>

<HEAD>
<TITLE>Vendita CD On-line</TITLE>
</HEAD>

<BODY bgcolor="#33CCCC" text="#000099" vlink="#990099" alink="#000099">

<!-istanziazione del bean Carrello.jsp, con ambito session -->
<jsp:useBean id="car" scope="session" class="Carrello" />

<%
String id = request.getParameter("id");
//se è stato aggiunto un CD al carrello
if (id != null){
//acquisisci i dati del CD
String artista=request.getParameter("artista");
String titolo=request.getParameter("titolo");
float prezzo = Float.parseFloat(request.getParameter("prezzo"));
//e aggiungilo al carrello
car.aggiungiCd (id, artista, titolo, prezzo);
}//if
%>

<font face="Verdana" size="6">
<center>
CATALOGO COMPACT DISC A DISPOSIZIONE <br><br>
</center>
</font>

<font face="Verdana">
<a href="visCarr.jsp"> Quantità attualmente nel carrello: </a>
<%= car.totCD();%> <br><br>
<center>
<table width="60%" border="1" align="center" bordercolorlight="#990099"
bordercolordark="#990099"> <tr>
<th>Artista</th>
<th>Titolo</th>
<th>Prezzo</th>
</tr>
<tr>
<form action="Carrello.jsp" method="post">
<td>Dream Theater</td>
<td>Awake</td>
<td>L.25000</td>
<td><center><input type="submit" name="add" name="acquista"
value="Aggiungi al carrello"></center></td>
<input type="hidden" name="id" value="1">
<input type="hidden" name="artista" value="Dream Theater">
<input type="hidden" name="titolo" value="Awake">
<input type="hidden" name="prezzo" value="25000">
</form>
<td>
</tr>
<tr>
<form action="Carrello.jsp" method="post">
<td>Iced Earth</td>
<td>The Dark Saga</td>
<td>L.35000</td>
<td><center><input type="submit" name="add" name="acquista"
value="Aggiungi al carrello"></center></td>
<input type="hidden" name="id" value="2">
<input type="hidden" name="artista" value="Iced Earth">
<input type="hidden" name="titolo" value="The Dark Saga">
<input type="hidden" name="prezzo" value="35000">
</form>
<td>
</tr>
<tr>
<form action="Carrello.jsp" method="post">
<td>Queen</td>
<td>Innuendo</td>
<td>L.35000</td>
<td><center><input type="submit" name="add" name="acquista"
value="Aggiungi al carrello"></center></td>
<input type="hidden" name="id" value="3">
<input type="hidden" name="artista" value="Queen">
<input type="hidden" name="titolo" value="Innuendo">
<input type="hidden" name="prezzo" value="35000">
</form>
<td>
</tr>
</table>
</font>
</center>
</BODY>
</HTML>