김정은
...@@ -4,8 +4,8 @@ var router = express.Router(); ...@@ -4,8 +4,8 @@ var router = express.Router();
4 4
5 var connection = mysql.createConnection({ 5 var connection = mysql.createConnection({
6 host : 'localhost', 6 host : 'localhost',
7 - user : 'root', 7 + user : 'admin',
8 - password : 'qmfkdnsl', 8 + password : 'admin',
9 database : 'ossprojectdb' 9 database : 'ossprojectdb'
10 }); 10 });
11 11
......
...@@ -6,21 +6,17 @@ ...@@ -6,21 +6,17 @@
6 <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTR69UvS1403rvBcM64_8nlzpKLv23RIE&libraries=places"></script> 6 <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTR69UvS1403rvBcM64_8nlzpKLv23RIE&libraries=places"></script>
7 <script> 7 <script>
8 8
9 - //표시하기 버튼 눌렀을 때 post보내는 함수
10 9
11 - function forming() { 10 + function addShop(id) {
12 - 11 + var placeid = $(id).attr('id');
13 - 12 + var placename = $(id).attr('name');
14 - if(confirm("맛집견문록에 기록하겠습니까?")){ 13 + var placeaddress = $(id).attr('address');
15 -
16 - document.forms["userform"].submit();
17 - return true;
18 - }else{
19 - return false;
20 - }
21 -
22 - }
23 14
15 + $('input[name=id]').val(placeid);
16 + $('input[name=title]').val(placename);
17 + $('input[name=address]').val(placeaddress);
18 + $('form[name=submit]').submit();
19 + }
24 20
25 function initMap(latitude, longitude) { 21 function initMap(latitude, longitude) {
26 var center = {lat: latitude, lng: longitude}; 22 var center = {lat: latitude, lng: longitude};
...@@ -74,7 +70,7 @@ ...@@ -74,7 +70,7 @@
74 '<h1 id="firstHeading" class="firstHeading">'+place.name+'</h1>'+ 70 '<h1 id="firstHeading" class="firstHeading">'+place.name+'</h1>'+
75 '<div id="bodyContent">'+ 71 '<div id="bodyContent">'+
76 '<p>주소: '+place.vicinity+'<br/>'+ 72 '<p>주소: '+place.vicinity+'<br/>'+
77 - '<a href="#" onclick="forming();">'+ 73 + '<button id="'+place.id+'" name="'+place.name+'" address="'+place.vicinity+'" onclick="addShop(this)">'+
78 '표시하기</a> '+ 74 '표시하기</a> '+
79 '</p>'+ 75 '</p>'+
80 '</div>'+ 76 '</div>'+
...@@ -82,27 +78,13 @@ ...@@ -82,27 +78,13 @@
82 78
83 79
84 80
85 -
86 google.maps.event.addListener(marker1, 'click', function(e) { 81 google.maps.event.addListener(marker1, 'click', function(e) {
87 - //console.log(place)
88 -
89 -
90 -
91 -
92 82
93 var infowindow = new google.maps.InfoWindow({ 83 var infowindow = new google.maps.InfoWindow({
94 content: contentString, 84 content: contentString,
95 maxWidth: 300 85 maxWidth: 300
96 }); 86 });
97 infowindow.open(map, this); 87 infowindow.open(map, this);
98 - //marker1.setMap(null);
99 - //marker2.setMap(map);
100 - console.log('<%=user.username%>');
101 -
102 -
103 -// console.log(document.getElementsByName('placeaddress').value);
104 -
105 -
106 88
107 }); 89 });
108 google.maps.event.addListener(marker2, 'click', function() { 90 google.maps.event.addListener(marker2, 'click', function() {
...@@ -175,7 +157,11 @@ ...@@ -175,7 +157,11 @@
175 </div> 157 </div>
176 158
177 <div id ="footer"></div> 159 <div id ="footer"></div>
178 - 160 + <form name="shop" method="post" action="/shop">
161 + <input type="hidden" name="id"/>
162 + <input type="hidden" name="title"/>
163 + <input type="hidden" name="address"/>
164 + </form>
179 </body> 165 </body>
180 166
181 </html> 167 </html>
......