-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_user_edit.jsp
90 lines (79 loc) · 2.94 KB
/
admin_user_edit.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
<%@page import="db.tables.User_Details"%>
<%@page import="util.Variables"%>
<%@page import="java.util.ArrayList"%>
<%@page import="db.DBProcess"%>
<!DOCTYPE html>
<%
Object obj= session.getAttribute("al");
if(obj==null)response.sendRedirect("admin_login.jsp");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Edit User </title>
</head>
<!--
//7. user_details - id,name,gender,dob,email,contact,dt
//8. user_login - id,uname,passwd,status
-->
<body>
<center>
<h1 ><font color="#366092"><%=Variables.prjName%></font></h1>
<%@include file="admin_menu.jsp" %>
<h2 ><font color="#366092">Edit User</font></h2>
<%
int id = Integer.parseInt(request.getParameter("id") + "");
DBProcess dbp = new DBProcess();
dbp.open();
User_Details ud = dbp.select_user_details(id);
dbp.close();
%>
<form name="frm" action="admin_user_edit_action.jsp" method="post">
<table>
<tr>
<td> ID </td>
<td> <input type="hidden" name="id" value="<%=ud.id%>"><%=ud.id%> </td>
</tr>
<tr>
<td> Name </td>
<td> <input type="text" name="name" value="<%=ud.name%>"> </td>
</tr>
<tr>
<td> Date Of Birth </td>
<td> <input type="date" name="dob" value="<%=ud.dob%>"> </td>
</tr>
<tr>
<td> Gender </td>
<td>
<%
String m="";
String f="";
if(ud.gender.equals("Male"))m="selected";
else f="slected";
%>
<select name="gender">
<option value="Male" <%=m%> >Male</option>
<option value="Female" <%=f%> >Female</option>
</select>
</td>
</tr>
<tr>
<td> Contact </td>
<td> <input type="number" name="contact" value="<%=ud.contact%>"> </td>
</tr>
<tr>
<td> Email </td>
<td> <input type="email" name="email" value="<%=ud.email%>"> </td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="s1" value="Update">
<input type="reset" name="r1" value="Reset">
</td>
</tr>
</table>
</form>
<center>
</body>
</html>