-
Notifications
You must be signed in to change notification settings - Fork 4
/
mypage.html
457 lines (403 loc) · 17.8 KB
/
mypage.html
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" th:href="@{/styles/contact.css}">
<link rel="stylesheet" type="text/css" th:href="@{/styles/contact_responsive.css}">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyCIwF204lFZg1y4kPSIhKaHEXMLYxxuMhA"></script>
<script th:src="@{/plugins/marker_with_label/marker_with_label.js}"></script>
<script th:src="@{/js/contact.js}"></script>
<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
<style>
button + button {
margin-left: 2%;
}
</style>
<style>
#ul {
list-style-type: none;
background-color: #D9D9D9;
width: 50%;
padding: 0;
margin: 0;
border-radius: 2%;
}
#li a {
text-decoration: none;
display: block;
color: #000;
padding: 5% 12% 5% 12%;
font-weight: bold;
border-bottom: 1px solid #fff;
cursor:pointer;
}
#li a:hover {
background-color: #005B00;
color: #fff;
border-radius: 2%;
}
/* #li a.active-color {
background-color:#005B00;
} */
@media (max-width: 768px) {
/* 모바일에 최적화된 예외 CSS 코드*/
#ul {
list-style-type: none;
background-color: #ccc;
width: 100%;
padding: 0;
margin: 0;
border-radius: 2%;
}
#li a {
text-decoration: none;
display: block;
color: #000;
padding: 2% 8% 2% 8%;
font-weight: bold;
border-bottom: 1px solid #fff;
cursor:pointer;
}
#li a:hover {
background-color: #005B00;
color: #fff;
border-radius: 2%;
}
}
</style>
<script>
function sample6_execDaumPostcode() {
new daum.Postcode({
oncomplete: function(data) {
// 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
// 각 주소의 노출 규칙에 따라 주소를 조합한다.
// 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
var addr = ''; // 주소 변수
var extraAddr = ''; // 참고항목 변수
//사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
addr = data.roadAddress;
} else { // 사용자가 지번 주소를 선택했을 경우(J)
addr = data.jibunAddress;
}
// 사용자가 선택한 주소가 도로명 타입일때 참고항목을 조합한다.
if(data.userSelectedType === 'R'){
// 법정동명이 있을 경우 추가한다. (법정리는 제외)
// 법정동의 경우 마지막 문자가 "동/로/가"로 끝난다.
if(data.bname !== '' && /[동|로|가]$/g.test(data.bname)){
extraAddr += data.bname;
}
// 건물명이 있고, 공동주택일 경우 추가한다.
if(data.buildingName !== '' && data.apartment === 'Y'){
extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName);
}
// 표시할 참고항목이 있을 경우, 괄호까지 추가한 최종 문자열을 만든다.
if(extraAddr !== ''){
extraAddr = ' (' + extraAddr + ')';
}
// 조합된 참고항목을 해당 필드에 넣는다.
document.getElementById("sample6_extraAddress").value = extraAddr;
} else {
document.getElementById("sample6_extraAddress").value = '';
}
// 우편번호와 주소 정보를 해당 필드에 넣는다.
document.getElementById('sample6_postcode').value = data.zonecode;
document.getElementById("sample6_address").value = addr;
// 커서를 상세주소 필드로 이동한다.
document.getElementById("sample6_detailAddress").focus();
}
}).open();
}
function changetext() {
const btnElement = document.getElementById('mpupdate_btn');
btnElement.innerText = "회원 정보 저장";
}
function modal() {
$('#deletemodal').modal();
}
function confirmModal() {
}
$(document).ready(function(){
$('#mpupdate_btn').click(function(){
$('#pwd').attr('readonly', false);
if(pwd.readOnly == false) {
pwd.style.backgroundColor = '#ffffff'
}
$('#uname').attr('readonly', false);
if(uname.readOnly == false) {
uname.style.backgroundColor = '#ffffff'
}
$('#phone').attr('readonly', false);
if(phone.readOnly == false) {
phone.style.backgroundColor = '#ffffff'
}
$('#email').attr('readonly', false);
if(email.readOnly == false) {
email.style.backgroundColor = '#ffffff'
}
$('#gender').attr('readonly', false);
if(gender.readOnly == false) {
gender.style.backgroundColor = '#ffffff'
}
$('#birth').attr('readonly', false);
if(birth.readOnly == false) {
birth.style.backgroundColor = '#ffffff'
}
$('#sample6_postcode').attr('readonly', false);
if(sample6_postcode.readOnly == false) {
sample6_postcode.style.backgroundColor = '#ffffff'
}
$('#sample6_address').attr('readonly', false);
if(sample6_address.readOnly == false) {
sample6_address.style.backgroundColor = '#ffffff'
}
$('#sample6_detailAddress').attr('readonly', false);
if(sample6_detailAddress.readOnly == false) {
sample6_detailAddress.style.backgroundColor = '#ffffff'
}
$('#sample6_extraAddress').attr('readonly', false);
if(sample6_extraAddress.readOnly == false) {
sample6_extraAddress.style.backgroundColor = '#ffffff'
}
$('#snsgit').attr('readonly', false);
if(snsgit.readOnly == false) {
snsgit.style.backgroundColor = '#ffffff'
}
$('#snsinsta').attr('readonly', false);
if(snsinsta.readOnly == false) {
snsinsta.style.backgroundColor = '#ffffff'
}
$('#mpupdate_btn').click(function(){
$('#pwd').attr('readonly', true);
$('#uname').attr('readonly', true);
$('#phone').attr('readonly', true);
$('#email').attr('readonly', true);
$('#gender').attr('readonly', true);
$('#birth').attr('readonly', true);
$('#sample6_postcode').attr('readonly', true);
$('#sample6_address').attr('readonly', true);
$('#sample6_detailAddress').attr('readonly', true);
$('#sample6_extraAddress').attr('readonly', true);
$('#snsgit').attr('readonly', true);
$('#snsinsta').attr('readonly', true);
$('#mypage_update_form').attr(
{
'action':'[[@{/user/mypageupdate}]]',
'method':'post'
}
);
$('#mypage_update_form').submit();
});
});
$('#deleteuser_btn').click(function(){
modal();
$('#deleteuserok').click(function(){
$('#mypage_update_form').attr(
{
'action':'[[@{/user/deleteuser}]]',
'method':'post'
}
);
$('#mypage_update_form').submit();
});
});
});
</script>
</head>
<!-- Home -->
<div class="home">
<div class="breadcrumbs_container">
<div class="container">
<div class="row">
<div class="col">
<div class="breadcrumbs">
<ul>
<li><a th:href="@{/}">홈</a></li>
<li>마이페이지</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Contact -->
<div class="contact">
<!-- Contact Info -->
<div class="contact_info_container">
<div class="container">
<div class="row">
<!-- Courses Sidebar -->
<div class="col-lg-4">
<div class="sidebar">
<a th:href="@{/user/mypage(userid = ${session.loginuser.userid})}"><div class="contact_info_title">마이페이지</div></a>
<!-- Latest Course -->
<!-- <div class="sidebar_section">
<div style="margin-top: 50px;" th:if="${ms != null}"
class="sidebar_section_title">Mentoring Register</div>
<div class="sidebar_latest">
Latest Course
<div
class="latest d-flex flex-row align-items-start justify-content-start">
</div>
</div>
</div> -->
<div> </div>
<div> </div>
<div class="sidebar_section">
<div class="sidebar_section_title"></div>
<div class="sidebar_categories">
<ul id="ul" style="text-align: center">
<li id="li">
<a th:if="${ms == null}" th:onclick="|location.href='@{/mentor/mentorregister(id=${us.userid})}'|">멘토 등록</a>
</li>
<li id="li">
<a th:if="${ms != null}" th:onclick="|location.href='@{/mentor/idcheck(mentorid=${ms.mentorid})}'|">멘토 정보</a>
</li>
<li id="li">
<a th:if="${ms != null}" th:onclick="|location.href='@{/mentor/mentormodify(id=${us.userid},mentorid=${ms.mentorid})}'|">멘토 정보 수정</a>
</li>
<li id="li">
<a th:onclick="|location.href='@{/purchase/purchasedetail(id=${us.userid})}'|">구매 이력</a>
</li>
<li id="li">
<a th:onclick="|location.href='@{/mentoring/mymentoringdetail(id=${us.userid})}'|">멘토링 이력</a>
</li>
<li id="li">
<a th:if="${ms != null and ms.mentorok == 1}" th:onclick="|location.href='@{/mentor/mentoringadmin(id=${us.userid},mentorid=${ms.mentorid})}'|">멘토링 관리</a>
</li>
<li id="li">
<a th:onclick="|location.href='@{/coupon/mycoupon(id=${us.userid})}'|">내 쿠폰함</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Contact Form -->
<div class="col-lg-8">
<div class="contact_form">
<!-- <div class="contact_info_title">My Page</div> -->
<div class="form_title" style="font-weight:bold;margin-top:20px;">
<i class="fa-solid fa-chevron-right"></i>
 SNS를 통해 로그인하신 고객님은 정보를 추가로 입력해주세요.
