-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurequests.jsp
99 lines (94 loc) · 3.11 KB
/
urequests.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
<%@ page import="java.sql.*" %>
<%@ page import="java.text.DateFormat" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%! Connection con; Statement st; ResultSet rs;
%>
<% try
{ Class.forName("oracle.jdbc.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe","username","password");
st=con.createStatement();
rs=st.executeQuery("select email,service,fname,phno,place,street,area,city,pin,rdate from requests order by rdate");
%>
<html>
<head>
<title>Service_requests</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet"
/>
<style>
body{
font-family: "Nunito", sans-serif;
background-image: url("images/bg.jpg");
background-size: 1250px 750px;
}
.main{
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 2fr 1fr;
border: 0px solid black;
}
.toph{
font-size: 2.5em;
text-align: center;
padding:25px;
}
.top{
border-bottom: 2px solid black;
padding: 10px;
background-color: rgb(0, 175, 85);
}
.items{
border-bottom: 1px solid black;
padding: 10px;
}
</style>
</head>
<body>
<div class="toph">
Service requests
</div>
<div class="main">
<div class="top">Email</div>
<div class="top">Service</div>
<div class="top">Name</div>
<div class="top">Mobile</div>
<div class="top">Address</div>
<div class="top">Date</div>
<%
while(rs.next())
{
String email=rs.getString(1);
String service=rs.getString(2);
String name=rs.getString(3);
String mobile=String.valueOf(rs.getLong(4));
String place=rs.getString(5);
String street=rs.getString(6);
String area=rs.getString(7);
String city=rs.getString(8);
String pin=String.valueOf(rs.getInt(9));
Date date=rs.getDate(10);
DateFormat dateFormat = new SimpleDateFormat("dd-"+"MM-"+"yy");
String strDate = dateFormat.format(date);
%>
<div class="items"><%=email%></div>
<div class="items"><%=service%></div>
<div class="items"><%=name%></div>
<div class="items"><%=mobile%></div>
<div class="items"><%=place+","+street+","+area+","+city+"-"+pin%></div>
<div class="items"><%=strDate%></div>
<%
}
%>
</div>
</body>
</html>
<%
}
catch(Exception e)
{
out.println(e.toString());
}
%>