-
Notifications
You must be signed in to change notification settings - Fork 1
/
setting.php
231 lines (207 loc) · 8.33 KB
/
setting.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
230
231
<!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="css/setting.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>Setting</title>
<style>
*
{
font-weight: 400;
}
.frm-edit-profile input
{
outline: none;
}
.frm-edit-profile input::placeholder
{
color: #ccc;
}
.frm-edit-profile input
{
cursor: default;
font-weight: 400;
}
.main-div-myprofile-discription
{
color: #5B5E64;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.main-div-myprofilePic
{
width: 10%;
height: 15vh;
background-color: #fff;
border-radius: 50%;
margin-top: 2vh;
margin-bottom: 2vh;
margin-left: 10px;
display: flex;
align-items: center;
justify-content:center;
}
@media screen and (max-width: 560px) {
ul.right
{
position: absolute;
top: 100%;
left: 0;
display: flex;
align-items: center;
flex-direction: column;
list-style: none;
margin-right: 40px;
height: 1000px;
width: 530px;
background-color: aliceblue;
z-index: -1;
}
.right .menu
{
position: fixed;
top: 10%;
left: 85%;
display: block;
z-index: 100;
width: 30px;
}
ul.right li
{
margin: 10px 5px;
padding: 10px;
width: 90%;
display: flex;
align-items: center;
}
ul.right li a{
color: black;
text-decoration: none;
font-size: 14px;
text-align: center;
}
.left input
{
width: 100%;
}
.right .menu
{
display: inline-block;
}
}
.right .menu
{
display: none;
}
</style>
</head>
<body>
<div class="setting-container">
<div class="setting-nav">
<nav class="nav">
<ul class="left">
<li onclick="Login.php"><img src="./assets/image/chevron_up_29px.png" alt=""><a class='udemy' href="Homepage.php">Temari Dojo</a></li>
<li><img src="./assets/image/search_24px.png" alt=""><input type="search" name="search" id="" class="same" placeholder='Search for anything'></li>
</ul>
<ul class="right">
<img class='menu' src="./assets/image/Menu_50px.png" alt="">
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn"> <strong id="username">Username</strong><i class="fa-solid fa-user usericon"></i> </button>
<div id="myDropdown" class="dropdown-content">
<a class="myDropdown-a1" href="setting.php"><i class="fa-solid fa-user-pen usericon2"></i>Edit Profile</a>
<a class="myDropdown-a1" href="Login.php"><i class="fa-solid fa-arrow-right-from-bracket usericon2"></i>Logout</a>
</div>
</div>
</ul>
</nav>
</div>
<script>
// fetch user data and fill form
window.onload = function() {
fetch('http://localhost/Temari-dojo/backend/api/user/loadUserInfoAPI.php')
.then(response => response.json())
.then(data => {
let form = document.forms[0];
form.elements.firstname.value = data.firstname;
form.elements.lastname.value = data.lastname;
form.elements.email.value = data.email;
form.elements.username.value = data.username;
form.elements.phoneNo.value = data.phoneNo;
form.elements.address.value = data.address;
document.querySelector("#username").innerHTML = data.username;
})
.catch(error => console.error(error));
}
</script>
<div class="setting-body">
<div class="setting-aside">
<button class="btn btn-profile"><i class="fa-solid fa-user"></i>Profile</button>
<button class="btn btn-subscription"><i class="fa-solid fa-comments-dollar"></i>Subscription</button>
</div>
<div class="setting-section">
<div class="main-div-myprofile-discription">
<h2>Edit Profile</h2>
</div>
<div class="main-div-myprofile-profilePic">
<img class="main-div-myprofile-Pic" src="https://www.w3schools.com/howto/img_avatar.png" alt="ProfilePic">
</div>
<form class="frm-edit-profile" method="post" action="backend\api\user\updateUserInfoAPI.php">
<div class="frm-edit-1">
<label class = "label1" for="">Firstname:<input class="textfield" type="text" name="firstname" placeholder="Firstname"></input></label>
<label class = "label1" for="">Lastname :<input class="textfield" type="text" name="lastname" placeholder="Lastname"></input>
<label class = "label1" for="">username :<input class="textfield" type="text" name="username" placeholder="Username"></input>
<label class = "label1" for="">email :<input class="textfield" type="email" name="email" placeholder="email"></input>
<label class = "label1" for="">Telephone:<input class="textfield" type="text" name="phoneNo" placeholder="Phone number"></input>
<label class = "label1" for="">Address :<input class="textfield" type="text" name="address" placeholder="address"></input>
</div>
<div class="frm-edit-2">
<input class="textfield textfield-submit" type="submit" name="update" value="update"></input>
</div>
</form>
</div>
</div>
</div>
<script>
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
document.querySelector(".btn-subscription").onclick = function () {
location.href = "pricingPage.html";
};
document.querySelector('.menu').addEventListener('click',function()
{
if(document.querySelector('.right').style.left === "0%")
{
document.querySelector('.right').style.left = "-130%";
document.querySelector('.right').style.transition = ".5s all linear";
document.querySelector('.menu').style.transition = ".5s all linear";
document.querySelector('.menu').style.left = "5%";
}
else{
document.querySelector('.right').style.left = "0%";
document.querySelector('.right').style.transition = ".5s all linear";
document.querySelector('.menu').style.left = "85%";
document.querySelector('.menu').style.transition = ".5s all linear";
}
})
</script>
</body>
</html>