김정은
......@@ -4,8 +4,8 @@ var router = express.Router();
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : 'qmfkdnsl',
user : 'admin',
password : 'admin',
database : 'ossprojectdb'
});
......
......@@ -6,21 +6,17 @@
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBTR69UvS1403rvBcM64_8nlzpKLv23RIE&libraries=places"></script>
<script>
//표시하기 버튼 눌렀을 때 post보내는 함수
function forming() {
if(confirm("맛집견문록에 기록하겠습니까?")){
document.forms["userform"].submit();
return true;
}else{
return false;
}
}
function addShop(id) {
var placeid = $(id).attr('id');
var placename = $(id).attr('name');
var placeaddress = $(id).attr('address');
$('input[name=id]').val(placeid);
$('input[name=title]').val(placename);
$('input[name=address]').val(placeaddress);
$('form[name=submit]').submit();
}
function initMap(latitude, longitude) {
var center = {lat: latitude, lng: longitude};
......@@ -74,7 +70,7 @@
'<h1 id="firstHeading" class="firstHeading">'+place.name+'</h1>'+
'<div id="bodyContent">'+
'<p>주소: '+place.vicinity+'<br/>'+
'<a href="#" onclick="forming();">'+
'<button id="'+place.id+'" name="'+place.name+'" address="'+place.vicinity+'" onclick="addShop(this)">'+
'표시하기</a> '+
'</p>'+
'</div>'+
......@@ -82,27 +78,13 @@
google.maps.event.addListener(marker1, 'click', function(e) {
//console.log(place)
var infowindow = new google.maps.InfoWindow({
content: contentString,
maxWidth: 300
});
infowindow.open(map, this);
//marker1.setMap(null);
//marker2.setMap(map);
console.log('<%=user.username%>');
// console.log(document.getElementsByName('placeaddress').value);
});
google.maps.event.addListener(marker2, 'click', function() {
......@@ -175,7 +157,11 @@
</div>
<div id ="footer"></div>
<form name="shop" method="post" action="/shop">
<input type="hidden" name="id"/>
<input type="hidden" name="title"/>
<input type="hidden" name="address"/>
</form>
</body>
</html>
......