-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathexhome.php
229 lines (216 loc) Β· 10.4 KB
/
exhome.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?php
include "conn.php";
include "auth.php";
?>
<?php
$selectSql="SELECT * FROM `dp` WHERE `username` = '$username';";
$result = mysqli_query($conn, $selectSql);
$data =mysqli_fetch_array($result);
if ($data) {
$folder = $data['folder'];
}
else
{
$folder = "asset/user.png";
}
?>
<!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">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<title>Namaste - Home</title>
<style>
body
{
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand " href="#">
<img src="img/n.jpg" class="rounded-circle" width="35" height="35" class="d-inline-block align-top" alt="Logo">
Namaste
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="profile.php">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link" href="init.php">Messenger</a>
</li>
<li class="nav-item">
<a class="nav-link" href="find.php">Friends</a>
</li>
<li class="nav-item">
<a class="nav-link" href="find2.php">Inbox</a>
</li>
</ul>
</div>
<div class="nav-item dropdown">
<a class="navbar-brand" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="<?php echo $folder ?>" class="rounded-circle" width="30" height="30" class="d-inline-block align-top" alt="user">
<?php echo $_SESSION['username']; ?> <i class="fa fa-caret-down" aria-hidden="true"></i>
</a>
<br>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="profile.php">Profile</a>
<a class="dropdown-item" href="find.php">Friends</a>
<a class="dropdown-item" href="init.php">Messenger</a>
<a class="dropdown-item" data-toggle="modal" data-target=".bd-example-modal-xl" href="">Edit Profile</a>
<a class="dropdown-item" href="find2.php">Inbox</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="sessionOut.php">Sign Out <i class="fa fa-sign-out" aria-hidden="true"></i></a>
</div>
</div>
</nav>
<div class="modal fade bd-example-modal-xl" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content p-5">
<form method = "POST">
<div class="form-group row">
<label class="col-sm-2 col-form-label">Username</label>
<div class="col-sm-2 ">
<input type="text" readonly class="form-control-plaintext pl-2" id="staticEmail" placeholder="<?php echo $_SESSION['username']?> ">
</div>
<div class="col-sm-8 text-success"><span><i class="fa fa-check-circle" aria-hidden="true"></i></span> </div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">First Name</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="fn">
</div>
<label class="col-sm-2 col-form-label">Last Name</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="ln">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Gender</label>
<div class="col-sm-10">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" checked="checked" name="gender" value="male">
<label class="form-check-label" for="inlineRadio1">Male</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="gender" value="female">
<label class="form-check-label" for="inlineRadio2">Female</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Email</label>
<div class="col-sm-6 ">
<input type="text" readonly class="form-control-plaintext pl-2" id="staticEmail" placeholder=" <?php echo $_SESSION['email']?> ">
</div>
<div class="col-sm-4">
<a href="#">Verify Email</a>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Mobile</label>
<div class="col-sm-6 ">
<input type="text" readonly class="form-control-plaintext pl-2" id="staticEmail" placeholder=" <?php echo $_SESSION['mobile']?> ">
</div>
<div class="col-sm-4">
<a href="#">Verify Mobile</a>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Work</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="work">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">City</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="city">
</div>
<label class="col-sm-1 col-form-label">State</label>
<div class="col-sm-5">
<input type="text" class="form-control" name="state">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Country</label>
<div class="col-sm-10">
<select name="country" class="form-control">
<option selected>India</option>
<option>USA</option>
<option>England</option>
<option>Sri Lanka</option>
<option>Bhutan</option>
<option>Nepal</option>
</select>
</div>
</div>
<button type="submit" class="btn btn-primary">Update</button>
</form>
</div>
</div>
</div>
<?php
if($_POST)
{
$fn = $_POST['fn'];
$ln = $_POST['ln'];
$name = $fn." ".$ln;
$work = $_POST['work'];
$gender = $_POST['gender'];
$city = $_POST['city'];
$state = $_POST['state'];
$country = $_POST['country'];
$updatesql = "INSERT INTO `profile` (`username`, `name`, `gender`, `work`, `city`, `state`, `country`, `date`) VALUES ('$username', '$name', '$gender', '$work', '$city', '$state', '$country', current_timestamp())";
$updateResult = mysqli_query($conn, $updatesql);
if($updateResult)
{
echo '<div class="alert alert-success" role="alert">
Your profile has been updated.</div>';
}
else{
echo "Profile has not been updated. ERROR!!!";
}
}
?>
<div id="carouselExampleInterval" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://images.unsplash.com/photo-1568992688065-536aad8a12f6?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1778&q=80" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="https://images.unsplash.com/photo-1556761175-5973dc0f32e7?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=1950&q=80" class="d-block w-100">
</div>
<div class="carousel-item">
<img src="https://images.unsplash.com/photo-1587620962725-abab7fe55159?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80" class="d-block w-100">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleInterval" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleInterval" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<script>
$('.carousel').carousel({
interval: 5000
});
</script>
</body>
</html>