정지윤

예약 리스트 출력 기능 및 비밀번호 기능 추가

No preview for this file type
......@@ -56,10 +56,6 @@ router.get('/menu',function(req,res){
router.get('/db', function(req, res){
pool.getConnection(function (err, connection)
{
......@@ -70,11 +66,16 @@ router.get('/db', function(req, res){
if (err) console.error("err : " + err);
console.log("rows : " + JSON.stringify(rows));
connection.release();
res.render('res_list', {data: rows});
// Don't use the connection here, it has been returned to the pool.
});
});
});
router.get('/pw',function(req,res){
res.render('pw',{title: '비번'});
});
/* GET home page. */
router.get('/pay', function(req, res, next) {
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>식당 예약</title>
<section id="about" class="reservationTheme content-section ">
<div class="container">
<br><br>
<h1>Thank you!</h1>
<h2>감사합니다! <br>예약이 성공적으로 완료되었습니다</h2>
<SCRIPT LANGUAGE="JavaScript">
<!--
function password()
{
var count = 0;
// 패스워드를 입력받는 상자를 띄워줌
var pass = prompt('패스워드를 입력하세요','');
while(count <=2 )
{
if (pass == "pw")
{ alert('어서 오세요!');
location.href="/db";
break;
}
else count+=1;
var pass = prompt('당신은 허가된 사용자가 아닙니다. 다시 입력해 주세요.','');
}
if(count == 3)
{
alert('자꾸 접근하려 하면 혼납니다!');
location.href="/first";
}
}
document.write(password());
//-->
</SCRIPT>
<script type="text/javascript" src="/mail"></script>
</head>
</html>
<!-- <form method="POST" action="/jj">
......@@ -25,6 +25,11 @@
<title>식당 예약</title>
<style type="text/css">
.reservationTheme{
background:url('/img/12.jpg') no-repeat center fixed;
......@@ -35,45 +40,40 @@
}
</style>
<section id="about" class="reservationTheme content-section ">
<div class="container">
<br><br>
<h1>예약 리스트</h1>
<table>
<table class = "table table-hover">
<thead>
<tr>
<th>번호<th>
<th>이름<th>
<th>휴대폰 번호<th>
<th>이메일주소<th>
<th>인원<th>
<th>예약 시<th>
<th>예약 분<th>
<th>예약 날짜<th>
<th>메뉴<th>
<th>작성시간<th>
<th>번호</th>
<th>이름</th>
<th>휴대폰번호</th>
<th>email</th>
<th>인원</th>
<th>예약 시</th>
<th>예약 분</th>
<th>예약 날짜 </th>
<th>메뉴</th>
<th>작성시간</th>
</tr>
</thead>
<tbody>
<%
for(var i=0; i<rows.length; i++)
var oneItem = rows[i];
%>
<tr>
<td><%=sqlForSelect.idx%></td>
<td><%=sqlForSelect.creater_id%></td>
<td><%=sqlForSelect.phone%></td>
<td><%=sqlForSelect.email%></td>
<td><%=sqlForSelect.num%></td>
<td><%=sqlForSelect.restime%></td>
<td><%=sqlForSelect.resmin%></td>
<td><%=sqlForSelect.content%></td>
<td><%=sqlForSelect.modidate%></td>
</tr>
<%
}
%>
<% for(var i=0; i< data.length; i++) { %>
<tr>
<td><%=data[i].idx%></td>
<td><%=data[i].creater_id%></td>
<td><%=data[i].phone%></td>
<td><%=data[i].email%></td>
<td><%=data[i].num%></td>
<td><%=data[i].restime%></td>
<td><%=data[i].resmin%></td>
<td><%=data[i].date%></td>
<td><%=data[i].content%></td>
<td><%=data[i].modidate%></td>
</tr>
<% } %>
</tbody>
</table>
......@@ -82,11 +82,15 @@
<div class="form-group">
<label class="col-md-4 control-label"></label>
<div class="col-md-4 center">
<a href="/first" class="btn btn-default btn-lg">홈으로</a>
</div>
</head>
</html>
......
......@@ -25,21 +25,20 @@
<title>식당 예약</title>
<style type="text/css">
.reservationTheme{
background:url('/img/diapo1.jpg') no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<div class="container">
<style type="text/css">
.reservationTheme{
background:url('/img/ss.jpg') no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<div class="container reservationTheme content-section">
<br><br>
<h2>Reservation <br>예약하기</h2>
<br><br>
<form class="well form-horizontal" action=" " method="post" id="contact_form">
<fieldset>
<form method="POST" action="/reservation"> <!-- Text input-->
......@@ -80,7 +79,7 @@
<div class="input-group">
<label class="col-md-4 control-label">휴대전화</label>
<i class="glyphicon glyphicon-earphone"></i>
<input name="phone" placeholder="0101234567" class="form-control" type="text">
<input name="phone" placeholder="010빼고 적어주세요" class="form-control" type="text">
</div>
</div>
</div>
......