westdc-zf1/application/admin/views/scripts/user/auth-group.phtml

111 lines
3.6 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headLink()->appendStylesheet('/css/author.css');
$this->theme->AppendPlus($this,'jquery');
$this->theme->AppendPlus($this,'colorbox');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin/">后台首页</a>');
$this->breadcrumb('<a href="/admin/user">用户管理</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="hidden-sm hidden-xs col-md-2">
<?= $this->partial('user/left.phtml'); ?>
</div>
<?php if ($this->msg) :?>
<div id="message" class="ag alert alert-info">
<?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?>
<?php if(!empty($this->jump_url))
{?>
<a href="<?= $this->jump_url?>"返回</a>
<script>setTimeout('top.location=\'<?= $this->jump_url?>\';',2000)</script>
<?php }?></p>
<?php endif; ?>
</div>
<?php else: ?>
<?php if ($this->error) :?>
<div id="message" class="alert alert-info">
<?php if ($this->error) : ?>
<p><?php echo $this->error; ?></p>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="col-md-10 col-sm-12">
<div class="form-group" >
<a class="btn btn-primary" href="/admin/user/groupauth/ac/add?gid=<?= $this->gid?>">添加权限</a>
<a class="btn btn-primary" href="/admin/user/groupauth/ac/clearall?gid=<?= $this->gid?>">清除所有权限</a>
</div>
<table class="stylized table table-bordered table-striped table-hover">
<thead>
<tr>
<td width='150'>模块</td>
<td width='150'>控制器</td>
<td width='150'>动作</td>
<td width='150'>特殊</td>
<td width="150">状态</td>
<td>操作</td>
</tr>
</thead><!-- table's head -->
<?php if (count($this->paginator)): ?>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>" id="row_<?= $item['id'];?>">
<td><?= $item['module']?></td>
<td><?= $item['controller']; ?></td>
<td><?= $item['action']; ?></td>
<td><?= $item['special']; ?></td>
<td><?= $item['allow']?></td>
<td>
<i id="delBtn_<?= $item['id']?>"><a href='javascript:del(<?= $item['id']?>);' onclick="return confirm('确定移除该权限?')">移除</a></i>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif;?>
</div>
</div>
<script>
//<-- users
function del(id){
var dom = "#delBtn_"+id;
var html = $(dom).html();
$.ajax({
'type':"POST",
'url':'/admin/user/groupauth/ac/del',
'data':'id='+id,
'success':function(data){
if (typeof(data)=='object')
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(typeof(data.msg)!='undefined')
{Alert(data.msg);}
if(typeof(data.deleted)!='undefined')
{$('#row_'+id).fadeOut(function(){$(this).remove();});}
}
else{
Alert('出现错误,请稍后再试');
}
},
'timeout': 30000,
'error': function(){Alert('处理中出现错误,请刷新页面后重试');},
'beforeSend':function(){$(dom).html('<img src="/images/ajax-load-small.gif" />');$(dom).attr("disabled","disabled")},
'complete':function(){$(dom).html(html);$(dom).removeAttr("disabled");dom = null;}
});
}
// users -->
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
}
</script>