-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
49 lines (49 loc) · 1.48 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
<?php
$filepath = realpath(dirname(__FILE__));
include_once ($filepath.'/inc/header.php');
Session::checkSession();
$userId = Session::get("userId");
?>
<div class="container">
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$updateUser = $user->updateUserData($userId, $_POST);
if (isset($updateUser)) {
echo $updateUser;
}
}
?>
<?php
$getData = $user->getUserData($userId);
if ($getData) {
$result = $getData->fetch_assoc();
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel panel-heading">
<h2>Your Profile</h2>
</div>
<div class="panel-body">
<form action="" method="post">
<div class="form-group">
<label for="name">Full Name</label>
<input type="text" name="name" id="name" class="form-control" value="<?php echo $result['name']; ?>">
</div>
<div class="form-group">
<label for="username">Username</label>
<input type="text" name="username" id="username" class="form-control" value="<?php echo $result['username']; ?>">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" name="email" id="email" class="form-control" value="<?php echo $result['email']; ?>">
</div>
<button type="submit" class="btn btn-success">Update</button>
</form>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
<?php include 'inc/footer.php'; ?>