정지윤

예약기능추가-메뉴조회

...@@ -35,11 +35,13 @@ router.post('/reservation',function(req, res){ ...@@ -35,11 +35,13 @@ router.post('/reservation',function(req, res){
35 var restime = req.body.restime; 35 var restime = req.body.restime;
36 var resmin = req.body.resmin; 36 var resmin = req.body.resmin;
37 var date = req.body.date; 37 var date = req.body.date;
38 +
38 var content = req.body.content; 39 var content = req.body.content;
40 + var food = req.body.food;
39 pool.getConnection(function (err, connection) 41 pool.getConnection(function (err, connection)
40 { 42 {
41 // Use the connection 43 // Use the connection
42 - var sqlForInsertBoard = "insert into menu(creater_id, phone, email, num, restime, resmin,date, content) values('"+creater_id+"', '"+phone+"', '"+email+"','"+num+"','"+restime+"','"+resmin+"','"+date+"', '"+content+"')"; 44 + 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+"')";
43 connection.query(sqlForInsertBoard, function (err, rows) { 45 connection.query(sqlForInsertBoard, function (err, rows) {
44 if (err) console.error("err : " + err); 46 if (err) console.error("err : " + err);
45 console.log("rows : " + JSON.stringify(rows)); 47 console.log("rows : " + JSON.stringify(rows));
......
...@@ -13,7 +13,7 @@ var smtpTransport = nodemailer.createTransport({ ...@@ -13,7 +13,7 @@ var smtpTransport = nodemailer.createTransport({
13 13
14 var mailOptions = { 14 var mailOptions = {
15 from: '정지윤 <violet3073@gmail.com>', 15 from: '정지윤 <violet3073@gmail.com>',
16 - to: 'kyung__e@naver.com', 16 + to: 'jju0807@naver.com',
17 subject: '예약 게시판 확인해주세요!', 17 subject: '예약 게시판 확인해주세요!',
18 text: '예약이 도착했습니다' 18 text: '예약이 도착했습니다'
19 }; 19 };
......
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
43 <li class="nav-item"> 43 <li class="nav-item">
44 <a class="nav-link js-scroll-trigger" href="#contact">Contact</a> 44 <a class="nav-link js-scroll-trigger" href="#contact">Contact</a>
45 </li> 45 </li>
46 + <li class="nav-item">
47 + <a class="nav-link js-scroll-trigger" href="#map">Map</a>
48 + </li>
46 </ul> 49 </ul>
47 </div> 50 </div>
48 </div> 51 </div>
...@@ -127,6 +130,8 @@ ...@@ -127,6 +130,8 @@
127 </section> 130 </section>
128 131
129 132
133 +
134 + <!-- Map Section -->
130 <section id="contact" class="content-section text-center"> 135 <section id="contact" class="content-section text-center">
131 <div class="container"> 136 <div class="container">
132 <div class="row"> 137 <div class="row">
...@@ -135,7 +140,6 @@ ...@@ -135,7 +140,6 @@
135 </div> 140 </div>
136 </div> 141 </div>
137 </div> 142 </div>
138 - <!-- Map Section -->
139 <div id="map"></div> 143 <div id="map"></div>
140 144
141 <!-- 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/ --> 145 <!-- 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 @@ ...@@ -194,7 +194,7 @@
194 194
195 <option><script language="JavaScript"> 195 <option><script language="JavaScript">
196 var today = new Date( ) 196 var today = new Date( )
197 - document.write(today.getMonth( )+1 , "월 " , today.getDate( )+7 , "일 (예약은 1주일까지만 가능합니다.)") 197 + document.write(today.getMonth( )+1 , "월 " , today.getDate( )+7 , "일 (예약은 1주일까지만 가능합니다)")
198 </script> </option> 198 </script> </option>
199 199
200 </select> 200 </select>
...@@ -202,14 +202,49 @@ ...@@ -202,14 +202,49 @@
202 </div> 202 </div>
203 </div> 203 </div>
204 204
205 + <!-- radio checks-->
206 + <div class="form-group">
207 + <div class="col-md-4 selectContainer">
208 + <div class="input-group">
209 + <label class="col-md-4 control-label">메뉴</label>
210 +
211 + <div class="checkbox">
212 + <label>
213 + <image src = "/img/pizza.jpg" width=100 height=100>
214 + <br><input type="checkbox" name="food" value="pizza" /> 피자
215 + </label>
216 + </div>
217 + &nbsp;
218 + &nbsp;
219 + &nbsp;
220 + <div class="checkbox">
221 + <label>
222 + <image src = "/img/파스타.jpg" width=100 height=100>
223 + <br><input type="checkbox" name="food" value="pasta" /> 파스타
224 + </label>
225 + </div>
226 +
227 + &nbsp;
228 + &nbsp;
229 + &nbsp;
230 + <div class="checkbox">
231 + <label>
232 + <image src = "/img/와인.jpg" width=100 height=100>
233 + <br><input type="checkbox" name="food" value="wine" /> 와인
234 + </label>
235 + </div>
236 + </div>
237 + </div>
238 + </div>
239 +
205 240
206 <br> 241 <br>
207 <div class="form-group"> 242 <div class="form-group">
208 <div class="col-md-4 selectContainer"> 243 <div class="col-md-4 selectContainer">
209 <div class="input-group"> 244 <div class="input-group">
210 - <label class="col-md-4 control-label">요청사항</label> 245 + <label class="col-md-4 control-label">요청 사항</label>
211 <i class="glyphicon glyphicon-pencil"></i> 246 <i class="glyphicon glyphicon-pencil"></i>
212 - <textarea class="form-control" name="content" placeholder="요청 사항을 써주세요" style="width:310px; height:100px;"></textarea> 247 + <textarea class="form-control" name="content" placeholder="요청 사항을 적어주세요." style="width:310px; height:100px;"></textarea>
213 </div> 248 </div>
214 </div> 249 </div>
215 250
...@@ -237,7 +272,7 @@ ...@@ -237,7 +272,7 @@
237 { 272 {
238 if ( $("#creater_id").val().trim() == "" ) 273 if ( $("#creater_id").val().trim() == "" )
239 { 274 {
240 - var message = "아이디를 입력해 주세요"; 275 + var message = "아이디를 입력해주세요";
241 $("#creater_id").val(""); 276 $("#creater_id").val("");
242 $("#creater_id").focus(); 277 $("#creater_id").focus();
243 alert(message); 278 alert(message);
...@@ -246,7 +281,7 @@ ...@@ -246,7 +281,7 @@
246 281
247 if ( $("#phone").val().trim() == "" ) 282 if ( $("#phone").val().trim() == "" )
248 { 283 {
249 - var message = "폰번호를 입력해 주세요"; 284 + var message = "폰번호를 입력해주세요";
250 $("#phone").val(""); 285 $("#phone").val("");
251 $("#phone").focus(); 286 $("#phone").focus();
252 alert(message); 287 alert(message);
...@@ -254,21 +289,21 @@ ...@@ -254,21 +289,21 @@
254 } 289 }
255 if ( $("#email").val().trim() == "" ) 290 if ( $("#email").val().trim() == "" )
256 { 291 {
257 - var message = "이메일 주소를 입력해 주세요"; 292 + var message = "이메일 주소를 입력해주세요";
258 $("#email").val(""); 293 $("#email").val("");
259 $("#email").focus(); 294 $("#email").focus();
260 alert(message); 295 alert(message);
261 return false; 296 return false;
262 }if ( $("#num").val().trim() == "" ) 297 }if ( $("#num").val().trim() == "" )
263 { 298 {
264 - var message = "인원수를 입력해 주세요"; 299 + var message = "인원수를 입력해주세요";
265 $("#num").val(""); 300 $("#num").val("");
266 $("#num").focus(); 301 $("#num").focus();
267 alert(message); 302 alert(message);
268 return false; 303 return false;
269 }if ( $("#restime").val().trim() == "" ) 304 }if ( $("#restime").val().trim() == "" )
270 { 305 {
271 - var message = "예약시간을 입력해 주세요"; 306 + var message = "예약시간을 입력해주세요";
272 $("#restime").val(""); 307 $("#restime").val("");
273 $("#restime").focus(); 308 $("#restime").focus();
274 alert(message); 309 alert(message);
...@@ -276,7 +311,7 @@ ...@@ -276,7 +311,7 @@
276 } 311 }
277 if ( $("#resmin").val().trim() == "" ) 312 if ( $("#resmin").val().trim() == "" )
278 { 313 {
279 - var message = "예약 분을 입력해 주세요"; 314 + var message = "예약 분을 입력해주세요";
280 $("#resmin").val(""); 315 $("#resmin").val("");
281 $("#resmin").focus(); 316 $("#resmin").focus();
282 alert(message); 317 alert(message);
...@@ -284,15 +319,23 @@ ...@@ -284,15 +319,23 @@
284 } 319 }
285 if ( $("#date").val().trim() == "" ) 320 if ( $("#date").val().trim() == "" )
286 { 321 {
287 - var message = "예약 날짜를 입력해 주세요"; 322 + var message = "예약 날짜를 입력해주세요";
288 $("#date").val(""); 323 $("#date").val("");
289 $("#date").focus(); 324 $("#date").focus();
290 alert(message); 325 alert(message);
291 return false; 326 return false;
292 } 327 }
328 + if ( $("#food").val().trim() == "" )
329 + {
330 + var message = "예약 메뉴를 입력해주세요";
331 + $("#food").val("");
332 + $("#food").focus();
333 + alert(message);
334 + return false;
335 + }
293 if ( $("#content").val().trim() == "" ) 336 if ( $("#content").val().trim() == "" )
294 { 337 {
295 - var message = "비고사항을 입력해 주세요"; 338 + var message = "비고사항을 입력해주세요";
296 $("#content").val(""); 339 $("#content").val("");
297 $("#content").focus(); 340 $("#content").focus();
298 alert(message); 341 alert(message);
......