Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정지윤
/
project_opensource
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
정지윤
2017-12-05 15:48:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c099e225e3ccccbd52132c81c579804c40d443f1
c099e225
1 parent
7828c3bb
결제 모듈 추가
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
49 deletions
routes/index.js
routes/mail.js
views/first.ejs
views/menu.ejs
views/pay.ejs
views/reservation.ejs
routes/index.js
View file @
c099e22
...
...
@@ -9,21 +9,16 @@ var bodyParser = require('body-parser');
var
router
=
express
.
Router
();
// configuration ===============================================================
router
.
get
(
'/reservation'
,
function
(
req
,
res
){
res
.
render
(
'reservation'
,{
title
:
"첫번째 화면~"
});
})
router
.
get
(
'/first'
,
function
(
req
,
res
){
res
.
render
(
'first'
,{
title
:
"첫번째 화면
~
"
});
res
.
render
(
'first'
,{
title
:
"첫번째 화면"
});
})
router
.
get
(
'/'
,
function
(
req
,
res
){
res
.
render
(
'index'
,{
title
:
"첫화면"
});
});
router
.
get
(
'/
list'
,
function
(
req
,
res
){
res
.
render
(
'
list'
,{
title
:
"게시판
"
});
router
.
get
(
'/
reservation'
,
function
(
req
,
res
){
res
.
render
(
'
reservation'
,{
title
:
"예약
"
});
});
...
...
@@ -54,49 +49,33 @@ router.post('/reservation',function(req, res){
router
.
get
(
'/resconfirm'
,
function
(
req
,
res
){
res
.
render
(
'resconfirm'
,{
title
:
"예약확인"
});
})
})
;
router
.
get
(
'/menu'
,
function
(
req
,
res
){
res
.
render
(
'menu'
,{
title
:
"메뉴판"
});
});
router
.
get
(
'/write2'
,
function
(
req
,
res
){
res
.
render
(
'write'
,{
title
:
"게시판"
});
res
.
redirect
(
'/'
);
connection
.
release
();
})
router
.
post
(
'/write2'
,
function
(
req
,
res
){
var
creater_id
=
req
.
body
.
creater_id
;
var
title
=
req
.
body
.
title
;
var
content
=
req
.
body
.
content
;
router
.
get
(
'/db'
,
function
(
req
,
res
){
pool
.
getConnection
(
function
(
err
,
connection
)
{
// Use the connection
var
sqlForInsertBoard
=
"insert into db2(creater_id, title, content) values('"
+
creater_id
+
"', '"
+
title
+
"', '"
+
content
+
"')"
;
connection
.
query
(
sqlForInsertBoard
,
function
(
err
,
rows
)
{
//var sqlForInsertBoard = "insert into menu(creater_id, phone, email, num, restime, resmin,date,food,content) values('"+creater_id+"', '"+phone+"', '"+email+"','"+num+"','"+restime+"','"+resmin+"','"+date+"','"+food+"','"+content+"')";
var
sqlForSelect
=
'SELECT * from menu'
connection
.
query
(
sqlForSelect
,
function
(
err
,
rows
)
{
if
(
err
)
console
.
error
(
"err : "
+
err
);
console
.
log
(
"rows : "
+
JSON
.
stringify
(
rows
));
res
.
re
direct
(
'/
'
);
res
.
re
nder
(
'first
'
);
connection
.
release
();
// Don't use the connection here, it has been returned to the pool.
});
});
})
router
.
get
(
'/persons'
,
function
(
req
,
res
){
connection
.
query
(
'SELECT * from Persons'
,
function
(
err
,
rows
)
{
if
(
err
)
throw
err
;
console
.
log
(
'The solution is: '
,
rows
);
res
.
send
(
rows
);
});
});
router
.
get
(
'/page'
,
function
(
req
,
res
){
connection
.
query
(
'SELECT * from db2'
,
function
(
err
,
rows
)
{
if
(
err
)
throw
err
;
console
.
log
(
'The solution is: '
,
rows
);
res
.
send
(
rows
);
});
/* GET home page. */
router
.
get
(
'/pay'
,
function
(
req
,
res
,
next
)
{
res
.
render
(
'pay'
,
{
title
:
'결제'
});
});
module
.
exports
=
router
;
...
...
routes/mail.js
View file @
c099e22
...
...
@@ -13,7 +13,7 @@ var smtpTransport = nodemailer.createTransport({
var
mailOptions
=
{
from
:
'정지윤 <violet3073@gmail.com>'
,
to
:
'
djkaiden
@naver.com'
,
to
:
'
jju0807
@naver.com'
,
subject
:
'예약 게시판 확인해주세요!'
,
text
:
'예약이 도착했습니다'
};
...
...
views/first.ejs
View file @
c099e22
...
...
@@ -38,6 +38,11 @@
<li
class=
"nav-item"
>
<a
class=
"nav-link js-scroll-trigger"
href=
"#about"
>
About
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link js-scroll-trigger"
href=
"#menu"
>
Menu
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link js-scroll-trigger"
href=
"#download"
>
Reservation
</a>
</li>
...
...
@@ -75,23 +80,40 @@
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-lg-8 mx-auto"
>
<h2>
About
GROTTO
</h2>
<h2>
About
별빛바다 달빛초원
</h2>
<p>
<a
href=
"http://startbootstrap.com/template-overviews/grayscale/"
>
Grotto - Let your senses fly
</a>
.
<br>
당신의 오감을 날려드립
니다.
</p>
<a
href=
"http://startbootstrap.com/template-overviews/grayscale/"
>
01
</a>
.
<br>
건강한 식재료와 제철 음식을 지향합
니다.
</p>
<p>
<a
href=
"http://gratisography.com/"
>
Coffee - Kona coffee
</a>
<br>
세계 3대 커피 하와이안 코나 원두를 사용합니다.
</p>
<a
href=
"http://gratisography.com/"
>
02
</a>
<br>
활어회/신선한 초밥/해산물 잔뜩 요리전문점
</p>
<p>
<a
href=
"http://snazzymaps.com/"
>
Wine - Wine expert
</a>
.
<br>
150가지 종류의 와인을 와인을 닮은 공간에서 편하게 즐기세요.
</p>
<a
href=
"http://snazzymaps.com/"
>
03
</a>
.
<br>
수원에서 가장 깔끔하고 싱싱한 횟집
</p>
</div>
</div>
</div>
</section>
<!-- Menu Section -->
<section
id=
"menu"
class=
" content-section text-center"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-lg-8 mx-auto"
>
<h2>
Menu
</h2>
<p>
별빛바다 달빛초원은 항상 싱싱한 생선만 손질합니다.
</p>
<a
href=
"/menu"
class=
"btn btn-default btn-lg"
>
메뉴 보러가기
</a>
</div>
</div>
</div>
</section>
<!-- Download Section -->
<section
id=
"download"
class=
"download-section content-section text-center"
>
<div
class=
"container"
>
...
...
@@ -108,7 +130,7 @@
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-lg-8 mx-auto"
>
<h2>
Contact
GROTTO
</h2>
<h2>
Contact
별빛바다 달빛초원
</h2>
<p>
전화번호 : 031-205-7220
</p>
<p>
영업시간 : 매일 10:00 - 23:30 (Last Order 22:00)
</p>
<ul
class=
"list-inline banner-social-buttons"
>
...
...
@@ -118,12 +140,13 @@
<span
class=
"network-name"
>
facebook
</span>
</a>
</li>
<li
class=
"list-inline-item"
>
<
!--<
li class="list-inline-item">
<a href="https://www.instagram.com/grotto_since2011/" class="btn btn-default btn-lg">
<i class="fa fa-instagram fa-fw"></i>
<span class="network-name">Instagram</span>
</a>
</li>
-->
</ul>
</div>
</div>
...
...
@@ -153,7 +176,7 @@
}
</style>
<body>
<p>
경기도 수원시 영통구 영통동 10
30-2
</p>
<p>
경기도 수원시 영통구 영통동 10
25-1(경기도 수원시 영통구 청명로 28) 1층 별빛바다 달빛초원
</p>
<section
id=
"contact"
class=
"content-section text-center"
>
<div
class=
"container"
>
<div
class=
"row"
>
...
...
@@ -185,7 +208,7 @@
<script>
function
initMap
()
{
var
cnt
=
1
;
//마커 카운트 해서 우선 2개만 제한
var
initLatLng
=
{
lat
:
37.2
51797
,
lng
:
127.076747
};
var
initLatLng
=
{
lat
:
37.2
497462
,
lng
:
127.0785575
};
var
geocoder
=
new
google
.
maps
.
Geocoder
;
var
map
=
new
google
.
maps
.
Map
(
document
.
getElementById
(
'map'
),
{
center
:
initLatLng
,
...
...
views/menu.ejs
0 → 100644
View file @
c099e22
This diff is collapsed. Click to expand it.
views/pay.ejs
0 → 100644
View file @
c099e22
<!DOCTYPE html>
<html>
<head>
<title>
<
%= title %>
</title>
<link
rel=
'stylesheet'
href=
'/stylesheets/style.css'
/>
<script
type=
"text/javascript"
src=
"https://code.jquery.com/jquery-1.12.4.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://service.iamport.kr/js/iamport.payment-1.1.5.js"
></script>
</head>
<body>
<h1>
결제창
</h1>
</body>
<script>
var
IMP
=
window
.
IMP
;
IMP
.
init
(
'imp90003971'
);
IMP
.
request_pay
({
pg
:
'kakao'
,
// version 1.1.0부터 지원.
pay_method
:
'card'
,
merchant_uid
:
'merchant_'
+
new
Date
().
getTime
(),
name
:
'주문명:결제테스트'
,
amount
:
100
,
buyer_email
:
'jju0807@naver.com'
,
buyer_name
:
'정지윤'
,
buyer_tel
:
'010-8762-3073'
,
buyer_addr
:
'서울특별시 강남구 삼성동'
,
buyer_postcode
:
'123-456'
,
m_redirect_url
:
'https://localhost:3000'
},
function
(
rsp
)
{
if
(
rsp
.
success
)
{
var
msg
=
'결제가 완료되었습니다.'
;
msg
+=
'고유ID : '
+
rsp
.
imp_uid
;
msg
+=
'상점 거래ID : '
+
rsp
.
merchant_uid
;
msg
+=
'결제 금액 : '
+
rsp
.
paid_amount
;
msg
+=
'카드 승인번호 : '
+
rsp
.
apply_num
;
}
else
{
var
msg
=
'결제에 실패하였습니다.'
;
msg
+=
'에러내용 : '
+
rsp
.
error_msg
;
}
alert
(
msg
);
});
</script>
</html>
views/reservation.ejs
View file @
c099e22
...
...
@@ -61,7 +61,7 @@
<div
class=
"input-group"
>
<label
class=
"col-md-4 control-label"
>
휴대전화
</label>
<i
class=
"glyphicon glyphicon-earphone"
></i>
<input
name=
"phone"
placeholder=
"010
-123-
4567"
class=
"form-control"
type=
"text"
>
<input
name=
"phone"
placeholder=
"010
123
4567"
class=
"form-control"
type=
"text"
>
</div>
</div>
</div>
...
...
Please
register
or
login
to post a comment