-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.jsp
292 lines (271 loc) · 10.8 KB
/
checkout.jsp
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!--
author: W3layouts
author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<%@page import="databaseconnection.DatabaseConnection"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.io.PrintWriter"%>
<!DOCTYPE html>
<html>
<head>
<title>Super Market an E-commerce Online Shopping and Market Forecasting and Fake product review system</title>
<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Super Market Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //for-mobile-apps -->
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- font-awesome icons -->
<link href="css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome icons -->
<!-- js -->
<script src="js/jquery-1.11.1.min.js"></script>
<!-- //js -->
<link href='//fonts.googleapis.com/css?family=Raleway:400,100,100italic,200,200italic,300,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
<!-- start-smoth-scrolling -->
<script type="text/javascript" src="js/move-top.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
});
});
</script>
<!-- start-smoth-scrolling -->
</head>
<body>
<!-- header -->
<jsp:include page="Aheader.jsp"/>
<!-- //header -->
<!-- navigation -->
<!-- //navigation -->
<!-- breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<ol class="breadcrumb breadcrumb1">
<li><a href="index.jsp"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>Home</a></li>
<li class="active">Checkout Page</li>
</ol>
</div>
</div>
<!-- //breadcrumbs -->
<!-- checkout -->
<div class="checkout">
<div class="container">
<h2>Your shopping cart contains: <span> Products</span></h2>
<div class="checkout-left">
<div class="checkout-right-basket">
<a href="Products.jsp"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Continue Shopping</a>
</div>
<div class="clearfix"> </div>
</div>
<br></br>
<div class="checkout-right">
<table class="timetable_sub">
<thead>
<tr>
<th>Product</th>
<th>Quantity</th>
<th>Product Name</th>
<th>Price</th>
<th>Remove</th>
</tr>
</thead>
<%
try{
int total=0;
String username=(String) session.getAttribute("username");
DatabaseConnection db1 = new DatabaseConnection();
db1.dbconnection();
String query1 ="select * from addcart where UserName='"+username+"'";
ResultSet rs1 = (ResultSet) db1.getResultSet(query1);
while(rs1.next())
{
String id = rs1.getString("id");
String pname = rs1.getString("ProductName");
//String str = pname.substring(0, 10)+"...";
String image1 = rs1.getString("pimage");
String pprice = rs1.getString("ProductPrice");
int getprice=Integer.parseInt(pprice);
total=total+getprice;
//String pstock = rs.getString("pstock");
String quantity = rs1.getString("quantity");
//int stock = Integer.parseInt(pstock);
%>
<tr class="rem1">
<td class="invert-image"><a href="ProductReview.jsp"><img src="Admin/Product/<%=image1%>" alt=" " class="img-responsive" /></a></td>
<td class="invert">
<div class="quantity">
<div class="quantity-select">
<div class="entry value-minus"> </div>
<div class="entry value"><span>1</span></div>
<div class="entry value-plus active"> </div>
</div>
</div>
</td>
<td class="invert"><%=pname%></td>
<td class="invert"><%=pprice%></td>
<td class="invert">
<div class="rem">
<form action="RemoveCart" method="post">
<input type="hidden" name="productid" value="<%=id%>">
<input style="height: 28px; width: 28px; background-color: #fe9126;" type="submit" value="X">
</form>
</div>
</td>
</tr>
<%
}
%>
<!--quantity-->
<script>
$('.value-plus').on('click', function(){
var divUpd = $(this).parent().find('.value'), newVal = parseInt(divUpd.text(), 10)+1;
divUpd.text(newVal);
});
$('.value-minus').on('click', function(){
var divUpd = $(this).parent().find('.value'), newVal = parseInt(divUpd.text(), 10)-1;
if(newVal>=1) divUpd.text(newVal);
});
</script>
<!--quantity-->
</table>
<br></br>
<div class="checkout-left-basket">
<h4>YOUR TOTAL AMOUNT: <%=total%></h4>
</div>
</div>
<div class="checkout-left">
<div class="checkout-right-basket">
<a href="transaction.jsp?total=<%=total%>"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Check Out</a>
</div>
<div class="clearfix"> </div>
</div>
<%
}
catch(Exception e)
{
e.printStackTrace();
}
%>
</div>
</div>
<!-- //checkout -->
<!-- //footer -->
<div class="footer">
<div class="container">
<div class="w3_footer_grids">
<div class="col-md-3 w3_footer_grid">
<h3>Contact</h3>
<ul class="address">
<li><i class="glyphicon glyphicon-map-marker" aria-hidden="true"></i>1234k Avenue, 4th block, <span>New York City.</span></li>
<li><i class="glyphicon glyphicon-envelope" aria-hidden="true"></i><a href="mailto:[email protected]">[email protected]</a></li>
<li><i class="glyphicon glyphicon-earphone" aria-hidden="true"></i>+1234 567 567</li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Information</h3>
<ul class="info">
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="about.jsp">About Us</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="contact.jsp">Contact Us</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="short-codes.jsp">Short Codes</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="faq.jsp">FAQ's</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="products.jsp">Special Products</a></li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Category</h3>
<ul class="info">
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="groceries.jsp">Groceries</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="household.jsp">Household</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="personalcare.jsp">Personal Care</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="packagedfoods.jsp">Packaged Foods</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="beverages.jsp">Beverages</a></li>
</ul>
</div>
<div class="col-md-3 w3_footer_grid">
<h3>Profile</h3>
<ul class="info">
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="products.jsp">Store</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="checkout.jsp">My Cart</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="login.jsp">Login</a></li>
<li><i class="fa fa-arrow-right" aria-hidden="true"></i><a href="registered.jsp">Create Account</a></li>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="footer-copy">
<div class="container">
<p>© 2017 Super Market. All rights reserved | Design by <a href="http://w3layouts.com/">W3layouts</a></p>
</div>
</div>
</div>
<div class="footer-botm">
<div class="container">
<div class="w3layouts-foot">
<ul>
<li><a href="#" class="w3_agile_facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" class="agile_twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" class="w3_agile_dribble"><i class="fa fa-dribbble" aria-hidden="true"></i></a></li>
<li><a href="#" class="w3_agile_vimeo"><i class="fa fa-vimeo" aria-hidden="true"></i></a></li>
</ul>
</div>
<div class="payment-w3ls">
<img src="images/card.png" alt=" " class="img-responsive">
</div>
<div class="clearfix"> </div>
</div>
</div>
<!-- //footer -->
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- top-header and slider -->
<!-- here stars scrolling icon -->
<script type="text/javascript">
$(document).ready(function() {
/*
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
*/
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<!-- //here ends scrolling icon -->
<script src="js/minicart.min.js"></script>
<script>
// Mini Cart
paypal.minicart.render({
action: '#'
});
if (~window.location.search.indexOf('reset=true')) {
paypal.minicart.reset();
}
</script>
<!-- main slider-banner -->
<script src="js/skdslider.min.js"></script>
<link href="css/skdslider.css" rel="stylesheet">
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#demo1').skdslider({'delay':5000, 'animationSpeed': 2000,'showNextPrev':true,'showPlayButton':true,'autoSlide':true,'animationType':'fading'});
jQuery('#responsive').change(function(){
$('#responsive_wrapper').width(jQuery(this).val());
});
});
</script>
<!-- //main slider-banner -->
</body>
</html>