forked from kirannegi0149/Employee-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfirm delete.jsp
More file actions
120 lines (117 loc) · 3.37 KB
/
confirm delete.jsp
File metadata and controls
120 lines (117 loc) · 3.37 KB
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
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
}
table {
margin: 50px auto;
border-collapse: collapse;
width: 40%;
background: #c9cfd2;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: hidden;
}
th, td {
padding: 15px 20px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
color: black;
text-align: center;
font-size: 1.2em;
}
tr:hover {
background-color: #f1f1f1;
}
button {
background-color: #dc3545;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1em;
}
button:hover {
background-color: #c82333;
}
.dvv {
margin: 40px auto;
width: 70%;
text-align: center;
padding: 10px;
background: #dde3df;
border: 1px solid #f5c6cb;
color: #721c24;
font-size: 1.2em;
border-radius: 5px;
}
</style>
</head>
<body onload="makeActive('delete')">
<%
String eid = request.getParameter("eid");
Class.forName("com.mysql.cj.jdbc.Driver");
Connection cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/jsp10", "root", "mysqlkiran011");
PreparedStatement ps = cn.prepareStatement("select * from employeeinfo where eid=?");
ps.setString(1, eid);
ResultSet rst = ps.executeQuery();
if (rst.next()) {
%>
<%@ include file="navbar.jsp" %>
<form action="delete-record.jsp">
<table>
<tr>
<th colspan="2" style="color:white; background-color:#565a62; font-size:20px;">Employee Details</th>
</tr>
<tr>
<th>Employee Id</th>
<td><%=eid%><input type="hidden" name="eid" value="<%=eid%>"></td>
</tr>
<tr>
<th>First Name</th>
<td><%=rst.getString(2)%></td>
</tr>
<tr>
<th>Last Name</th>
<td><%=rst.getString(3)%></td>
</tr>
<tr>
<th>Phone Number</th>
<td><%=rst.getString(4)%></td>
</tr>
<tr>
<th>Department</th>
<td><%=rst.getString(5)%></td>
</tr>
<tr>
<th>Email id</th>
<td><%=rst.getString(6)%></td>
</tr>
<tr>
<th>Salary</th>
<td>₹<%=rst.getString(7)%></td>
</tr>
<tr>
<td colspan="2" align="left">
<button type="submit">Confirm Delete</button>
</td>
</tr>
</table>
</form>
<%
} else {
%>
<jsp:include page="delete.jsp" />
<div class="dvv">
<label>Employee record with id <%=eid%> does not exist</label>
</div>
<%
}
%>
</body>
</html>