-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsetting.php
102 lines (77 loc) · 3.09 KB
/
setting.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
<?php require_once 'includes/header.php'; ?>
<?php
$user_id = $_SESSION['userId'];
$sql = "SELECT * FROM users WHERE user_id = {$user_id}";
$query = $connect->query($sql);
$result = $query->fetch_assoc();
$connect->close();
?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-success">
<div class="panel-heading">
<div class="page-heading">Change username / password</div>
</div>
<div class="panel-body">
<div id="usernameForm">
<form action="php_action/changeUsername.php" method="post" class="form-horizontal" id="changeUsernameForm">
<fieldset>
<b>Change Username</b><hr style="margin-top:5px;">
<div class="changeUsernameMessages"></div>
<div class="form-group">
<label for="username" class="col-sm-2 control-label">New Username</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="username" name="username" value="<?php echo $result['username']; ?>" required/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="user_id" id="user_id" value="<?php echo $result['user_id'] ?>" />
<button type="submit" class="btn btn-success" data-loading-text="Loading..." id="changeUsernameBtn">Update username</button>
</div>
</div>
</fieldset>
</form>
</div>
<div id="passwordForm">
<form action="php_action/changePassword.php" method="post" class="form-horizontal" id="changePasswordForm">
<fieldset>
<b>Change Password</b><hr style="margin-top:5px;">
<div class="changePasswordMessages"></div>
<div class="form-group">
<label for="password" class="col-sm-2 control-label">Current Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="password" name="password" placeholder="Current Password" required>
</div>
</div>
<div class="form-group">
<label for="npassword" class="col-sm-2 control-label">New password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="npassword" name="npassword" placeholder="New Password" required>
</div>
</div>
<div class="form-group">
<label for="cpassword" class="col-sm-2 control-label">Confirm Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="cpassword" name="cpassword" placeholder="Confirm Password" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="user_id" id="user_id" value="<?php echo $result['user_id'] ?>" />
<button type="submit" class="btn btn-success">Update password</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#topNavSetting").addClass('active');
});
</script>
<?php require_once 'includes/footer.php'; ?>