-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
133 lines (101 loc) · 5.6 KB
/
profile.php
File metadata and controls
133 lines (101 loc) · 5.6 KB
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
<?php
session_start();
include 'database.php';
include 'common.php';
$me = mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM user WHERE id = '{$_SESSION['logUserId']}'"));
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Friends</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
<div style='' class='navigation nav' >
<a class='' href='index.php'>Home</a>
<?php if(!isset($_SESSION['friendslogin'])){ ?> <a href='registration.php'>Registration</a> <?php } ?>
<a class='' href='members.php'>Members</a>
<?php if(isset($_SESSION['friendslogin'])){ ?>
<a class='' href='feed.php'>Feed</a>
<a class='' href='friends.php'>Friend List</a>
<a class='' href='chat.php'>Messages</a>
<a class='selected' href='profile.php'>Profile</a>
<a class='' href='?logout=true'>Logout</a> <?php } ?>
</div>
<div class="container" style="border:solid 2px #3345;margin-top: 60px;padding: 20px;">
<div class="row">
<div class="col-lg-12">
<h4>Update Profile</h4>
<p><?php if(isset($_SESSION['alert'])){echo $_SESSION['alert'];$_SESSION['alert']=''; } ?></p>
<center>
<div class="col-lg-4" style="border:solid 2px #5575;border-radius:10px">
<form action="update-image.php" enctype="multipart/form-data" method="post">
<img height="120" width="120" style="border-radius: 120px" src="images/users/<?php if($me['image']==''){ echo 'default.png'; }else{echo $me['image'];} ; ?>" height="120" >
<input type="file" name="image">
<button name="update-image" value="<?php echo $me['id']; ?>" class="btn btn-primary">Update</button>
</form>
</div>
</center>
</div>
<div class="col-lg-6">
<form method="post" action="update-basics.php">
<?php
$name = explode(" ", $me['fullname']);
?>
<div class="form-group">
<label class="label col-lg-12" style="text-align:left;color:#888">First Name</label>
<input type="text" name="fname" class="form-control" placeholder="First Name" value="<?php echo $name[0]; ?>" required>
</div>
<div class="form-group">
<label class="label col-lg-12" style="text-align:left;color:#888">Last Name</label>
<input type="text" name="fname" class="form-control" placeholder="Last Name" value="<?php echo $name[1]; ?>" required>
</div>
<div class="form-group">
<label class="label col-lg-12" style="text-align:left;color:#888">Address</label>
<input type="text" name="address" class="form-control" placeholder="Address" value="<?php echo $me['address']; ?>" required>
</div>
<div class="form-group">
<label class="label col-lg-12" style="text-align:left;color:#888">Email</label>
<input type="email" value="<?php echo $me['email']; ?>" name="email" class="form-control" placeholder="Email Address" required>
</div>
<div class="form-group">
<label class="label col-lg-12" style="text-align:left;color:#888">User Name</label>
<input type="text" value="<?php echo $me['username']; ?>" name="username" id="username" class="form-control" placeholder="Username" required>
</div>
<div class="form-group">
<label class="label"></label>
<button name="update-basics" value="<?php echo $me['id']; ?>" class="btn btn-primary">Update Basic Details</button>
</div>
</form>
</div>
<div class="col-lg-6">
<form method="post" action="update-password.php">
<hr>
<div class="form-group">
<input type="password" name="old" id="old" class="form-control" placeholder="Old Password" required>
</div>
<div class="form-group">
<input type="password" name="password" id="password" class="form-control" placeholder="New Password" required>
</div>
<div class="form-group">
<input type="password" name="password2" id="password2" class="form-control" placeholder="Confirm Password" required>
</div>
<div class="form-group">
<button name="update-passwords" value="<?php echo $me['id']; ?>" class="btn btn-primary">Update Password</button>
</div>
</form>
</div>
<div>
</div>
</div>
</div>
<div class="footer col-lg-12" style="margin-top: 100px;text-align: left;bottom: 0;width: 100%;">
<div class="col-lg-12">
</div>
<div class="col-lg-12">
</div>
</div>
</body>
</html>