정지윤

예약기능추가-메뉴조회

......@@ -35,11 +35,13 @@ router.post('/reservation',function(req, res){
var restime = req.body.restime;
var resmin = req.body.resmin;
var date = req.body.date;
var content = req.body.content;
var food = req.body.food;
pool.getConnection(function (err, connection)
{
// Use the connection
var sqlForInsertBoard = "insert into menu(creater_id, phone, email, num, restime, resmin,date, content) values('"+creater_id+"', '"+phone+"', '"+email+"','"+num+"','"+restime+"','"+resmin+"','"+date+"', '"+content+"')";
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+"')";
connection.query(sqlForInsertBoard, function (err, rows) {
if (err) console.error("err : " + err);
console.log("rows : " + JSON.stringify(rows));
......
......@@ -13,7 +13,7 @@ var smtpTransport = nodemailer.createTransport({
var mailOptions = {
from: '정지윤 <violet3073@gmail.com>',
to: 'kyung__e@naver.com',
to: 'jju0807@naver.com',
subject: '예약 게시판 확인해주세요!',
text: '예약이 도착했습니다'
};
......
......@@ -43,6 +43,9 @@
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#map">Map</a>
</li>
</ul>
</div>
</div>
......@@ -127,6 +130,8 @@
</section>
<!-- Map Section -->
<section id="contact" class="content-section text-center">
<div class="container">
<div class="row">
......@@ -135,7 +140,6 @@
</div>
</div>
</div>
<!-- Map Section -->
<div id="map"></div>
<!-- Google Maps API Key - Use your own API key to enable the map feature. More information on the Google Maps API can be found at https://developers.google.com/maps/ -->
......
......@@ -194,7 +194,7 @@
<option><script language="JavaScript">
var today = new Date( )
document.write(today.getMonth( )+1 , "월 " , today.getDate( )+7 , "일 (예약은 1주일까지만 가능합니다.)")
document.write(today.getMonth( )+1 , "월 " , today.getDate( )+7 , "일 (예약은 1주일까지만 가능합니다)")
</script> </option>
</select>
......@@ -202,14 +202,49 @@
</div>
</div>
<!-- radio checks-->
<div class="form-group">
<div class="col-md-4 selectContainer">
<div class="input-group">
<label class="col-md-4 control-label">메뉴</label>
<div class="checkbox">
<label>
<image src = "/img/pizza.jpg" width=100 height=100>
<br><input type="checkbox" name="food" value="pizza" /> 피자
</label>
</div>
&nbsp;
&nbsp;
&nbsp;
<div class="checkbox">
<label>
<image src = "/img/파스타.jpg" width=100 height=100>
<br><input type="checkbox" name="food" value="pasta" /> 파스타
</label>
</div>
&nbsp;
&nbsp;
&nbsp;
<div class="checkbox">
<label>
<image src = "/img/와인.jpg" width=100 height=100>
<br><input type="checkbox" name="food" value="wine" /> 와인
</label>
</div>
</div>
</div>
</div>
<br>
<div class="form-group">
<div class="col-md-4 selectContainer">
<div class="input-group">
<label class="col-md-4 control-label">요청사항</label>
<label class="col-md-4 control-label">요청 사항</label>
<i class="glyphicon glyphicon-pencil"></i>
<textarea class="form-control" name="content" placeholder="요청 사항을 써주세요" style="width:310px; height:100px;"></textarea>
<textarea class="form-control" name="content" placeholder="요청 사항을 적어주세요." style="width:310px; height:100px;"></textarea>
</div>
</div>
......@@ -237,7 +272,7 @@
{
if ( $("#creater_id").val().trim() == "" )
{
var message = "아이디를 입력해 주세요";
var message = "아이디를 입력해주세요";
$("#creater_id").val("");
$("#creater_id").focus();
alert(message);
......@@ -246,7 +281,7 @@
if ( $("#phone").val().trim() == "" )
{
var message = "폰번호를 입력해 주세요";
var message = "폰번호를 입력해주세요";
$("#phone").val("");
$("#phone").focus();
alert(message);
......@@ -254,21 +289,21 @@
}
if ( $("#email").val().trim() == "" )
{
var message = "이메일 주소를 입력해 주세요";
var message = "이메일 주소를 입력해주세요";
$("#email").val("");
$("#email").focus();
alert(message);
return false;
}if ( $("#num").val().trim() == "" )
{
var message = "인원수를 입력해 주세요";
var message = "인원수를 입력해주세요";
$("#num").val("");
$("#num").focus();
alert(message);
return false;
}if ( $("#restime").val().trim() == "" )
{
var message = "예약시간을 입력해 주세요";
var message = "예약시간을 입력해주세요";
$("#restime").val("");
$("#restime").focus();
alert(message);
......@@ -276,7 +311,7 @@
}
if ( $("#resmin").val().trim() == "" )
{
var message = "예약 분을 입력해 주세요";
var message = "예약 분을 입력해주세요";
$("#resmin").val("");
$("#resmin").focus();
alert(message);
......@@ -284,15 +319,23 @@
}
if ( $("#date").val().trim() == "" )
{
var message = "예약 날짜를 입력해 주세요";
var message = "예약 날짜를 입력해주세요";
$("#date").val("");
$("#date").focus();
alert(message);
return false;
}
if ( $("#food").val().trim() == "" )
{
var message = "예약 메뉴를 입력해주세요";
$("#food").val("");
$("#food").focus();
alert(message);
return false;
}
if ( $("#content").val().trim() == "" )
{
var message = "비고사항을 입력해 주세요";
var message = "비고사항을 입력해주세요";
$("#content").val("");
$("#content").focus();
alert(message);
......