Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최시원
/
Singer-Composer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
choi
2021-11-17 14:56:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0cd2999275935ca2a3bf891bacf4a19d16c733f4
0cd29992
1 parent
14f02619
Add the bulletin reading function
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
3 deletions
public/main.html
readme.md
router/board/index.js
views/read.ejs
public/main.html
View file @
0cd2999
...
...
@@ -86,6 +86,13 @@
</div>
<div
class=
"col-lg-4"
>
<div
class=
"features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3"
>
<div
class=
"features-icons-icon d-flex"
><i
class=
"bi-window m-auto text-primary"
></i></div>
<h3>
Fully Responsive
</h3>
<p
class=
"lead mb-0"
>
This theme will look great on any device, no matter the size!
</p>
</div>
</div>
<div
class=
"col-lg-4"
>
<div
class=
"features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3"
>
<div
class=
"features-icons-icon d-flex"
><i
class=
"bi-layers m-auto text-primary"
></i></div>
<h3>
Bootstrap 5 Ready
</h3>
<p
class=
"lead mb-0"
>
Featuring the latest build of the new Bootstrap 5 framework!
</p>
...
...
readme.md
View file @
0cd2999
...
...
@@ -15,14 +15,19 @@
sql 사용 파일
<br>
router/login/index.js
<br>
router/register/index.js
<br><br>
router/register/index.js
<br>
router/board/index.js
<br><br>
DB 구조(
*
ID, password, type) -> 형식에 맞게 추가
<br>
*
ID varchar(20), password varchar(20), type varchar(10) // type이 운영자인 경우 서버에서 변경
<br>
추가된 형식에 맞는 로그인 및 세션 등 변경
<br>
DB구조 - board에서 사용됨(
*
idx, name, title, content, regdate, modidate, passwd, hit)
<br>
*
idx int, name varchar(50), title varchar(50), content mediumtext, regdate datetime, modidate datetime, passwd varchar(50), hit int
<br>
LF 오류시 git config --global core.autocrlf true 입력
<br><br>
최종 수정: 2021-11-16 18:54
<br>
최종 수정 내용: 경로 지정 수정
\ No newline at end of file
최종 수정: 2021-11-17 06:01
<br>
최종 수정 내용: 게시판의 글쓰기 및 글 열람 기능 추가.
\ No newline at end of file
...
...
router/board/index.js
View file @
0cd2999
...
...
@@ -42,4 +42,14 @@ router.post('/write', function(req,res,next){
});
})
router
.
get
(
'/read/:idx'
,
function
(
req
,
res
,
next
){
var
idx
=
req
.
params
.
idx
var
sql
=
"select idx, name, title, content, date_format(modidate,'%Y-%m-%d %H:%i:%s') modidate, "
+
"date_format(regdate,'%Y-%m-%d %H:%i:%s') regdate,hit from board where idx=?"
;
board
.
query
(
sql
,[
idx
],
function
(
err
,
row
){
if
(
err
)
console
.
error
(
err
)
res
.
render
(
'read.ejs'
,
{
title
:
"글 상세"
,
row
:
row
[
0
]})
})
})
module
.
exports
=
router
;
\ No newline at end of file
...
...
views/read.ejs
0 → 100644
View file @
0cd2999
<!DOCTYPE html>
<html>
<head>
<title>
<
%= title %>
</title>
<link
rel=
'stylesheet'
href=
'/stylesheets/style.css'
/>
</head>
<body>
<h1>
<
%= title %>
</h1>
<form
action=
"/board/update"
method=
"post"
>
<table
border=
"1"
>
<input
type=
"hidden"
name=
"idx"
value=
"<%=row.idx%>"
/>
<tr>
<td>
작성자
</td>
<td><input
type=
"text"
name=
"name"
id=
"name"
value=
"<%=row.name%>"
required
/></td>
</tr>
<tr>
<td>
제목
</td>
<td><input
type=
"text"
name=
"title"
id=
"title"
value=
"<%=row.title%>"
required
/></td>
</tr>
<tr>
<td>
내용
</td>
<td><textarea
name=
"content"
id=
"content"
cols=
"30"
rows=
"10"
required
>
<
%=row.content%>
</textarea></td>
</tr>
<tr>
<td>
패스워드
</td>
<td><input
type=
"password"
name=
"passwd"
id=
"passwd"
required
/></td>
</tr>
<tr>
<td>
변경일
</td>
<td>
<
%=row.modidate%>
</td>
</tr>
<tr>
<td>
등록일
</td>
<td>
<
%=row.regdate%>
</td>
</tr>
<tr>
<td>
조회수
</td>
<td>
<
%=row.hit%>
</td>
</tr>
<tr>
<td
colspan=
"2"
>
<button
type=
"submit"
>
글 수정
</button>
<a
href=
"/board/list"
>
목록
</a>
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file
Please
register
or
login
to post a comment