westdc-zf1/application/admin/views/scripts/data/author-edit.phtml

101 lines
3.1 KiB
PHTML
Raw Normal View History

<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/colorbox.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('数据作者管理');
$this->breadcrumb()->setSeparator(' > ');
?>
<!-- 左侧导航 -->
<div id="leftPanel">
<?= $this->partial('data/left.phtml'); ?>
</div>
<!-- //左侧导航 -->
2012-05-31 03:17:19 +00:00
<!-- 页面内容 -->
<div id="rightPanel">
2012-05-31 03:17:19 +00:00
<div id="loading" class="info info-box"></div>
<div id="datalist">
<ul>
<?php
if(isset($this->authors))
{
foreach($this->authors as $v)
{
?>
<li id="author_<?php echo $v['id'] ;?>">
<p><?php echo $v['realname']; ?> [ <?php echo $v['username']; ?> ]</p>
<p><span id="status_<?php echo $v['id'] ;?>"><?php if($v['status']==1) {echo "已认证";} if($v['status']==0) {echo "已申请";} if($v['status']==-1) {echo "已拒绝";} ?></span> |
<a href="javascript:;" onclick="remove(<?php echo $v['id'] ;?>)">移除该作者</a>
<span id="statusChange_<?php echo $v['id'] ;?>"><?php if($v['status']<1) {?> <a href="javascript:;" onclick="update(<?php echo $v['id'] ;?>)">认证该用户</a> <?php }?></span>
</p>
</li>
<?php } } ?>
</ul></div>
</div>
<!-- //页面内容 -->
<script>
function update(id){
$.ajax({
'type':"POST",
'url':'/admin/data/author/',
'data':'ac=update&id='+id,
'success':function(data){
if (data!=null)
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(data.msg!=null)
{Alert(data.msg);}
if(typeof(data.updated)!='undefined')
{$('#status_'+data.updated).html('已认证');$('#statusChange_'+data.updated).html('');}
}else{
Alert('处理中出现错误');
}
},
'timeout': 30000
});
}
function remove(id){
if(confirm('确实要删除吗?')==false)
{return false;}
$.ajax({
type:"POST",
url:'/admin/data/author',
data:'ac=del&id='+id,
success:function(data){
if (data!=null)
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(typeof(data.deleted)!='undefined')
{$('#author_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
}else{
Alert('处理中出现错误');
}
},
'timeout': 30000
});
}
$('#loading').css("opacity","0.2");
$('#loading').ajaxComplete(function() {
$(this).css('display','none');
});
$('#loading').ajaxSend(function() {
$(this).css('display','block');
});
$("#loading").ajaxError(function() {
$(this).css('display','none');
Alert('请求超时或服务器开小差了,请刷新页面后重试');
});
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
}
</script>