parent
96238e8ecc
commit
b2c0272b18
@ -1,48 +1,69 @@ |
|||||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
<?php |
||||||
<form id="theFrm"> |
use \common\libs\MyLib; |
||||||
<input type="hidden" name="id" value="<?=$info->id?>">
|
?> |
||||||
<tr> |
<?php $this->beginBlock('header_css'); ?> |
||||||
<td width="100" height="25" class="td_bg">城市</td> |
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet"> |
||||||
<td height="25" class="td_bg"> |
<?php $this->endBlock(); ?> |
||||||
<input name="city_name" type="text" id="city_name" value="<?= $info->city_name ?>" style="width:400px;"/>
|
|
||||||
</td> |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
</tr> |
<div class="ibox float-e-margins"> |
||||||
<tr> |
<div class="ibox-content"> |
||||||
<td width="100" height="25" class="td_bg">IP</td> |
<div class="row"> |
||||||
<td height="25" class="td_bg"> |
<div class="col-sm-12"> |
||||||
<input name="ip" type="text" id="ip" value="<?= $info->ip ?>" style="width:400px;"/>
|
<form role="form" class="form-horizontal data-from" id="theFrm"> |
||||||
</td> |
<input type="hidden" name="id" value="<?=intval($info->id)?>">
|
||||||
</tr> |
<div class="form-group"> |
||||||
</form> |
<label class="col-sm-1 control-label">城市</label> |
||||||
<tr> |
<div class="col-sm-6"> |
||||||
<td height="22" colspan="2" align="center" class="td_bg"> |
<input type="text" name="city_name" value="<?=$info->city_name?>" class="form-control">
|
||||||
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> |
</div> |
||||||
|
</div> |
||||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
<div class="form-group"> |
||||||
</td> |
<label class="col-sm-1 control-label">IP</label> |
||||||
</tr> |
<div class="col-sm-6"> |
||||||
</table> |
<input type="text" name="ip" value="<?=$info->ip?>" class="form-control">
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
</div> |
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
</div> |
||||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
<div> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-sm-5 col-sm-offset-5"> |
||||||
|
<button class="btn btn-primary btn-save" type="button"> |
||||||
|
<strong><?=$info ? '保 存':'添 加'?></strong>
|
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php $this->beginBlock('footer_js'); ?> |
||||||
<script type="text/javascript" language="javascript"> |
<script type="text/javascript" language="javascript"> |
||||||
$(function () { |
$(function () { |
||||||
//提交按钮 |
//提交按钮 |
||||||
$("#submit-btn").click(function(){ |
$(".btn-save").click(function(){ |
||||||
if(confirm('是否确认提交?')) { |
parent.layer.confirm('是否确认提交?', { |
||||||
|
btn: ['确认','取消'], //按钮 |
||||||
|
shade: false //不显示遮罩 |
||||||
|
}, function(){ |
||||||
var params = $("#theFrm").serialize(); |
var params = $("#theFrm").serialize(); |
||||||
$.post('/system/ip-save',params,function(obj){ |
$.post('/system/ip-save',params,function(obj){ |
||||||
alert(obj.msg); |
|
||||||
if(obj.success) { |
if(obj.success) { |
||||||
$('#back-btn').click(); |
parent.layer.msg('保存成功'); |
||||||
|
parent.refreshList(); |
||||||
|
layer_close(); |
||||||
|
} else { |
||||||
|
parent.layer.msg(data.msg); |
||||||
} |
} |
||||||
},'json'); |
},'json'); |
||||||
} |
}, function(){ |
||||||
}); |
// |
||||||
|
}); |
||||||
//返回按钮 |
|
||||||
$('#back-btn').click(function(){ |
|
||||||
window.location.href='/system/ip'; |
|
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
|
<?php $this->endBlock('footer_js'); ?> |
||||||
|
|
||||||
|
@ -1,76 +1,98 @@ |
|||||||
<?php |
<?php |
||||||
use \common\libs\MyLib; |
use \common\libs\MyLib; |
||||||
?> |
?> |
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
<?php $this->beginBlock('header_css'); ?> |
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
<?php $this->endBlock(); ?> |
||||||
<script type="text/javascript" language="javascript"> |
|
||||||
$(function(){ |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
$('#add-btn').click(function(){ |
<div class="ibox float-e-margins"> |
||||||
edit(0); |
<div class="ibox-title"> |
||||||
}); |
<h5>外网IP管理</h5> |
||||||
$("#search-btn").click(function(){ |
<div class="ibox-tools"> |
||||||
var params = $('#searchForm').serialize(); |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||||
window.location.href = "/system/ip?" + params; |
<i class="fa fa-plus"></i> 添加 |
||||||
}); |
</a> |
||||||
}); |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||||
//编辑 |
<i class="fa fa-refresh"></i> 刷新 |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="ibox-content"> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-12"> |
||||||
|
<table id="listTable"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th width="50" data-field="id">ID</th> |
||||||
|
<th data-field="city_name">城市</th> |
||||||
|
<th data-field="ip">IP</th> |
||||||
|
<th data-formatter="opFormatter">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
<?php $this->beginBlock('footer_js'); ?> |
||||||
|
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||||
|
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||||
|
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||||
|
<script> |
||||||
|
function opFormatter(value, row, index) { |
||||||
|
var opStr = []; |
||||||
|
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||||
|
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||||
|
opStr.push('</a>'); |
||||||
|
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||||
|
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||||
|
opStr.push('</a>'); |
||||||
|
|
||||||
|
return opStr.join(' '); |
||||||
|
} |
||||||
|
function create() { |
||||||
|
title = '新增IP'; |
||||||
|
layer_show(title, '/system/edit?id=0'); |
||||||
|
} |
||||||
function edit(id) { |
function edit(id) { |
||||||
window.location.href = '/system/edit?id=' + id; |
var title = '编辑IP'; |
||||||
|
layer_show(title, '/system/edit?id=' + id); |
||||||
} |
} |
||||||
//删除 |
|
||||||
function del(id) { |
function del(id) { |
||||||
if(confirm('是否确认删除?')) { |
parent.layer.confirm('是否确认删除?', { |
||||||
$.post('/system/del',{id:id},function(obj){ |
btn: ['删除','取消'], //按钮 |
||||||
alert(obj.msg); |
shade: false //不显示遮罩 |
||||||
if(obj.success) { |
}, function(){ |
||||||
window.location.reload(); |
$.post('/system/delete',{id:id},function(data) { |
||||||
} |
parent.layer.msg(data.msg); |
||||||
},'json'); |
refreshList(); |
||||||
} |
}, 'json'); |
||||||
|
}, function(){ |
||||||
|
// |
||||||
|
}); |
||||||
} |
} |
||||||
</script> |
function refreshList() { |
||||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
$('#listTable').bootstrapTable('refresh'); |
||||||
<form id="searchForm"> |
} |
||||||
<tr> |
|
||||||
<td class="td_bg"> |
function search() { |
||||||
名称:<input name="name" type="text" value="<?= $name ?>">
|
$('#listTable').bootstrapTable('destroy'); |
||||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
$('#listTable').bootstrapTable({ |
||||||
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> |
url: "/system/ip-json", |
||||||
</td> |
pagination: false, |
||||||
</tr> |
sidePagination: 'server', |
||||||
</form> |
queryParams: function(params) { |
||||||
</table> |
return params; |
||||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
} |
||||||
<?php |
}); |
||||||
if($info){ |
|
||||||
?> |
|
||||||
<tr> |
|
||||||
<td width="10%" align="center" align="center" class="bg_tr" nowrap>序列号</td> |
|
||||||
<td width="30%" align="center" align="center" class="bg_tr">城市</td> |
|
||||||
<td width="20%" align="center" align="center" class="bg_tr">IP</td> |
|
||||||
<td width="40%" align="center" class="bg_tr">操作</td> |
|
||||||
</tr> |
|
||||||
<?php |
|
||||||
foreach($info as $index => $item){ |
|
||||||
?> |
|
||||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
|
||||||
<td align="center" class="td_bg" nowrap ><?= $index+1 ?></td>
|
|
||||||
<td align="left" class="td_bg" nowrap ><?= $item->city_name ?></td>
|
|
||||||
<td align="left" class="td_bg" nowrap ><?= $item->ip ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap> |
|
||||||
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>)">修改</a>]
|
|
||||||
[<a href="javascript:void(0);" onclick="del(<?= $item->id ?>)">删除</a>]
|
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<?php |
|
||||||
} |
|
||||||
?> |
|
||||||
<?php |
|
||||||
}else{ |
|
||||||
?> |
|
||||||
<tr>没有查到数据</tr> |
|
||||||
<?php |
|
||||||
} |
} |
||||||
?> |
|
||||||
</table> |
$(function() { |
||||||
|
search(); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
<?php $this->endBlock(); ?> |
||||||
|
Loading…
Reference in new issue