Mukho

Divide board

1 module.exports=(function(){ 1 module.exports=(function(){
2 return{ 2 return{
3 - board:{ 3 + notice_board:{
4 + host:'localhost',
5 + port:3306,
6 + user:'root',
7 + password:'',
8 + database:'singer_composer'
9 + },
10 + composer_board:{
11 + host:'localhost',
12 + port:3306,
13 + user:'root',
14 + password:'',
15 + database:'singer_composer'
16 + },
17 + singer_board:{
18 + host:'localhost',
19 + port:3306,
20 + user:'root',
21 + password:'',
22 + database:'singer_composer'
23 + },
24 + free_board:{
25 + host:'localhost',
26 + port:3306,
27 + user:'root',
28 + password:'',
29 + database:'singer_composer'
30 + },
31 + suggestion_board:{
4 host:'localhost', 32 host:'localhost',
5 port:3306, 33 port:3306,
6 user:'root', 34 user:'root',
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
...@@ -32,6 +32,24 @@ ...@@ -32,6 +32,24 @@
32 </div> 32 </div>
33 </div> 33 </div>
34 </nav> 34 </nav>
35 + <div class ="wrap">
36 + <div class="list_board">
37 + <a class="board_btn" href="/board/list/notice">
38 + 공지사항
39 + </a>
40 + <a class="board_btn" href="/board/list/composer">
41 + 작곡가 구인
42 + </a>
43 + <a class="board_btn" href="/board/list/singer">
44 + 가수 구인
45 + </a>
46 + <a class="board_btn" href="/board/list/free">
47 + 자유게시판
48 + </a>
49 + <a class="board_btn" href="/board/list/suggestion">
50 + 건의사항
51 + </a>
52 + </div>
35 <!-- Footer--> 53 <!-- Footer-->
36 <footer class="footer bg-light"> 54 <footer class="footer bg-light">
37 <div class="container"> 55 <div class="container">
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 21 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
22 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 22 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
23 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 23 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
24 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 24 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
25 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li> 25 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
26 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 26 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
27 </ul> 27 </ul>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href="/chat" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -36,7 +36,7 @@ create table userdb( ...@@ -36,7 +36,7 @@ create table userdb(
36 profilepic varchar(300) unique 36 profilepic varchar(300) unique
37 )engine=innodb; 37 )engine=innodb;
38 38
39 -create table board( 39 +create table _board(
40 idx int not null primary key auto_increment, 40 idx int not null primary key auto_increment,
41 nickname varchar(50) not null, 41 nickname varchar(50) not null,
42 title varchar(50) not null, 42 title varchar(50) not null,
...@@ -47,13 +47,13 @@ create table board( ...@@ -47,13 +47,13 @@ create table board(
47 ID varchar(20) not null 47 ID varchar(20) not null
48 )engine=innodb; 48 )engine=innodb;
49 49
50 -create table comment( 50 +create table _comment(
51 idx int auto_increment primary key, 51 idx int auto_increment primary key,
52 ID varchar(20) not null, 52 ID varchar(20) not null,
53 nickname varchar(50) not null, 53 nickname varchar(50) not null,
54 comment mediumtext not null, 54 comment mediumtext not null,
55 bulletin_id int not null, 55 bulletin_id int not null,
56 - foreign key (bulletin_id) references board(idx) on delete cascade 56 + foreign key (bulletin_id) references _board(idx) on delete cascade
57 )engine=innodb; 57 )engine=innodb;
58 ``` 58 ```
59 59
...@@ -69,8 +69,15 @@ create table comment( ...@@ -69,8 +69,15 @@ create table comment(
69 >SET @COUNT = 0;<br> 69 >SET @COUNT = 0;<br>
70 >UPDATE board SET idx = @COUNT:=@COUNT+1; 70 >UPDATE board SET idx = @COUNT:=@COUNT+1;
71 71
72 +- 게시판 추가 DB 이름(댓글은 board 대신 comment)
73 +>공지사항: notice_board
74 +>작곡가 구인: composer_board
75 +>가수 구인: singer_board
76 +>자유게시판: free_board
77 +>건의사항: suggestion_board
78 +
72 --- 79 ---
73 -### 최종 수정: 2021-11-29 19:47<br> 80 +### 최종 수정: 2021-12-01 01:22<br>
74 ### 수정 내용: 81 ### 수정 내용:
75 1. 채팅 구현(팝업) 82 1. 채팅 구현(팝업)
76 2. 시간 실시간 반영 83 2. 시간 실시간 반영
...@@ -82,4 +89,5 @@ create table comment( ...@@ -82,4 +89,5 @@ create table comment(
82 8. 버그 수정 89 8. 버그 수정
83 9. 댓글 등록, 열람, 삭제 기능 구현 및 버그 픽스 90 9. 댓글 등록, 열람, 삭제 기능 구현 및 버그 픽스
84 10. 채팅 중 서버 재시작시 기존 참여자들 리셋시킴 91 10. 채팅 중 서버 재시작시 기존 참여자들 리셋시킴
85 -11. 요소 좌우 길이 80%로 조절
...\ No newline at end of file ...\ No newline at end of file
92 +11. 요소 좌우 길이 80%로 조절
93 +12. 게시판 [공지사항/작곡가 구인/가수 구인/자유게시판/건의사항]으로 분화
...\ No newline at end of file ...\ No newline at end of file
......
This diff is collapsed. Click to expand it.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> 5 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6 <meta name="description" content="" /> 6 <meta name="description" content="" />
7 <meta name="author" content="" /> 7 <meta name="author" content="" />
8 - <title>묵호 - 게시판</title> 8 + <title>묵호 - <%= title %></title>
9 <!-- Favicon--> 9 <!-- Favicon-->
10 <link rel="icon" type="image/x-icon" href="../assets/favicon.ico" /> 10 <link rel="icon" type="image/x-icon" href="../assets/favicon.ico" />
11 <!-- Bootstrap icons--> 11 <!-- Bootstrap icons-->
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 23 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
24 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 24 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
25 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 25 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
26 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 26 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
27 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 27 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
28 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 28 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
29 </ul> 29 </ul>
...@@ -35,25 +35,49 @@ ...@@ -35,25 +35,49 @@
35 </nav> 35 </nav>
36 <div class ="wrap"> 36 <div class ="wrap">
37 <div class="list_board"> 37 <div class="list_board">
38 - <a class="board_btn" href="/board/list"> 38 + <a class="board_btn" href="/board/list/notice">
39 공지사항 39 공지사항
40 </a> 40 </a>
41 - <a class="board_btn" href="/board/list"> 41 + <a class="board_btn" href="/board/list/composer">
42 작곡가 구인 42 작곡가 구인
43 </a> 43 </a>
44 - <a class="board_btn" href="/board/list"> 44 + <a class="board_btn" href="/board/list/singer">
45 가수 구인 45 가수 구인
46 </a> 46 </a>
47 - <a class="board_btn" href="/board/list"> 47 + <a class="board_btn" href="/board/list/free">
48 자유게시판 48 자유게시판
49 </a> 49 </a>
50 - <a class="board_btn" href="/board/list"> 50 + <a class="board_btn" href="/board/list/suggestion">
51 건의사항 51 건의사항
52 </a> 52 </a>
53 </div> 53 </div>
54 54
55 <div class="container px-5 my-5"> 55 <div class="container px-5 my-5">
56 <h1><%= title %></h1> 56 <h1><%= title %></h1>
57 + <%
58 + var addr;
59 + %>
60 + <%
61 + switch(title){
62 + case '공지사항':
63 + addr = 'notice';
64 + break;
65 + case '작곡가 구인':
66 + addr = 'composer';
67 + break;
68 + case '가수 구인':
69 + addr = 'singer';
70 + break;
71 + case '자유게시판':
72 + addr = 'free';
73 + break;
74 + case '건의사항':
75 + addr = 'suggestion';
76 + break;
77 + %>
78 + <%
79 + }
80 + %>
57 <table border="1"> 81 <table border="1">
58 <tr> 82 <tr>
59 <td>번호</td> 83 <td>번호</td>
...@@ -73,7 +97,7 @@ ...@@ -73,7 +97,7 @@
73 <tr> 97 <tr>
74 <td><%=data.idx%></td> 98 <td><%=data.idx%></td>
75 <td><%=data.nickname%></td> 99 <td><%=data.nickname%></td>
76 - <td><a href="/board/read/<%=data.idx%>"><%=data.title%></a></td> 100 + <td><a href="/board/read/<%=addr%>/<%=data.idx%>"><%=data.title%></a></td>
77 <td><%=data.hit%></td> 101 <td><%=data.hit%></td>
78 <td><%=data.modidate%></td> 102 <td><%=data.modidate%></td>
79 <td><%=data.regdate%></td> 103 <td><%=data.regdate%></td>
...@@ -84,10 +108,9 @@ ...@@ -84,10 +108,9 @@
84 <tr> 108 <tr>
85 <td colspan="6"> 109 <td colspan="6">
86 <% 110 <%
87 -
88 for(var j = 0; j < rows.length/page_num ; j++){ 111 for(var j = 0; j < rows.length/page_num ; j++){
89 %> 112 %>
90 - [<a href="/board/list/<%= j + 1 %>"><%= j+1 %></a>] 113 + [<a href="/board/<%=addr%>/list/<%= j + 1 %>"><%= j+1 %></a>]
91 <% 114 <%
92 } 115 }
93 %> 116 %>
...@@ -95,7 +118,7 @@ ...@@ -95,7 +118,7 @@
95 </tr> 118 </tr>
96 </table> 119 </table>
97 <nav class="navbar"> 120 <nav class="navbar">
98 - <a class="btn btn-outline-primary me-2" href="/board/write">글쓰기</a> 121 + <a class="btn btn-outline-primary me-2" href="/board/write/<%=addr%>">글쓰기</a>
99 </nav> 122 </nav>
100 </div> 123 </div>
101 </div> 124 </div>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 21 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
22 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 22 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
23 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 23 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
24 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 24 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
25 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 25 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
26 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 26 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
27 </ul> 27 </ul>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
19 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 19 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
20 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 20 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
21 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 21 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
22 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 22 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
23 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 23 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
24 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 24 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
25 </ul> 25 </ul>
...@@ -29,16 +29,40 @@ ...@@ -29,16 +29,40 @@
29 </div> 29 </div>
30 </div> 30 </div>
31 </nav> 31 </nav>
32 + <%
33 + var addr;
34 + %>
32 <div class="container px-5 my-5"> 35 <div class="container px-5 my-5">
33 <h1><%= title %></h1> 36 <h1><%= title %></h1>
37 + <%
38 + switch(title){
39 + case '공지사항 글 상세':
40 + addr = 'notice';
41 + break;
42 + case '작곡가 구인 글 상세':
43 + addr = 'composer';
44 + break;
45 + case '가수 구인 글 상세':
46 + addr = 'singer';
47 + break;
48 + case '자유게시판 글 상세':
49 + addr = 'free';
50 + break;
51 + case '건의사항 글 상세':
52 + addr = 'suggestion';
53 + break;
54 + %>
55 + <%
56 + }
57 + %>
34 <script> 58 <script>
35 function submit2(frm){ 59 function submit2(frm){
36 - frm.action="/board/delete"; 60 + frm.action="/board/delete/<%=addr%>";
37 frm.submit(); 61 frm.submit();
38 return true; 62 return true;
39 } 63 }
40 </script> 64 </script>
41 - <form action="/board/update" method="post"> 65 + <form action="/board/update/<%=addr%>" method="post">
42 <table border="1"> 66 <table border="1">
43 <input type="hidden" name="idx" value="<%=row.idx%>"/> 67 <input type="hidden" name="idx" value="<%=row.idx%>"/>
44 <tr> 68 <tr>
...@@ -69,7 +93,7 @@ ...@@ -69,7 +93,7 @@
69 <td colspan="3"> 93 <td colspan="3">
70 <button type="submit">글 수정</button> 94 <button type="submit">글 수정</button>
71 <button type="summit" onclick="return submit2(this.form);">글 삭제</button> 95 <button type="summit" onclick="return submit2(this.form);">글 삭제</button>
72 - <a href="/board/list"> 96 + <a href="/board/<%=addr%>/list">
73 <input type="button" value="목록"> 97 <input type="button" value="목록">
74 </a> 98 </a>
75 </td> 99 </td>
...@@ -81,7 +105,7 @@ ...@@ -81,7 +105,7 @@
81 <h1>댓글</h1> 105 <h1>댓글</h1>
82 <script> 106 <script>
83 function submit3(frm){ 107 function submit3(frm){
84 - frm.action="/board/read/commentdelete"; 108 + frm.action="/board/read/<%=addr%>/commentdelete";
85 frm.submit(); 109 frm.submit();
86 return true; 110 return true;
87 } 111 }
...@@ -89,12 +113,12 @@ ...@@ -89,12 +113,12 @@
89 113
90 } 114 }
91 </script> 115 </script>
92 - <form action="/board/read/commentwrite" method="post"> 116 + <form action="/board/read/<%=addr%>/commentwrite" method="post">
93 <table border="1"> 117 <table border="1">
94 <input type="hidden" name="idx" value="<%=row.idx%>"/> 118 <input type="hidden" name="idx" value="<%=row.idx%>"/>
95 <tr> 119 <tr>
96 <td>닉네임</td> 120 <td>닉네임</td>
97 - <td>댓글</td> 121 + <td>내용</td>
98 </tr> 122 </tr>
99 <% 123 <%
100 for(var i=0; i<comment_length; i++){ 124 for(var i=0; i<comment_length; i++){
...@@ -115,7 +139,7 @@ ...@@ -115,7 +139,7 @@
115 } 139 }
116 %> 140 %>
117 <tr> 141 <tr>
118 - <td><%=usernick%></td> 142 + <td><%=nickname%></td>
119 <td><textarea name="comment" id="comment" cols="30" rows="2" required></textarea></td> 143 <td><textarea name="comment" id="comment" cols="30" rows="2" required></textarea></td>
120 <td colspan="2"> 144 <td colspan="2">
121 <button type="submit">댓글 쓰기</button> 145 <button type="submit">댓글 쓰기</button>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 22 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 23 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 24 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
25 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 25 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 26 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 27 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
28 </ul> 28 </ul>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 <a class="navbar-brand" href="/main">묵호의 놀이터</a> 18 <a class="navbar-brand" href="/main">묵호의 놀이터</a>
19 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0"> 19 <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
20 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li> 20 <li><a href="/about" class="nav-link px-2 link-dark">About</a></li>
21 - <li><a href="/board/list" class="nav-link px-2 link-dark">게시판</a></li> 21 + <li><a href="/board" class="nav-link px-2 link-dark">게시판</a></li>
22 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li> 22 <li><a href = "javascript:;" onclick = "window.open('/chat','파일 업로드','width=500, height=801, toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no');" class="nav-link px-2 link-dark">채팅</a></li>
23 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li> 23 <li><a href="http://khuhub.khu.ac.kr/2017104034/Singer-Composer" target="_blank" class="nav-link px-2 link-dark">사이트 git</a></li>
24 </ul> 24 </ul>
...@@ -28,9 +28,33 @@ ...@@ -28,9 +28,33 @@
28 </div> 28 </div>
29 </div> 29 </div>
30 </nav> 30 </nav>
31 + <%
32 + var addr;
33 + %>
31 <div class="container px-5 my-5"> 34 <div class="container px-5 my-5">
32 <h1><%= title %></h1> 35 <h1><%= title %></h1>
33 - <form action="/board/write" method="post"> 36 + <%
37 + switch(title){
38 + case '공지사항 글 쓰기':
39 + addr = 'notice';
40 + break;
41 + case '작곡가 구인 글 쓰기':
42 + addr = 'composer';
43 + break;
44 + case '가수 구인 글 쓰기':
45 + addr = 'singer';
46 + break;
47 + case '자유게시판 글 쓰기':
48 + addr = 'free';
49 + break;
50 + case '건의사항 글 쓰기':
51 + addr = 'suggestion';
52 + break;
53 + %>
54 + <%
55 + }
56 + %>
57 + <form action="/board/write/<%=addr%>" method="post">
34 58
35 <table border="1"> 59 <table border="1">
36 <tr> 60 <tr>
......