Repository navigation
Expand file tree
/
Copy pathsettings.php
More file actions
253 lines (243 loc) · 8.99 KB
/
Copy pathsettings.php
File metadata and controls
253 lines (243 loc) · 8.99 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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
session_start();
$mysqli = require __DIR__ . "\php\database.php";
$userId = $_SESSION["user_id"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Thuy" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!-- Google fonts: -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;400;900&family=Ubuntu:wght@300;400;500;700&display=swap"
rel="stylesheet"
/>
<!-- Library & Files: -->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link rel="icon" href="images/orange.ico" />
<link rel="stylesheet" href="css/styles.css" />
<link rel="stylesheet" href="css/mobile.css" />
<link rel="stylesheet" href="css/settings.css" />
<link rel="stylesheet" href="css/navbar2.css" />
<title>OrangeDoorhinge — Settings</title>
</head>
<body>
<nav class="site-nav">
<div class="container">
<div class="menu-bg-wrap">
<div class="site-navigation">
<div class="row g-0 align-items-center">
<div class="col-8 text-center">
<ul
class="js-clone-nav d-none d-lg-inline-block text-start site-menu mx-auto"
>
<li class="active"><a href="index.php">Home</a></li>
<li><a href="fundraiser.html">Fundraisers</a></li>
<?php if (isset($_SESSION["user_id"])): ?>
<li><a href="php\logout.php">Logout</a></li>
<?php endif; ?>
</ul>
</div>
<div class="col-2 text-end">
<a
href="#"
class="burger ms-auto float-end site-menu-toggle js-menu-toggle d-inline-block d-lg-none light"
>
<span></span>
</a>
</div>
</div>
</div>
</div>
</div>
</nav>
<section class="py-5 my-5">
<div class="container">
<h1 class="mb-5">Account Settings</h1>
<div class="bg-white shadow rounded-lg d-block d-sm-flex">
<div class="profile-tab-nav border-right">
<div class="p-4">
<h4 class="text-center">General</h4>
</div>
<div
class="nav flex-column nav-pills"
id="v-pills-tab"
role="tablist"
aria-orientation="vertical"
>
<a
class="nav-link active"
id="account-tab"
data-toggle="pill"
href="#account"
role="tab"
aria-controls="account"
aria-selected="true"
>
<i class="fa fa-home text-center mr-1"></i>
Personal Information
</a>
<a
class="nav-link"
id="password-tab"
data-toggle="pill"
href="#password"
role="tab"
aria-controls="password"
aria-selected="false"
>
<i class="fa fa-key text-center mr-1"></i>
Change Password
</a>
<a
class="nav-link"
id="fundraiser-tab"
data-toggle="pill"
href="#fundraisers"
role="tab"
aria-controls="fundraiser"
aria-selected="false"
>
<i class="fa fa-tv text-center mr-1"></i>
Fundraisers
</a>
</div>
</div>
<div class="tab-content p-4 p-md-5" id="v-pills-tabContent">
<div
class="tab-pane fade show active"
id="account"
role="tabpanel"
aria-labelledby="account-tab"
>
<form action="php\update-stuff.php" method="post">
<h3 class="mb-4">Account Information</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>First Name</label>
<input name="newFName" type="text" class="form-control" />
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Last Name</label>
<input name="newLName" type="text" class="form-control" />
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Email</label>
<input name="newMail" type="email" class="form-control" />
<input type="hidden" name="userId" value=<?php echo $userId?>>
</div>
</div>
</div>
<div>
<button class="btn btn-primary">Update</button>
<a href="index.php">
<button class="btn btn-light">Cancel</button>
</a>
</div>
</form>
</div>
<div
class="tab-pane fade"
id="password"
role="tabpanel"
aria-labelledby="password-tab"
>
<form action="php\update-pass.php" method="post">
<h3 class="mb-4">Password Settings</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Old password</label>
<input name="oldPass" type="password" class="form-control" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>New password</label>
<input name="newPass1" type="password" class="form-control" />
<input type="hidden" name="userId" value=<?php echo $userId?>>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Confirm new password</label>
<input name="newPass2" type="password" class="form-control" />
</div>
</div>
</div>
<div>
<button class="btn btn-primary">Update</button>
<a href="index.php">
<button class="btn btn-light">Cancel</button>
</a>
</div>
</form>
</div>
<div
class="tab-pane fade"
id="fundraisers"
role="tabpanel"
aria-labelledby="fundraiser-tab"
>
<h3 class="mb-4">Fundraisers</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<table>
<thead>
<tr>
<td>Name</td>
<td>Goal</td>
<td>Current Amount</td>
</tr>
</thead>
<tbody>
<?php
$results = mysqli_query($mysqli, "SELECT * FROM fundraisers WHERE userId = $userId");
while($row = mysqli_fetch_array($results)) {
?>
<tr>
<td>
<form action="fundraiser.php" id="signin" method="post">
<button class="btn btn-primary btn-lg" style="padding-left: 2.5rem; padding-right: 2.5rem;" <a href="#"
class="trigger-btn" data-toggle="modal"><?php echo $row['name']?>
</button>
<input type="hidden" name="fundId" value=<?php echo $row['id']?>>
</form>
</td>
<td><?php echo $row['goal']?></td>
<td><?php echo $row['amount']?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div>
</div>
</div>
</div>
</div>
</section>
<script src="js/jquery-3.6.1.min.js"></script>
<script src="js/bootstrapcdn.min.js"></script>
<script src="js/navbar.js"></script>
</body>
</html>