-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_View_Recommendation.jsp
270 lines (247 loc) · 10.1 KB
/
admin_View_Recommendation.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>All Recommendations</title>
<%@ include file="connect.jsp" %>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="com.oreilly.servlet.*"%>
<%@ page import ="java.text.SimpleDateFormat" %>
<%@ page import ="javax.crypto.Cipher" %>
<%@ page import ="org.bouncycastle.util.encoders.Base64" %>
<%@ page import ="javax.crypto.spec.SecretKeySpec" %>
<%@ page import ="java.security.KeyPairGenerator,java.security.KeyPair,java.security.Key" %>
<%@ page import ="java.security.MessageDigest,java.security.DigestInputStream" %>
<%@ page import ="java.math.BigInteger" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/coin-slider.css" />
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/droid_sans_400-droid_sans_700.font.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/coin-slider.min.js"></script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style20 {color: #5286bc}
.style21 {font-size: 16px}
.style22 {color: #FFFF00}
.style23 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div class="main">
<div class="header">
<div class="header_resize">
<div class="menu_nav">
<ul>
<li><a href="index.html"><span>Home </span></a></li>
<li class="active"><a href="admin_Login.jsp"><span>Admin</span></a></li>
<li><a href="user_Login.jsp"><span>User</span></a></li>
<li></li>
</ul>
</div>
<div class="logo">
<h2><span class="style1">Clustering Based Collaborative Filtering Using an Incentivized Penalized User Model<small></small></span></h2>
</div>
<div class="clr"></div>
<div class="slider">
<div id="coin-slider"> <a href="#"><img src="images/slide1.jpg" width="960" height="294" alt="" /> </a> <a href="#"><img src="images/slide2.jpg" width="960" height="294" alt="" /> </a> <a href="#"><img src="images/slide3.jpg" width="960" height="294" alt="" /> </a> </div>
<div class="clr"></div>
</div>
<div class="clr"></div>
</div>
</div>
<div class="content">
<div class="content_resize">
<div class="mainbar">
<div class="article">
<h2><span class="style23">All Users Recommendations Post</span> <span class="style20"><%=request.getParameter("name")%></span></span></h2>
<div class="clr"></div>
<p> </p>
<p>
<%
try{
String s1="",s2="",s3="",s4="",s5="",s6="",s7="";
int i=0,j=0;
String name = request.getParameter("name");
String str3 = "select * from posts where post_name='"+name+"' ";
Statement st3=connection.createStatement();
ResultSet rs3 = st3.executeQuery(str3);
if(rs3.next())
{
i=rs3.getInt(1);
s2=rs3.getString(2);
s3=rs3.getString(3);
s4=rs3.getString(4);
s5=rs3.getString(5);
s6=rs3.getString(6);
j=rs3.getInt(8);
String keys1 = "ef50a0ef2c3e3a5f";
KeyPairGenerator kg1 = KeyPairGenerator.getInstance("RSA");
Cipher encoder1 = Cipher.getInstance("RSA");
KeyPair kp1 = kg1.generateKeyPair();
Key pubKey1 = kp1.getPublic();
byte[] pub1 = pubKey1.getEncoded();
String decrypted_Desc = new String(Base64.decode(s5.getBytes()));
String decrypted_Uses = new String(Base64.decode(s6.getBytes()));
%>
</p>
<table width="623" border="1" cellpadding="0" cellspacing="0" >
<tr>
<td width="227" rowspan="8" >
<div style="margin:10px 13px 10px 13px;" ><div align="center" class="style8">
<input name="image2" type="image" src="post_Pic.jsp?id=<%=i%>" style="width:200px; height:200px;" />
</div></div> </td>
</tr>
<tr>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left " class="style22 style21" style="margin-left:20px;"><strong>User Domain</strong></div></td>
<td><span class="style21"> <%=s2%></span></td>
</tr>
<tr>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong>Post Name </strong></div></td>
<td width="202"><span class="style21"> <%=s3%></span></td>
</tr>
<tr>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong>Color </strong></div></td>
<td><span class="style21"> <%=s4%></span></td>
</tr>
<tr>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong>Discription</strong></div></td>
<td><span class="style21"> <%=decrypted_Desc%></span></td>
</tr>
<tr>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong>Uses</strong></div></td>
<td><span class="style21"> <%=decrypted_Uses%></span></td>
</tr>
<tr>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left " class="style22 style21" style="margin-left:20px;"><strong>Rank</strong></div></td>
<td><span class="style21"> <%=j%></span></td>
</tr>
<tr>
<td width="186" height="62" align="left" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style21 style22" style="margin-left:20px;"><strong>Rating</strong></div ></td>
<td><span class="style8 style21"> <%
if(j<=3)
{
%>
<input name="image" type="image" src="Gallery/1.png" width="140" height="30" >
<%
}
if(j>3 && j<=6)
{
%>
<input name="image" type="image" src="Gallery/2.png" width="80" height="30" >
<%
}
if(j>6 && j<=9)
{
%>
<input name="image" type="image" src="Gallery/3.png" width="100" height="30" >
<%
}
if(j>9 && j<=12)
{
%>
<input name="image" type="image" src="Gallery/4.png" width="120" height="30" >
<%
}
if(j>12 && j<=15)
{
%>
<input name="image" type="image" src="Gallery/5.png" width="140" height="30" >
<%
}
if(j>15 && j<=300)
{
%>
<input name="image" type="image" src="Gallery/6.png" width="170" height="30" >
<%
}
%>
</span></td>
</tr>
<%
String str4 = "select * from recommendations where post_name='"+name+"' ";
Statement st4 = connection.createStatement();
ResultSet rs4 = st4.executeQuery(str4);
int countt=1;
while(rs4.next())
{
String by = rs4.getString(4);
String review = rs4.getString(5);
String date = rs4.getString(6);
if(countt==1)
{
countt=countt+1;
%>
<tr>
<td width="227" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong>Recommended _from </strong></div></td>
<td width="186" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong><span class="style21" style="margin-left:20px;">Recommended</span>_To</strong></div></td>
<td width="202" height="30" valign="middle" bgcolor="#FF0000" style="color: #2c83b0;"><div align="left" class="style22 style21" style="margin-left:20px;"><strong>Details</strong></div></td>
</tr>
<%
}
%>
<tr>
<td width="227" height="40"><span class="style21"> <%=by%></span></td>
<td width="186"><span class="style21"> <%=review%></span></td>
<td width="202"><span class="style21"> <%=date%></span></td>
</tr>
<%
}
%>
<tr>
<td width="227" height="30"><span class="style21"></span></td>
<td width="186"><span class="style21"></td>
<td width="202"><span class="style21"></td>
</tr>
<%
out.println("");
}
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
</table>
<p> </p>
<p align="right"><a href="admin_All_Recommended_Posts.jsp">Back</a></p>
<div class="clr"></div>
</div>
<div class="article">
<div class="clr"></div>
<div class="clr"></div>
</div>
</div>
<div class="sidebar">
<div class="searchform">
</div>
<div class="clr"></div>
<div class="gadget">
<h2 class="star"><span>Admin</span> Menu</h2>
<div class="clr"></div>
<ul class="sb_menu">
<li><a href="admin_Main.jsp"><span>Admin Main </span></a></li>
<li><a href="admin_Login.jsp"><span>Log Out</span></a></li>
</ul>
</div>
</div>
<div class="clr"></div>
</div>
</div>
<div class="fbg"></div>
<div class="footer">
<div class="footer_resize">
<div style="clear:both;"></div>
</div>
</div>
</div>
</body>
</html>