-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit_user.php
117 lines (99 loc) · 5.03 KB
/
edit_user.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
<?php include ('session.php');
$get_id = $_GET['id'];
?>
<?php include ('header.php');?>
<body>
<div id="wrapper">
<nav class="navbar navbar-default top-navbar" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Book Ordering System</a>
</div>
<ul class="nav navbar-top-links navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
Welcome : ADMIN
</a>
<!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
</nav>
<!--/. NAV TOP -->
<?php include ('nav_sidebar.php');?>
<!-- /. NAV SIDE -->
<div id="page-wrapper" >
<div id="page-inner">
<div class="row">
<div class="col-md-5 well">
<div class="hero-unit-table">
<div class="hero-unit-table">
<form class="form-horizontal" method="post">
<div class="alert alert-danger"><center><strong>Edit User</strong></center> </div>
<hr>
<?php
$query = mysql_query("select * from tb_user where user_id='$get_id'") or die(mysql_error());
$row = mysql_fetch_array($query);
?>
<div class="control-group">
<label class="control-label" for="inputEmail">FirstName</label>
<div class="controls">
<input type="text" name="fn" class = "form-control" id="inputEmail" value="<?php echo $row['firstname']; ?>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">LastName</label>
<div class="controls">
<input type="text" name="ln" class = "form-control" value="<?php echo $row['lastname']; ?>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Username</label>
<div class="controls">
<input type="text" name="un" class = "form-control" value="<?php echo $row['username']; ?>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
<input type="text" name="p" class = "form-control" value="<?php echo $row['password']; ?>">
</div>
</div>
<hr/>
<div class="control-group">
<div class="controls">
<button type="submit" name="update" class="btn btn-success"><i class="icon-save"></i> Update</button>
</div>
</div>
</form>
<?php
if (isset($_POST['update'])) {
$fn = $_POST['fn'];
$ln = $_POST['ln'];
$un = $_POST['un'];
$p = $_POST['p'];
mysql_query("update tb_user set firstname='$fn', lastname='$ln' , username='$un' , password='$p'") or die(mysql_error());
header('location:user.php');
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<!-- /. WRAPPER -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<?php include ('script.php');?>
</body>
</html>