maplist.html
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<include file="public@header" />
</head>
<body>
<table class="table table-bordered" style="margin:10px 10px;">
<caption>地图管理</caption>
<thead>
<tr>
<th>公司名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>{$data.title}</td>
<td>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">编辑</button>
</td>
</tr>
</tbody>
</table>
<!-- 模态框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">地图编辑</h4>
</div>
<div class="modal-body">
<div class="input-group" style="margin-top: 5px;">
<span class="input-group-addon">公司名称:</span>
<input type="text" class="form-control" name="title" value="{$data.title}" >
</div>
<div class="input-group" style="margin-top: 5px;">
<span class="input-group-addon">公司地址:</span>
<input type="text" class="form-control" name="address" value="{$data.address}" >
</div>
<div class="input-group" style="margin-top: 5px;">
<span class="input-group-addon">经度:</span>
<input type="text" class="form-control" name="jing" value="{$data.jingdu}" >
</div>
<div class="input-group" style="margin-top: 5px;">
<span class="input-group-addon">纬度:</span>
<input type="text" class="form-control" name="wei" value="{$data.weidu}" >
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="tijiao()">提交更改</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<script>
//当点击提交时
function tijiao(){
title = $("input[name='title']").val();
assress = $("input[name='address']").val();
jingdu = $("input[name='jing']").val();
weidu = $("input[name='wei']").val();
$.post("{:url('map/mapup')}", {title:title,address:assress,jingdu:jingdu,weidu:weidu}, function(data) {
window.location.reload();
});
}
</script>
</body>
</html>