Repository navigation
Expand file tree
/
Copy pathupdate_sinfo.php
More file actions
129 lines (120 loc) · 3.56 KB
/
Copy pathupdate_sinfo.php
File metadata and controls
129 lines (120 loc) · 3.56 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
121
122
123
124
125
126
127
128
129
<?php
session_start();
if (!isset($_SESSION["student"])) {
header('Location: index.php');
exit;
}
require_once('mysql_conn.php');
$sql = "SELECT * FROM users";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$user_id= $row['user_id'];
if($_SESSION["student"] == $user_id)
{
$getUid = $row['user_id'];
$getPass = $row['pass'];
$getRole = $row['role'];
}
}
$sql1 = "SELECT * FROM user_info";
$result1 = mysql_query($sql1);
while($row = mysql_fetch_array($result1))
{
$user_id= $row['user_id'];
if($_SESSION["student"] == $user_id)
{
$getUid = $row['user_id'];
$getName = $row['full_name'];
$getEmail = $row['email'];
$getEdu = $row['edu'];
$getDOB = $row['dob'];
$getGen = $row['gender'];
$getPhn = $row['phone'];
$getAdrs = $row['address'];
}
}
?>
<html>
<head><title>Student Dashboard || Online Quiz Test</title></head>
<body>
<center>
<h1>Student Dashboard</h1>
<hr>
<h2>Update Your Profile Info.</h2>
<hr>
<form action="update_sinfo1.php" method="POST">
<table>
<tr>
<th>Full Name: </th>
<td><input type="text" id="fname" name="fname" value="<?php echo $getName ?>"></td>
<td><label id="fname"></label></td>
</tr>
<tr>
<th>User ID: </th>
<td><input type="text" id="uid" name="uid" value="<?php echo $getUid ?>" disabled></td>
<td><label id="uid"></label></td>
</tr>
<tr>
<th>Email: </th>
<td><input type="text" id="email" name="email" value="<?php echo $getEmail ?>"></td>
<td><label id="email"></label></td>
</tr>
<tr>
<th>Gender: </th>
<td><input type="text" id="gender" name="gender" value="<?php echo $getGen ?>" disabled></td>
</tr>
<tr>
<th>DOB: </th>
<td><input type="date" id="dob" name="dob" value="<?php echo $getDOB ?>"></td>
<td><label id="dob"></label></td>
</tr>
<tr>
<th>You Role As: </th>
<td><input type="text" id="role" name="role" value="<?php echo $getRole ?>" disabled></td>
</tr>
<tr>
<th>Current Education Level: </th>
<td><input type="text" name="cedu" value="<?php echo $getEdu ?>" disabled>
</td>
</tr>
<tr>
<th>Change Education Level: </th>
<td><select id="edu" name="edu">
<option>Phd</option>
<option>Master's</option>
<option>Graduate</option>
<option>Under Graduate</option>
<option>College</option>
<option>School</option>
</select>
</td>
</tr>
<tr>
<th>Phone: </th>
<td><input type="text" id="phone" name="phone" value="<?php echo $getPhn ?>"></td>
<td><label id="phone"></label></td>
</tr>
<tr>
<th>Address: </th>
<td><textarea id="address" name="address" cols="22" rows="4"><?php echo $getAdrs ?></textarea></td>
<td><label id="address"></label></td>
</tr>
<tr>
<th>Password: </th>
<td><input type="text" id="pass" name="pass" value="<?php echo $getPass ?>"></td>
<td><label id="pass"></label></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" name="submit" value="Update"></td>
</tr>
</table>
</form>
<br>
<a href="s_dashboard.php">Go To Your Dashboard</a>
<br>
<a href="logout.php">Logout</a>
</center>
</body>
</html>