-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtupdateprofile.jsp
121 lines (104 loc) · 4.7 KB
/
tupdateprofile.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Development of Online College Year Book</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
</head>
<body>
<%
if (request.getParameter("msg") != null) {%>
<script>alert('Profile Updated Successfully..!');</script>
<%}%>
<%
if (request.getParameter("m1") != null) {%>
<script>alert('Failed..!');</script>
<%}%>
<header class="main-header">
<center><h1>Development of Online College Year Book</h1></center>
</header>
<!-- Dropdown Navbar -->
<nav>
<ul>
<li><a href="teacherhome.jsp">Home</a></li>
<li><a href="tupdateprofile.jsp" class="active">Update Profile</a></li>
<li><a href="tviewachievements.jsp">View Achievements</a></li>
<li><a href="logout.jsp">Logout</a></li>
</ul>
</nav>
<!-- Login Form -->
<br/>
<%@page import="java.sql.*"%>
<%@ include file="connect.jsp" %>
<%@ page session="true" %>
<%
String user = session.getAttribute("user").toString();
String sql = "select * from reg where username = '"+user+"'";
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery(sql);
String id = null;
String email = null;
String address = null;
String mobile = null;
if(rs.next()){
id = rs.getString("id");
email = rs.getString("email");
address = rs.getString("address");
mobile = rs.getString("mobile");
}
%>
<center>
<br/>
<h2><font color="black" >Details of <font color="red"> <%=user%></font> </font></h2>
<table width="501" border="1.5" cellpadding="0" cellspacing="0" >
<form action="tupdateprofileact.jsp" method="post">
<tr>
<td width="131" valign="middle" height="48" style="color: #00CC99;"><div align="left" class="style8 style7 style14" style="margin-left:20px;">
<strong><font color="black"> Name : </font></strong></div></td>
<td width="146" valign="middle" height="48" ><div align="left" class="style11" style="margin-left:20px;">
<input type="text" name="username" size="25" readonly="" value="<%=user%>"> </div></td>
</tr>
<tr>
<td width="131" valign="middle" height="48" style="color: #00CC99;"><div align="left" class="style8 style7 style14" style="margin-left:20px;">
<strong><font color="black">Student ID : </font></strong></div></td>
<td width="146" valign="middle" height="48" ><div align="left" class="style11" style="margin-left:20px;">
<input type="text" name="id" size="25" readonly="" value="<%=id%>"></div></td>
</tr>
<tr>
<td width="131" valign="middle" height="48" style="color: #00CC99;"><div align="left" class="style8 style7 style14" style="margin-left:20px;">
<strong><font color="black">Email : </font></strong></div></td>
<td width="146" valign="middle" height="48" ><div align="left" class="style11" style="margin-left:20px;">
<input type="text" name="email" size="25" required="" value="<%=email%>"></div></td>
</tr>
<tr>
<td width="131" valign="middle" height="48" style="color: #00CC99;"><div align="left" class="style8 style7 style14" style="margin-left:20px;">
<strong><font color="black">Address : </font></strong></div></td>
<td width="146" valign="middle" height="48" ><div align="left" class="style11" style="margin-left:20px;">
<input type="text" name="address" size="25" required="" value="<%=address%>"></div></td>
</tr>
<tr>
<td width="131" valign="middle" height="51" style="color: #00CC99;"><div align="left" class="style8 style7 style14" style="margin-left:20px;">
<strong><font color="black">Mobile : </font></strong></div></td>
<td width="146" valign="middle" height="51"><div align="left" class="style11" style="margin-left:20px;">
<input type="text" name="mobile" size="25" required="" value="<%=mobile%>"></div></td>
</tr>
<tr>
<td height="43" rowspan="3"></td>
<td align="left" valign="middle">
<p>
<input name="submit" type="submit" value="UPDATE" /><br/><br/>
</p>
<div align="right">
</div></td>
</tr>
</form>
</table>
</center>
<br>
<!-- Main Footer -->
<footer class="main-footer">
<p>Developed by <a href="https://www.1000projects.org" target="_blank"> 1000Projects </a></p>
</footer>
</body>
</html>