-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
183 lines (175 loc) · 5.55 KB
/
profile.php
File metadata and controls
183 lines (175 loc) · 5.55 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php
include("mysql/connect.php");
//Check nếu chưa có user_mail (chưa đăng nhập) sẽ trả về trang login.php
if(session_id() == '') session_start();
if (isset($_SESSION['user_mail']) == false) {
header("location: login.php");
exit();
}
//GET CURRENT VALUES FROM DATABASE (User_name, Address, Phone)
$gcv_mail = $_SESSION['user_mail'];
$gcv_sql = "SELECT * FROM Users WHERE user_mail='$gcv_mail'";
$gcv_query = mysqli_query($conn, $gcv_sql);
if ($row = mysqli_fetch_assoc($gcv_query)) {
$current_address = $row['address'];
$current_phone = $row['phone'];
$current_username = $row['user_name'];
}
//GET VALUES FROM SESSION
$get_user_name = $_SESSION['user_name'];
$get_user_mail = $_SESSION['user_mail'];
?>
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<meta charset="utf-8">
<title>LUDU - Cập nhật thông tin</title>
<link rel="icon" type="image/jpg" href="images/logo1.png"/>
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
</head>
<div class="wrapper">
<div class="account-container">
<h1>Your Profile</h1>
<span class="line"></span>
<h2><?php echo $_SESSION['user_mail'] ?></h2>
<span class="line"></span>
<form method="POST" action="">
<div class="form-group">
<input name="user_name" type="text" class="form-control" required value="<?php echo $current_username ?>" disabled>
</div>
<div class="form-group">
<input name="address" type="text" class="form-control" required value="<?php echo $current_address ?>" disabled>
</div>
<div class="form-group">
<input name="phone" type="phone" class="form-control" required value="<?php echo $current_phone ?>" disabled>
</div>
<a href="./changepassword.php" class="btn">Change Information</a>
<a href="index.php" class="btn" style="margin-right:8px;">Back</a>
</form>
</div>
</div>
<!-- css -->
<style>
* {
box-sizing: border-box;
}
html {
background: rgba(38, 38, 38, .92);
font-family: 'Lato', sans-serif;
font-weight: 400;
}
.wrapper {
height: 100vh;
position: relative;
background-color: rgba(38, 38, 38, 0.92)
}
.wrapper .password-container {
display: none;
top: 23%;
}
.wrapper .account-container {
top: 30%;
}
.wrapper .account-container, .wrapper .password-container {
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
width: 700px;
padding: 0 150px;
border-radius: 8px;
margin: 96px auto 0 auto;
box-shadow: 0 6px 24px rbga(0, 0, 0, 1);
}
.wrapper .account-container h1, .wrapper .password-container h1, .wrapper .account-container h2, .wrapper .password-container h2, .wrapper .account-container h3, .wrapper .password-container h3 {
text-align: center;
margin: 6px 0;
padding: 0;
color: white;
}
.wrapper .account-container h1, .wrapper .password-container h1 {
font-size: 22px;
font-weight: 400;
}
.wrapper .account-container h2, .wrapper .password-container h2 {
font-size: 16px;
font-weight: 200;
}
.wrapper .account-container h3, .wrapper .password-container h3 {
font-size: 12px;
color: #9b9b9b;
font-weight: 200;
}
.wrapper .account-container .line, .wrapper .password-container .line {
height: 1px;
width: 36px;
background: #9b9b9b;
display: block;
margin: 24px auto;
}
.wrapper .account-container form, .wrapper .password-container form {
margin: 48px 0;
}
.wrapper .account-container form .form-group, .wrapper .password-container form .form-group {
margin: 12px 0;
position: relative;
display: inline-block;
}
.wrapper .account-container form .form-group:first-child, .wrapper .password-container form .form-group:first-child {
margin-top: 0;
}
.wrapper .account-container form .form-group label, .wrapper .password-container form .form-group label {
font-size: 16px;
color: #878787;
font-weight: 200;
margin: 24px 0;
position: absolute;
z-index: 2;
left: 24px;
top: 26px;
pointer-events: none;
transition: transform 100ms ease;
transform: translateY(-30px);
}
.wrapper .account-container form .form-group .helper-text, .wrapper .password-container form .form-group .helper-text {
font-size: 14px;
color: #878787;
font-weight: 200;
text-align: right;
display: inline-block;
position: absolute;
right: 0px;
}
.wrapper .account-container form .form-group input, .wrapper .password-container form .form-group input {
width: 400px;
padding: 24px 24px 18px;
border: none;
border-radius: 4px;
outline: 0 none;
position: relative;
color: black;
font-weight: 200;
}
.wrapper .account-container form .form-group input:focus + label, .wrapper .password-container form .form-group input:focus + label, .wrapper .account-container form .form-group input:valid + label, .wrapper .password-container form .form-group input:valid + label {
font-size: 12px;
transform: translateY(-40px);
}
.wrapper .account-container form .form-group input:focus, .wrapper .password-container form .form-group input:focus {
transition: 0.125s all ease-in-out;
box-shadow: inset 0 0 0 2px #179be5, 0 6px 24px rgba(0, 0, 0, .50);
}
.wrapper .account-container form .btn, .wrapper .password-container form .btn {
border-radius: 48px;
background: #d9534f;
border: none;
color: white;
font-size: 16px;
font-weight: 200;
padding: 12px 24px;
margin: 12px 0;
outline: none;
float: right;
}
</style>