김정은

POST and subbit기능 완성

......@@ -39,20 +39,16 @@ ul.sidenav li a:hover:not(.active) {
}
table {
width: 70%;
height: 100%;
border-collapse: collapse;
text-align: center;
vertical-align: middle;
}
td {
vertical-align: middle;
text-align: center;
border: 1px solid #ddd;
width: 10%;
height: 0%;
padding-bottom: 20%;
background-image: url("/images/stamp.jpg");
background-repeat: no-repeat;
background-position: center top;
padding: 15px;
width: 20%;
height: 20%;
}
.bold {
color: #ffc0cb;
......@@ -66,14 +62,7 @@ td {
width: 15%;
display: inline-block;
float: left;
position: fixed;
overflow: auto;
}
#maintitle {
text-align: center;
background: #ffc0cb;
padding: 8px 16px;
margin-left: 15%;
}
#mynav {
display: block;
......@@ -85,7 +74,3 @@ td {
float: left;
margin-left: 0px;
}
#map {
height: 400px;
width: 100%;
}
......
......@@ -71,13 +71,17 @@ td
width: 15%;
display : inline-block;
float : left;
position : fixed;
overflow : auto;
position : fixed;
background-image : url("/images/menu_icon.png");
background-repeat: no-repeat;
background-position: center top;
#maintitle
text-align : center;
background : pink;
padding: 8px 16px;
background : black;
color : white;
padding: 80px 16px;
margin-left : 15%;
#mynav
......
......@@ -4,8 +4,8 @@ var router = express.Router();
var connection = mysql.createConnection({
host : 'localhost',
user : 'admin',
password : 'admin',
user : 'root',
password : 'qmfkdnsl',
database : 'ossprojectdb'
});
......@@ -44,20 +44,21 @@ router.post('/map', function(req, res){
var tempuser ={
'idusers' : req.body.userid,
'address' : req.body.placeaddress,
'contentid' : req.body.placeid,
'title' : req.body.placename}
'email' : req.body.useremail,
'contentid' : req.body.id,
'title' : req.body.title,
'address' : req.body.address}
console.log(tempuser);
var query = connection.query('insert into users set ?',tempuser,function(err,result){
if (err) {
console.error(err);
throw err;
}
});
console.log("success insert!");
});
router.get('/mybook', function(req, res, next){
......
......@@ -8,14 +8,17 @@
function addShop(id) {
var placeid = $(id).attr('id');
var placename = $(id).attr('name');
var placeaddress = $(id).attr('address');
$('input[name=useremail]').val('<%=user.email%>');
$('input[name=id]').val(placeid);
$('input[name=title]').val(placename);
$('input[name=address]').val(placeaddress);
$('form[name=submit]').submit();
console.log($('input[name=id]').val());
$('form[name=shop]').submit();
}
function initMap(latitude, longitude) {
......@@ -144,7 +147,7 @@
<div id ="content">
<div id="map"></div>
<div id="popup"></div>
<div id="form">
<!-- <div id="form">
<form name="userform" method="POST" action="/map">
<input type="hidden" name="userid"/>
<input type="hidden" name="placeid"/>
......@@ -153,11 +156,12 @@
</form>
</div>
</div> -->
</div>
<div id ="footer"></div>
<form name="shop" method="post" action="/shop">
<form name="shop" method="post" action="/map">
<input type="hidden" name="useremail"/>
<input type="hidden" name="id"/>
<input type="hidden" name="title"/>
<input type="hidden" name="address"/>
......