-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edit_user.php
127 lines (102 loc) · 4.14 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
118
119
120
121
122
123
124
125
126
127
<?php
include("connection.php");
$edit_id = $_GET["id"];
$edit_query = "select * from user_info where id='$edit_id'";
$run_edit = mysqli_query($con,$edit_query);
$row = mysqli_fetch_array($run_edit);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit Category</title>
</head>
<body>
<?php include("user_dashboard.php") ?>
<div id="page-wrapper" class="gray-bg dashbard-1">
<div class="content-main">
<!--banner-->
<div class="banner">
<h2>
<a href="Manage_user.php">Profile</a>
<i class="fa fa-angle-right"></i>
<span>Edit Profile</span>
</h2>
</div>
<div class="login">
<div class="main-agileits col-md-8 col-md-offset-2" style="margin-top:-105px;">
<div class="form-w3agile form1">
<h3 style="font-size:30px; padding-top:10px;">Edit User Profile!</h3>
<form action="#" method="post" enctype="multipart/form-data">
<div class="key">
<i class="fa fa-user" aria-hidden="true"></i>
<input type="text" value="<?php echo $row[1] ?>" name="user_name" >
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-envelope" aria-hidden="true"></i>
<input type="text" value="<?php echo $row[2] ?>" name="user_email" >
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-lock" aria-hidden="true"></i>
<input type="password" value="<?php echo $row[3] ?>" name="pass" >
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-user" aria-hidden="true"></i>
<input type="text" value="<?php echo $row[4] ?>" name="con">
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-user" aria-hidden="true"></i>
<input type="text" value="<?php echo $row[5] ?>" name="loc">
<div class="clearfix"></div>
</div>
<div class="key">
<i class="fa fa-user" aria-hidden="true"></i>
<input style="margin-top:10px;" value="<?php echo $row[6] ?>" type="file" name="txtfile" >
<div class="clearfix"></div>
</div>
<input type="submit" name="btnsave" value="Save Changes">
<!-- PHP Start -->
<?php
if(isset($_POST['btnsave']))
{
$user_id = $edit_id;
$user_name = $_POST["user_name"];
$user_email = $_POST["user_email"];
$pas = $_POST["pass"];
$num = $_POST["con"];
$add = $_POST["loc"];
$filename = $_FILES["txtfile"]["name"];
$oldlocation = $_FILES["txtfile"]["tmp_name"];
$newlocation = "images/".$filename;
move_uploaded_file($oldlocation,$newlocation);
$update = "update user_info set username='$user_name', email='$user_email' , password='$pas' , contact='$num', address = '$add' , img='$filename'
where id='$user_id'";
$run_insert = mysqli_query($con,$update);
if($run_insert>0)
{
echo"
<div style='margin-top:5px;' class='alert alert-success' role='alert'>
<b>Successfull!</b>User Detail has been Updated..
</div>
";
}
else
{
echo "<script>alert('Data Not Save')</script>";
}
}
?>
<!-- End Here -->
</form>
</div>
</div>
</div>
<!-- End Here -->
</body>
</html>