maplist.html 2.7 KB
<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">&times;</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>