정지윤

데이터베이스 오류 수정

......@@ -30,9 +30,8 @@ router.post('/reservation',function(req, res){
var restime = req.body.restime;
var resmin = req.body.resmin;
var date = req.body.date;
var food = req.body.food;
var content = req.body.content;
var food = req.body.food;
pool.getConnection(function (err, connection)
{
// Use the connection
......@@ -40,6 +39,7 @@ router.post('/reservation',function(req, res){
connection.query(sqlForInsertBoard, function (err, rows) {
if (err) console.error("err : " + err);
console.log("rows : " + JSON.stringify(rows));
res.redirect('/resconfirm');
connection.release();
// Don't use the connection here, it has been returned to the pool.
});
......@@ -75,6 +75,7 @@ router.get('/db', function(req, res){
/* GET home page. */
router.get('/pay', function(req, res, next) {
res.render('pay', { title: '결제' });
res.render('first');
});
module.exports = router;
......
......@@ -63,7 +63,7 @@
<div class="col-lg-8 mx-auto">
<h1 class="brand-heading" style="background-color: rgba( 0, 0, 0, 0.7 );">별빛바다 달빛초원</h1>
<p class="intro-text">
<br>정지윤</p>
<br>아래로 내리세요</p>
<a href="#about" class="btn btn-circle js-scroll-trigger">
<i class="fa fa-angle-double-down animated"></i>
</a>
......
......@@ -44,7 +44,7 @@
buyer_tel : '010-8762-3073',
buyer_addr : '서울특별시 강남구 삼성동',
buyer_postcode : '123-456',
m_redirect_url : 'https://localhost:3000/resconfirm'
m_redirect_url : 'http://localhost:3000/reservation'
}, function(rsp) {
if ( rsp.success ) {
var msg = '결제가 완료되었습니다.';
......@@ -52,11 +52,17 @@
msg += '상점 거래ID : ' + rsp.merchant_uid;
msg += '결제 금액 : ' + rsp.paid_amount;
msg += '카드 승인번호 : ' + rsp.apply_num;
} else {
alert(msg);
document.location.href="/reservation";
}
else {
var msg = '결제에 실패하였습니다.';
msg += '에러내용 : ' + rsp.error_msg;
alert(msg);
document.location.href="/first";
}
alert(msg);
});
</script>
</html>
......
This diff is collapsed. Click to expand it.