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/group/permission.php

66 lines
2.5 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" id="save-btn" name="save-btn" value="保存">
<input type="button" class="act_btn" id="return-btn" name="return-btn" value="返回">
<?=$group_info?$group_info->getPath():''?>
</td>
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="100" align="center" class="bg_tr">菜单名称</td>
<td width="70%" align="center" class="bg_tr">路径</td>
</tr>
<form id="theFrm">
<input type="hidden" name="group_id" value="<?=$group_id?>">
<?php
foreach($menu_items as $item) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td width="24" align="center" class="td_bg">
<label>
<input class="checkbox" type="checkbox" name="menu_ids[]" value="<?=$item->id?>" <?=in_array($item->id,$menu_ids)?'checked':''?>>
</label>
</td>
<td class="td_bg" nowrap><?= $item->name ?></td>
<td class="td_bg" nowrap><?= $item->path ?></td>
</tr>
<?php
}
?>
</form>
</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(){
$('#save-btn').click(function(){
var params = $('#theFrm').serialize();
$.post('/group/permission',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.href = '/group/index';
}
},'json');
});
$('#return-btn').click(function(){
window.location.href = '/group/index';
});
$('#all').click(function(){
var key = $(this).prop('checked');
if(key)
$('.checkbox').prop('checked',true);
else
$('.checkbox').removeProp('checked');
});
});
</script>