作者 anyv
1 个管道 的构建 通过 耗费 0 秒

联系人

... ... @@ -10,6 +10,8 @@ class ContactsController extends AdminBaseController{
//后台联系人显示
public function index(){
$data = Db::name('contacts') -> select();
$this -> assign('data',$data);
return $this -> fetch();
}
... ...
... ... @@ -11,15 +11,16 @@
</tr>
</thead>
<tbody>
<tr>
<td>Tanmay</td>
<td>Bangalore</td>
<td>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal">查看</button>
<button type="button" class="btn btn-default" >删除</button>
</td>
</tr>
<volist name="data" id="vo">
<tr>
<td>{$vo.name}</td>
<td>{$vo.phone}</td>
<td>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#myModal" onclick="chakan({$vo.id})">查看</button>
<button type="button" class="btn btn-default" >删除</button>
</td>
</tr>
</volist>
</tbody>
</table>
... ... @@ -31,14 +32,22 @@
<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>
<div class="modal-body">
在这里添加一些文本
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">提交更改</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<script>
//当点击查看时
function chakan(id){
alert(id);
}
</script>
</body>
</html>
\ No newline at end of file
... ...