-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
186 lines (159 loc) · 4.4 KB
/
profile.php
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html>
<?php
session_start();
?>
<head>
<title>Profile</title>
<link href='https://fonts.googleapis.com/css?family=ABeeZee' rel='stylesheet'>
<link rel="icon"
type="image/png"
href="includes\images\School Hub Small Logo image.png">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
body {
font-family: 'ABeeZee';font-size: 22px;
}
table {
width: 75%;
border: 0px solid black;
padding: 15px;
}
th, td {
padding: 10px;
text-align: left;
}
table, th, td {
border: 0px solid black;
border-collapse: collapse;
}
</style>
</head>
<body style="background-color:powderblue">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.php"><img src="\includes\images\School Hub small logo image.png" width=50px height=40px></a>
</div>
<ul class="nav navbar-nav">
<li><a href="index.php">Home</a></li>
<li><a href="courses.php">Courses</a></li>
<li class="active"><a href="profile.php">Profile</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="signup.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="login.php"><span class="glyphicon glyphicon-log-in"></span> Login/Logout</a></li>
</ul>
</div>
</nav>
<?php
if (isset($_SESSION['u_id']) == FALSE) {
echo '<h3 style="background-color:#c9ebff; border-bottom:6px solid #ffb200; width: 20%; margin-left: 10px;">You are not logged in</h3>';
}
?>
<table>
<tr>
<th rowspan="2"><img src="http://socialsciences.uottawa.ca/human-motivation/sites/socialsciences.uottawa.ca.human-motivation/files/generic_male_0.jpg", width="200", height="200", alt="Profile Picture"></th>
<th><?php
if (isset($_SESSION['u_id'])) {
echo $_SESSION['u_uid'];
} else {
echo "Username";
}
?></th>
</tr>
<tr>
<td><?php
if (isset($_SESSION['u_id'])) {
echo $_SESSION['u_email'];
} else {
echo "";
}
?></td>
</tr>
</table>
<table id="t01">
<tr>
<th>First name:</th>
<td><?php
if (isset($_SESSION['u_id'])) {
echo $_SESSION['u_first'];
} else {
echo "N/A";
}
?></td>
</tr>
<tr>
<th>Last name:</th>
<td><?php
if (isset($_SESSION['u_id'])) {
echo $_SESSION['u_last'];
} else {
echo "N/A";
}
?></td>
</tr>
<tr>
<th>Role:</th>
<td><?php
if (isset($_SESSION['u_id'])) {
echo $_SESSION['u_role'];
} else {
echo "N/A";
}
?></td>
</tr>
<tr>
<th>Age:</th>
<td><?php
if (isset($_SESSION['u_id'])) {
echo $_SESSION['u_age'];
} else {
echo "N/A";
}
?></td>
</tr>
</table>
<?php
if (isset($_SESSION['u_id'])) {
echo '<form style="margin:5px" action="profile.php" method="POST">
<button type="submit" name="change">Change Details</button>
</form>';
echo '<form style="margin:5px" action="profile.php" method="POST">
<button type="submit" name="delete">Delete Account</button>
</form>';
if (isset($_POST['delete'])) {
echo 'Enter you password to confirm deletion:';
echo '<h3 style="color:red;">Warning: This is permanent. All your data will be deleted!</h3>';
echo '<form style="margin:2px" action="includes/deleteUser_inc.php" method="POST">
<input type="password" name="password" placeholder="Password">
<button type="submit" name="submit">Confirm</button>
</form>';
echo '<form action="profile.php">
<button type="submit">Cancel</button>
</form>';
}
if (isset($_POST['change'])) {
echo 'Enter you password to confirm change:';
echo '<form style="margin:2px" action="includes/changeUser_inc.php" method="POST">
<input type="password" name="password" placeholder="Password">
<input tpye="text" name="first" placeholder="First Name">
<input tpye="text" name="last" placeholder="Last Name">
<input tpye="text" name="age" placeholder="Age">
<input tpye="text" name="role" placeholder="Role">
<input tpye="text" name="email" placeholder="Email">
<input tpye="text" name="username" placeholder="Username">
<button type="submit" name="submit">Confirm</button>
</form>';
echo '<form action="profile.php">
<button type="submit">Cancel</button>
</form>';
}
}
?>
</body>
</html>