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

73 lines
3.2 KiB

5 years ago
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
<form id="theFrm">
<input type="hidden" name="group_id" value="<?=$permissions_id?>">
<?php foreach($menu_items as $item) { ?>
5 years ago
<div class="col-sm-2">
<div class="panel panel-info">
<div class="panel-heading">
5 years ago
<div class="row">
5 years ago
<div class="col-sm-12">
5 years ago
<label class="i-checks">
<input type="checkbox" name="menu_ids[]" value="<?=$item->id?>" <?=in_array($item->id, $menu_ids)?'checked':''?>><i></i> <?=$item->name?>
</label>
</div>
</div>
</div>
<div class="panel-body">
<?php foreach($item->menus as $sub_item) { ?>
5 years ago
<div class="row">
5 years ago
<div class="col-sm-12">
5 years ago
<label class="i-checks">
<input type="checkbox" name="menu_ids[]" value="<?=$sub_item->id?>" <?=in_array($sub_item->id, $menu_ids)?'checked':''?>><i></i> <?=$sub_item->name?>
</label>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</form>
</div>
<div class="row">
5 years ago
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong>保 存</strong>
</button>
</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>
5 years ago
$(function(){
$('.btn-save').click(function(){
5 years ago
var params = $('#theFrm').serialize();
$.post('/permissions/permission',params,function(obj){
if(obj.success) {
parent.layer.msg('保存成功');
layer_close();
} else {
parent.layer.msg(data.msg);
5 years ago
}
},'json');
});
});
</script>
<?php $this->endBlock(); ?>