-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
161 lines (144 loc) · 8.44 KB
/
Copy pathuser.php
File metadata and controls
161 lines (144 loc) · 8.44 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
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
<?php ob_start(); ?>
<!DOCTYPE html>
<html lang="en">
<?php
$title = "User Profile | Study Drive";
$page = "user";
$toShowNav = "User Profile";
include_once("includes/header.php");
?>
<?php
$user_id = $_SESSION['user_id'];
$query = "SELECT * FROM users WHERE user_id = $user_id";
$select_user_details = mysqli_query($connection, $query);
confirmQuery($select_user_details);
if($row = mysqli_fetch_assoc($select_user_details)){
extract($row);
if($profile_photo === "") {
$user_defined_image_name = strtolower(substr($user_firstname, 0, 1));
$user_defined_image = "predefined_users/$user_defined_image_name.png";
} else{
$user_defined_image = "users/$profile_photo";
}
}
?>
<body class="">
<div class="wrapper ">
<?php
include_once("includes/sidebar.php");
?>
<div class="main-panel">
<!-- Navbar -->
<?php
include_once("includes/navigation.php");
?>
<!-- End Navbar -->
<div class="panel-header panel-header-sm">
</div>
<div class="content">
<div class="row">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h5 class="title">Edit Profile</h5>
</div>
<div class="card-body">
<form action="includes/update-user.php" enctype="multipart/form-data" method="post">
<div class="row">
<div class="col-md-12 pr-1">
<div class="form-group">
<label for="email-id">Email ID</label>
<input type="email" id="email-id" class="form-control user_email" disabled placeholder="Company" value="<?php echo $user_email; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 pr-1">
<div class="form-group">
<label for="first-name">First Name</label>
<input type="text" name="user_firstname" id="first-name" class="form-control user user_firstname" disabled placeholder="Company" value="<?php echo $user_firstname; ?>">
</div>
</div>
<div class="col-md-6 pl-1">
<div class="form-group">
<label for="last-name">Last Name</label>
<input type="text" name="user_lastname" id="last-name" class="form-control user user_lastname" disabled placeholder="Last Name" value="<?php echo $user_lastname; ?>">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="user-about">About Me</label>
<textarea rows="4" name="user_aboutme" id="user-about" cols="80" class="form-control user user_about" disabled placeholder="Here can be your description"><?php echo $about_me; ?></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<button type="button" name="edit_profile" class="btn custom-outline outline-primary" id="edit-profile">Edit Profile</button>
<button type="submit" name="save_profile" class="btn custom-outline outline-success" id="save-profile" hidden="true">Save Profile</button>
<button type="button" class="btn custom-outline outline-danger" hidden id="cancel-profile">Cancel</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-4">
<form action="includes/update-user.php" id="changephotoform" method="post" enctype="multipart/form-data">
<input type="hidden" name="change_profile_photo" value="1">
<input type="file" name="profile_photo" id="profile_photo" hidden="true">
</form>
<div class="card card-user">
<div class="image">
<div id="coverimage">
<img src="assets/images/bg5.jpg" alt="...">
</div>
</div>
<div class="card-body">
<div class="author">
<div id="profileimage">
<img class="avatar border-gray img-fluid" width="400px" src="assets/images/<? echo $user_defined_image; ?>" alt="...">
<button class="btn custom-outline outline-custom-light-white" id="changeprofile" hidden="true" onclick="document.getElementById('profile_photo').click()"><i class="fas fa-images"></i></button>
</div>
<h5 class="title unselectable" id="user_name"><?php echo $user_firstname . " " . $user_lastname; ?></h5>
<p class="description">
<?php echo $user_email; ?>
</p>
</div>
<p class="description text-center">
<?php echo $about_me; ?>
</p>
<div class="text-center">
<button type="button" name="remove_profile" class="btn custom-outline outline-custom-white" id="remove_profile" hidden="true">Remove Photo</button>
<button class="btn custom-outline outline-custom-white" id="changeprofilephoto" hidden="true" onclick="document.getElementById('profile_photo').click()">Change Photo</button>
</div>
</div>
<hr>
<div class="button-container">
<button href="#" class="btn btn-neutral btn-icon btn-round btn-lg">
<i class="fab fa-facebook-f"></i>
</button>
<button href="#" class="btn btn-neutral btn-icon btn-round btn-lg">
<i class="fab fa-twitter"></i>
</button>
<button href="#" class="btn btn-neutral btn-icon btn-round btn-lg">
<i class="fab fa-google-plus-g"></i>
</button>
</div>
</div>
</div>
</div>
</div>
<?php
include_once("includes/footer.php");
?>
</div>
</div>
</body>
<!-- Core JS Files -->
<?php
include_once("includes/scripts.php");
?>
</html>