-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcyber_user_write.html
More file actions
262 lines (222 loc) · 7.92 KB
/
cyber_user_write.html
File metadata and controls
262 lines (222 loc) · 7.92 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
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
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="#">
<title>우리 마을 변호사</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Black+Han+Sans&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Jua&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Do+Hyeon&display=swap" rel="stylesheet">
<style>
#logo {
align-items: center;
display: block;
}
a:link {
color: darkgray;
text-decoration: none;
}
a:visited {
color: darkgray;
text-decoration: none;
}
#menubar {
background: rgb(163, 213, 201);
}
#menubar ul {
margin: 0;
padding: 3;
width: 95%;
}
#menubar ul li {
display: inline-block;
list-style-type: none;
padding: 6px 20px;
}
#menubar ul li a {
color: rgb(68, 68, 68);
text-decoration: none;
font-family: 'Black Han Sans', sans-serif;
font-size: 125%;
}
#menubar ul li a:hover {
color: rgb(242, 146, 72)
}
label {
/* To make sure that all label have the same size and are properly align */
display: inline-block;
width: 100px;
text-align: right;
}
#writing {
font-family: 'Do Hyeon', sans-serif;
/* Just to center the form on the page */
margin: 0 auto;
width: 100%;
height: 30%;
/* To see the outline of the form */
padding: 1em;
text-align: center;
}
#btn {
background-color: azure;
text-align: center;
font-family: 'Do Hyeon', sans-serif;
font-size: 20px;
}
textarea {
width: 50%;
height: 300px;
line-height: normal;
/* line-height 초기화 */
padding: .8em .5em;
/* 여백 설정 */
}
#menubar li.user {
float: right;
margin-left: -1px;
z-index: 1;
}
</style>
<script>
var getParameter = function (param) {
var returnValue;
var url = location.href;
var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');
for (var i = 0; i < parameters.length; i++) {
var varName = parameters[i].split('=')[0];
if (varName.toUpperCase() == param.toUpperCase()) {
returnValue = parameters[i].split('=')[1];
return decodeURIComponent(returnValue);
}
}
}
</script>
</head>
<body>
<header>
<div>
<a id="logo" href="#none" onclick="move_home()">
<center><img src="img/main_logo.png" width="600" height="200"></center>
</a>
</div>
<br><br><br>
<nav id="menubar">
<ul>
<!-- 변호사 검색 버튼 -->
<li><a href="#none" onclick="move_search()">변호사 검색 & 상담 예약 신청</a></li>
<!-- 사이버법률상담 버튼 -->
<li><a href="#none" onclick="move_cyber()" style="color: rgb(242, 146, 72);">사이버법률상담</a></li>
<!-- 이용 안내 버튼 -->
<li><a href="#none" onclick="move_howtouse()">이용 안내</a></li>
<li><a href="#none" onclick="move_blog()">마을변호사 소식</a></li>
<li><a href="#none" onclick="move_qna()">자주묻는 질문</a></li>
<li class="user"><a href="./home.html">로그아웃</a></li>
<li class="user"><a id="user_name">땡땡땡</a></li>
</ul>
</nav>
<br>
</header>
<section id="writing">
<div>
상담자 이름 :
<a id="writer_name" name="writer_name"></a>
</div>
<br>
<div>
<label for="title">제목: </label>
<input type="text" id="title" name="title" autofocus />
</div>
<br>
<div>
<h3>[ 사이버 법률 상담 신청 글 작성 ]</h3>
<h3 id="today">현재 날짜</h3>
<textarea id="msg" name="msg"></textarea>
</div>
<br>
<div>
<button id="btn" onclick="save_local()">법률 상담 신청</button>
</div>
</section>
<script>
function change_name(name) {
var user = document.getElementById("user_name");
user.innerText = name + " 님";
var user2 = document.getElementById("writer_name");
user2.innerText = name;
}
var name = getParameter('index');
console.log('name : ' + name);
change_name(name);
var today = document.getElementById("today");
var offset = new Date().getTimezoneOffset() * 60000;
var date_today = new Date(Date.now() - offset).toISOString().slice(0, 10);
console.log('today : ' + date_today);
today.innerText = "신청 날짜 : " + date_today;
var number;
if (localStorage.getItem('count') == null) {
number = 0;
localStorage.setItem('count', 0);
}
else {
number = localStorage.getItem('count');
}
// console.log("number : " + number);
function save_local() {
number++; //현재 데이터 번호
var num = number;
var name = getParameter('index');
var title = document.getElementById('title').value;
var msg = document.getElementById('msg').value;
var ans = "답변대기";
var date = date_today;
//local storage key 값
var str_num = "num" + number;
var str_name = "name" + number;
var str_title = "title" + number;
var str_msg = "msg" + number;
var str_ans = "ans" + number;
var str_date = "date" + number;
console.log(str_name + " " + name);
console.log(str_title + " " + title);
console.log(str_msg + " " + msg);
localStorage.setItem(str_num, num);
localStorage.setItem(str_ans, ans);
localStorage.setItem(str_name, name);
localStorage.setItem(str_title, title);
localStorage.setItem(str_msg, msg);
localStorage.setItem(str_date, date);
localStorage.setItem('count', number);
// location.href="local_test.html";
alert("사이버 상담 신청 완료!");
move_cyber();
}
function move_search() {
var name = getParameter('index');
window.location.href = "lawyer_search.html?index=" + name;
}
function move_cyber() {
var name = getParameter('index');
window.location.href = "cyber_qa_user.html?index=" + name;
}
function move_home() {
var name = getParameter('index');
window.location.href = "user_home.html?index=" + name;
}
function move_blog() {
var name = getParameter('index');
window.location.href = "blog_user.html?index=" + name;
}
function move_howtouse() {
var name = getParameter('index');
window.location.href = "howtouse_user.html?index=" + name;
}
function move_qna() {
var name = getParameter('index');
window.location.href = "qna_user.html?index=" + name;
}
</script>
</body>
</html>