-
Notifications
You must be signed in to change notification settings - Fork 0
/
showproductscustomer.jsp
212 lines (167 loc) · 6.81 KB
/
showproductscustomer.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
<%@page import="com.nttdatatraining.dao.ProductDAO"%>
<%@page import="com.nttdatatraining.dto.Product"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
String cid = (String) session.getAttribute("USERID");
if( cid == null )
{
response.sendRedirect("home11.jsp");
}
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet"type="text/css"href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css"/>
<title>Show Products Customer</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
/* The Modal (background) */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0, 0, 0); /* Fallback color */
background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 30%;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover, .close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="site-blocks-cover inner-page" style="background-image: url('https://wallpaperbat.com/img/417900-pharmacist-wallpaper.jpg');">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<a class="navbar-brand" href="#">Logo</a> -->
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="customercon11.jsp">Home</a></li>
</ul>
<!--<li><a href="login.html"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>--->
</div>
</div>
</nav>
<div class="container">
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm6">
<h2> Products For You</h2><br>
</div>
</div>
</div>
<table class="table table-striped table-hover table-bordered" id="table_id">
<thead>
<tr>
<th>Product ID</th>
<th>Product Name</th>
<th>Category ID</th>
<th>Price</th>
<th>Quantity</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<%
ProductDAO dao = new ProductDAO();
List<Product> lst = dao.getAllProductsForCustomer();
if(lst.size() > 0)
{
for (Product qs : lst) {
%>
<tr>
<td><%=qs.getProductid()%></td>
<td><%=qs.getProductname()%></td>
<td><%=qs.getCategoryid()%></td>
<td><%=qs.getPrice()%></td>
<td><%=qs.getQuantity()%></td>
<td> <%=qs.getDescription()%></td>
<td>
<form action="NewFile.jsp" method="post">
<input type="hidden" name="ProductId" value="<%=qs.getProductid()%>"/>
<input class = "btn btn-danger" type="submit" value="Place order"/>
</form>
</td>
</tr>
<%}}%>
</tbody>
</table>
<script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js"></script>
<script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<script> $(function() {
$("#table_id").dataTable();
});
</script>
</div>
</div>
<br><br>
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-md-6 col-lg-3 mb-4 mb-lg-0">
<div class="block-7">
<h3 class="footer-heading mb-4">About Us</h3>
<p>We are the best pharmacy store available online.</p>
</div>
</div>
<div class="col-lg-3 mx-auto mb-5 mb-lg-0">
<h3 class="footer-heading mb-4">Why Us?</h3>
<p>Rated best by the great experts around the corner and whole globe.</p>
</div>
<div class="col-md-6 col-lg-3">
<div class="block-5 mb-5">
<h3 class="footer-heading mb-4">Contact Info</h3>
<ul class="list-unstyled">
<li class="address">222, Kengeri, Bangalore, Karnataka</li>
<li class="phone"><a href="tel://23923929210">+2 392 3929 210</a></li>
<li class="email">[email protected]</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</footer>
</div>
</body>
</html>