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

101 lines
3.4 KiB
PHTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>作者管理</title>
<link rel="stylesheet" type="text/css" media="screen" href="/css/default.css" />
<script src='/static/js/jquery-1.7.2.min.js' type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.colorbox-min.js"></script>
<link href="/css/author.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/static/js/uploadify/uploadify.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/colorbox.css" media="screen" rel="stylesheet" type="text/css" />
<style>
#loading{margin:0px;border:none;height:50px;width:98%;background:url(/static/img/colorbox-images/loading.gif) center center no-repeat;display:none;position:absolute;left:0px;top:0px;overflow:hidden;background:#ccc;}
</style>
</head>
<body>
<!-- 页面内容 -->
<div id="warpper">
<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>
</body>
</html>