-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
84 lines (80 loc) · 3.37 KB
/
profile.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
<?php
ob_start(); // This is buffer area where cookies and session are set and again set to expire them
session_start(); // If Session Variable is present on the page?
include("authentication/authenticated_user.php");
require_once('class.user.php');
$email = $_SESSION["login_user"];
$user = new User($email);
$current_user = $user->get_current_user();
?>
<div class="user_profile">
<h1>Edit Profile</h1>
<hr>
<form action="update_profile.php" method="post" enctype="multipart/form-data">
<div class="row">
<!-- left column -->
<div class="col-md-3">
<div class="text-center">
<?php
if(!empty($current_user['image'])) {
echo('<img class="avatar img-circle" src="data:image;base64,' . $current_user['image'] . '">');
} else {
echo('<img class="avatar img-circle" src="assets/images/user_img.png">');
}
?>
<h6>Upload a different photo...</h6>
<input type="file" name="profile_image" class="form-control">
</div>
</div>
<!-- edit form column -->
<div class="col-md-9">
<div class="alert alert-info alert-dismissable">
<i class="glyphicon glyphicon-info-sign"></i> This is an <strong>.alert</strong>. Use this to show important messages to the user.
</div>
<h3>Personal info</h3>
<div class="row form-group">
<label class="col-lg-3 control-label">First name:</label>
<div class="col-lg-8">
<input type="text" name="first_name" class="form-control" id="" value="<?php echo($current_user['first_name']); ?>" placeholder="First Name">
</div>
</div>
<div class="row form-group">
<label class="col-lg-3 control-label">Last name:</label>
<div class="col-lg-8">
<input type="text" name="last_name" class="form-control" id="" value="<?php echo($current_user['last_name']); ?>" placeholder="Last Name">
</div>
</div>
<div class="row form-group">
<label class="col-lg-3 control-label">Email:</label>
<div class="col-lg-8">
<input type="email" name="email" class="form-control" id="" value="<?php echo($current_user['email']); ?>" placeholder="Email Address">
</div>
</div>
<div class="row form-group">
<label class="col-md-3 control-label">Password:</label>
<div class="col-md-8">
<input type="password" name="password" class="form-control" id="" value="" placeholder="Password">
</div>
</div>
<div class="row form-group">
<label class="col-md-3 control-label">Confirm Password:</label>
<div class="col-md-8">
<input type="password" name="confirm_password" class="form-control" id="" value="" placeholder="Password Confirmation">
</div>
</div>
<div class="row form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<button type="submit" class="btn btn-default">Save</button>
</div>
</div>
</div>
</div>
</form>
</div>
<hr>
<?php
$pagemaincontent = ob_get_contents();
ob_end_clean();
include("application.php");
?>