-
Notifications
You must be signed in to change notification settings - Fork 0
/
13.jsp
150 lines (145 loc) · 3.35 KB
/
13.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
<%
response.setHeader("Cache-Control","no-cache,no-store,must-revalidate");
response.setHeader("Pragma","no-cache");
response.setHeader("Expires","0");
%>
<!DOCTYPE html>
<html>
<head>
<title>
Home
</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<style >
body {
background: white;
text-align: center;
}
.content {
position: fixed;
margin-left: 600px;
margin-top: 250px;
text-align: center;
}
.cont2 {
position: fixed;
margin-left: 560px;
margin-top: 350px;
text-align: center;
}
.cont3 {
position: fixed;
margin-left: 610px;
margin-top: 450px;
text-align: center;
}
.opt{
position: fixed;
top: 0;
left: 0;
right: 0;
padding-top: 40px;
padding-bottom: 20px;
}
</style>
<body style="background: white" >
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%
if(session.getAttribute("userid")==null)
{
response.sendRedirect("2.jsp");
}
%>
<div class="opt" style="background: black">
<table>
<tr>
<td>
<button type="submit" style=" font-size: 16px; cursor: pointer; margin-left: 60px;" onclick="location.href='1.jsp'">
<i class="fa fa-home"></i>
<span>Home</span>
</button>
</td>
<td>
<button type="submit" style=" font-size: 16px; cursor: pointer; margin-left: 1100px;">
<a href="2.jsp" style="text-decoration-line: none">
<i class="fa fa-sign-out"></i>
<span>
<%
String x = (String)session.getAttribute("userid");
if(x!=null)
{
%>
logout
<%
}
%>
</span>
</a>
</button>
</td>
</tr>
</table>
</div>
<div class="content">
<table>
<tr>
<td>
<button type="submit" style=" font-size: 28px; cursor: pointer; background: skyblue;" onclick="location.href='8.jsp'" >
<i class="fa fa-home"></i>
<span>Checkout Home</span>
</button>
</td>
</tr>
</table>
</div>
<div class="cont2">
<table>
<tr>
<td>
<button type="submit" style=" font-size: 28px; cursor: pointer; background: skyblue" onclick="location.href='4.jsp'" >
<i class="fa fa-refresh"></i>
<span> Update Requirements </span>
</button>
</td>
</tr>
</table>
</div>
<div class="cont3">
<table>
<tr>
<td>
<button type="submit" style=" font-size: 28px; cursor: pointer; background: skyblue;" onclick="location.href='7.jsp'" >
<i class="fa fa-user-secret"></i>
<span>Contact Agent</span>
</button>
</td>
</tr>
</table>
</div>
</div>
<%
Connection connect = null;
Statement statement = null;
ResultSet resultSet = null;
PreparedStatement ps = null;
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.getConnection("jdbc:mysql://localhost:3306/lab10project?user=root&password=16104653&useSSL=false");
String q = "Select * from buyer where id = ?";
ps = connect.prepareStatement(q);
String idx=(String)session.getAttribute("userid");
int abcde=0;
if(idx !=null && !"".equals(idx)) {
abcde= Integer.parseInt(idx);
}
ps.setInt(1, abcde);
resultSet = ps.executeQuery();
String area = "";
while (resultSet.next()) {
area = resultSet.getString("area");
}
session.setAttribute("areagb",area);
%>
</body>
</html>