</div>
<!-- <button type="button" th:onclick="|location.href='@{/mentor/mentorregister(id=${us.userid})}'|" class="comment_button trans_200" style="width:80px;height:30px">멘토 등록</button>
<button type="button" th:if="${ms != null}" th:onclick="|location.href='@{/mentor/mentormodify(id=${us.userid},mentorid=${ms.mentorid})}'|" class="comment_button trans_200" style="width:110px;height:30px">멘토 정보 수정</button>
<button type="button" th:onclick="|location.href='@{/purchase/purchasedetail(id=${us.userid})}'|" class="comment_button trans_200" style="width:80px;height:30px">구매이력</button>
<button type="button" th:onclick="|location.href='@{/mentoring/mymentoringdetail(id=${us.userid})}'|" class="comment_button trans_200" style="width:80px;height:30px">멘토링이력</button>
<button type="button" th:if="${ms != null}" th:onclick="|location.href='@{/mentor/mentoringadmin(mentorid=${ms.mentorid})}'|" class="comment_button trans_200" style="width:110px;height:30px">멘토링 관리</button>
<button type="button" th:onclick="|location.href='@{/coupon/mycoupon(id=${us.userid})}'|" class="comment_button trans_200" style="width:80px;height:30px">내 쿠폰함</button> -->
<form id = "mypage_update_form" class="comment_form">
<!-- <div>
<label class="form_title">
<div>
<img id="uploadprofile" th:src="@{/img/}+${m.mentorimg}" style="width:200px;">
</div>
<label id="pubutton" class="btn btn-dark" for="mpimg" style="width:110px;height:35px;font-size:15px;">프로필 수정</label>
</label>
<input type="file" style="display:none" name="mpimg" id="mpimg" th:onchange="previewprofile(event);">
</div> -->
<div>
<label for = "id" class="form_title">ID</label>
<input type="text" class="userid comment_input" id = "id" th:value = "${us.userid}" readonly = "readonly" name = "userid">
</div>
<div>
<label for = "pwd" class="form_title">비밀번호</label>
<input type="Password" class="userid comment_input" id = "pwd" th:value = "${us.userpwd}" name = "userpwd" readonly>
</div>
<div>
<label for = "uname" class="form_title">이름</label>
<input type="text" class="userid comment_input" id = "uname" th:value = "${us.username}" name = "username" readonly>
</div>
<div>
<label for = "phone" class="form_title">핸드폰 번호 (예: 010-0000-0000)</label>
<input type="text" class="userid comment_input" id = "phone" th:value = "${us.usertel}" name = "usertel" readonly>
</div>
<div>
<label for = "email" class="form_title">이메일</label>
<input type="text" class="userid comment_input" id = "email" th:value = "${us.useremail}" name = "useremail" readonly>
</div>
<div>
<label for = "gender" class="form_title">성별 (예: 남 or 여)</label>
<input type="text" class="userid comment_input" id = "gender" th:value = "${us.usergen}" name = "usergen" readonly>
</div>
<div>
<label for = "address" class="address_form">주소</label>
<input type="text" class="userid comment_input_postno" name = "addrnum" th:value = "${us.addrnum}" id="sample6_postcode" placeholder="우편번호" readonly>
<input type="button" class="comment_button_post trans_200" onclick="sample6_execDaumPostcode()" value="우편번호 찾기"><br>
<input type="text" class="userid comment_input_address" name = "useraddr" th:value = "${us.useraddr}" id="sample6_address" placeholder="주소" readonly><br>
<input type="text" class="userid comment_input_detail" name = "addrdetail" th:value = "${us.addrdetail}" id="sample6_detailAddress" placeholder="상세주소" readonly>
<input type="text" class="userid comment_input_detail" name = "addrextra" th:value = "${us.addrextra}" id="sample6_extraAddress" placeholder="참고항목" readonly>
</div>
<div>
<label for = "birth" class="form_title">생년월일 (예: 1994-11-08)</label>
<input type="text" class="userid comment_input" id = "birth" th:value = "${us.userbirth}" name = "userbirth" readonly>
</div>
<div>
<label for = "point" class="form_title">포인트</label>
<input type="text" class="userid comment_input" id = "point" th:value = "${us.userpoint}" name = "userpoint" readonly>
</div>
<div>
<label for = "snsgit" class="form_title">Github 주소</label>
<input type="text" class="userid comment_input" id = "snsgit" th:value = "${us.snsgit}" name = "snsgit" readonly>
</div>
<div>
<label for = "snsinsta" class="form_title">Instagram 주소</label>
<input type="text" class="userid comment_input" id = "snsinsta" th:value = "${us.snsinsta}" name = "snsinsta" readonly>
</div>
</form>
</div>
<button type='button' id = "mpupdate_btn" data-toggle="modal" data-target="#updatemodal" onclick = "changetext()" class="comment_button trans_200">회원 정보 수정</button>
<button type='button' id = "deleteuser_btn" class="comment_button trans_200">회원 탈퇴</button>
</div>
<!-- Contact Info -->
<!-- <div class="col-lg-4">
<div class="contact_info">
<div class="contact_info_title">Contact Info</div>
<div class="contact_info_text">
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a distribution of letters.</p>
</div>
<div class="contact_info_location">
<div class="contact_info_location_title">New York Office</div>
<ul class="location_list">
<li>T8/480 Collins St, Melbourne VIC 3000, New York</li>
<li>1-234-567-89011</li>
<li>info.deercreative@gmail.com</li>
</ul>
</div>
<div class="contact_info_location">
<div class="contact_info_location_title">Australia Office</div>
<ul class="location_list">
<li>Forrest Ray, 191-103 Integer Rd, Corona Australia</li>
<li>1-234-567-89011</li>
<li>info.deercreative@gmail.com</li>
</ul>
</div>
</div>
</div> -->
</div>
</div>
</div>
</div>
<!-- Update Modal -->
<div class="modal fade" id="updatemodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">변경하고 싶은 정보를 변경 후 [회원 정보 저장] 을 눌러주세요~</div>
<div class="modal-body-btn"><button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button></div>
</div>
</div>
</div>
<!-- Delete Modal -->
<div class="modal fade" id="deletemodal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">탈퇴하시면 동일한 ID로는 재가입 하실 수 없습니다.</div>
<div class="modal-body-btn">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id = "deleteuserok" class="btn btn-secondary" data-dismiss="modal">YES</button>
</div>
</div>
</div>
</div>
</div>