-
Notifications
You must be signed in to change notification settings - Fork 0
/
book.jspx
135 lines (120 loc) · 4.5 KB
/
book.jspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsp/jstl/fmt" version="2.0">
<jsp:directive.page contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" session="false" />
<jsp:output doctype-root-element="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
omit-xml-declaration="true" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${bookTitle }</title>
<link rel="stylesheet" href="res/main.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="res/starRating.css" type="text/css" charset="utf-8" />
<SCRIPT type="text/javascript">
reviewTextCheck = function(){
if(document.getElementById("reviewText").value == "." || document.getElementById("reviewText").value == ""){
alert("Please Fill the Review Box");
}
}
</SCRIPT>
<script type="text/javascript" src="res/Ajax.js"><jsp:text /></script>
<script type="text/javascript" src="res/submitReview.js"><jsp:text /></script>
</head>
<body>
<form action="Start" method="POST">
<div id="banner">
<a href="home.jspx"> <img src="images/Banner.jpg" alt="Banner"
width="250" height="100"></img>
</a> <span id="banner2"> <img id="banner2"
src="images/Banner2.jpg" alt="Banner" width="400" height="100"></img>
</span>
</div>
<ul>
<li><a href="/Project/">Home</a></li>
<c:choose>
<c:when test="${isLogedIn == 'true'}">
<li><a href="logout.jspx">Log Out</a></li>
</c:when>
<c:otherwise>
<li><a href="login.jspx">Log In</a></li>
</c:otherwise>
</c:choose>
<li>
<div class="dropdown">
<button class="dropbtn">Category</button>
<div class="dropdown-content">
<a href="scienceBooks.jspx">Science</a> <a
href="fictionBooks.jspx">Fiction</a> <a
href="engineeringBooks.jspx">Engineering</a>
</div>
</div>
</li>
<li id="searchbar" style="float: right"><input type="text"
id="search" placeholder="Search" name="searchValue" /> <input
type="submit" id="searchbutton" value="Search" name="searchSubmit" /></li>
<li style="float: right"><button id="cartsubmit"
name="cartsubmit" value="0">
<img src="images/cart.png" class="thumbnail" height="40" width="50" />
</button></li>
</ul>
</form>
<H2>${bookTitle}</H2>
<BR />
<BR />
<img src="images/${bookID}.jpg" alt="Book" height="400" width="300"></img>
<span>
<br/>
<span id="price">List price: CDN $${bookPrice}0</span>
<br/>
<BR />
<span id="rating">Rating: ${bookStars} out of 5</span>
<br/>
<BR />
<button id="addToCart" name="addToCart" value="${bookID}" type="submit" onclick="doAjax('/Project/Start', '${bookID}');return false;">Add To Cart</button>
<br/>
</span>
<TABLE>
<c:forEach var="review" items="${reviewList}">
<tr>
<td>${review.review}</td>
</tr>
</c:forEach>
</TABLE>
<form action="Start" method="POST">
Rating:<BR />
<input type="radio" name="stars" value="1"> 1 </input>
<input type="radio" name="stars" value="2"> 2 </input>
<input type="radio" name="stars" value="3"> 3 </input>
<input type="radio" name="stars" value="4"> 4 </input>
<input type="radio" name="stars" value="5"> 5 </input>
<BR />
<BR />
<BR />
<c:if test="${isLogedIn == 'ture'}">
<Label for="reviewText"> Review:</Label>
<TEXTAREA autofocus="true" name="textArea" required="true" placeholder="Enter Text here" rows="5" cols="50" id="reviewText"><jsp:text /></TEXTAREA>
<br/>
<button type="submit" name="submitReview" value="${bookID}" onclick="doAjax('/Project/Start', '${bookID}');return false;">submit review</button>
</c:if>
</form>
<LABEL>rating is: ${bookStars} /5</LABEL>
<c:if test="${isLogedIn == 'true'}">
<form action="Start" method="POST">
Rating:<BR /> <input type="radio" name="stars" value="1"> 1</input>
<input type="radio" name="stars" value="2"> 2 </input> <input
type="radio" name="stars" value="3"> 3 </input> <input type="radio"
name="stars" value="4"> 4 </input> <input type="radio" name="stars"
value="5"> 5 </input> <BR />
<TEXTAREA autofocus="true" name="textArea" required="true"
placeholder="Enter Text here" rows="5" cols="50" id="reviewText"><jsp:text /></TEXTAREA>
<button type="submit" name="submitReview" value="${bookID}">submit
review</button>
</form>
</c:if>
</body>
</html>
</jsp:root>