-
Notifications
You must be signed in to change notification settings - Fork 0
/
setting.php
97 lines (73 loc) · 3.21 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
<?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">
<ol class="breadcrumb">
<li><a href="dashboard.php">Home</a></li>
<li class="active">Setting</li>
</ol>
<div class="panel panel-default">
<div class="panel-heading">
<div class="page-heading"> <i class="glyphicon glyphicon-wrench"></i> Setting</div>
</div> <!-- /panel-heading -->
<div class="panel-body">
<form action="php_action/changeUsername.php" method="post" class="form-horizontal" id="changeUsernameForm">
<fieldset>
<legend>Change Username</legend>
<div class="changeUsenrameMessages"></div>
<div class="form-group">
<label for="username" class="col-sm-2 control-label">Username</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="username" name="username" placeholder="Usename" value="<?php echo $result['username']; ?>"/>
</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"> <i class="glyphicon glyphicon-ok-sign"></i> Save Changes </button>
</div>
</div>
</fieldset>
</form>
<form action="php_action/changePassword.php" method="post" class="form-horizontal" id="changePasswordForm">
<fieldset>
<legend>Change Password</legend>
<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">
</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">
</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">
</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-primary"> <i class="glyphicon glyphicon-ok-sign"></i> Save Changes </button>
</div>
</div>
</fieldset>
</form>
</div> <!-- /panel-body -->
</div> <!-- /panel -->
</div> <!-- /col-md-12 -->
</div> <!-- /row-->
<script src="custom/js/setting.js"></script>
<?php require_once 'includes/footer.php'; ?>