You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/frontend/views/menu/power-list.php

60 lines
2.1 KiB

5 years ago
<?php
use \common\libs\MyLib;
?>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form id="searchForm">
<tr>
<td class="td_bg">
<input type="button" class="act_btn" onclick="UpdatePower(0)" value="新增">
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<?php if($power_info){ ?>
<tr>
<td style="width:50px;" align="center" class="bg_tr">序号</td>
<td style="width:300px;" align="center" class="bg_tr">组名</td>
<td style="width:100px;" align="center" class="bg_tr">操作</td>
</tr>
<?php foreach($power_info as $k=>$v){ ?>
<tr>
<td align="center" class="td_bg"><?=$k+1?></td>
<td align="center" class="td_bg"><?=$v->name?></td>
<td align="center" class="td_bg"><a href="javascript:;" onclick="UpdatePower(<?=$v->id?>)">修改</a> | <a href="javascript:;" onclick="DelPower(<?=$v->id?>)">删除</a></td>
</tr>
<?php } ?>
<?php }else{ ?>
<tr class="td_bg" align="center">
<td>暂无权限组数据!</td>
</tr>
<?php } ?>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
/**
* 跳转编辑、新增页面
*/
function UpdatePower(power_id=0){
window.location.href="/menu/power-detail?id="+power_id;
}
/**
* 删除权限组
*/
function DelPower(power_id=0){
if(confirm('是否确认删除?')){
$.post('/menu/power-del',{power_id:power_id},function(obj){
alert(obj.msg);
if(obj.success){
window.location.href="/menu/power-list";
}
},'json');
}
}
</script>