westdc-zf1/application/admin/views/scripts/data/project-showexpert.phtml

76 lines
2.4 KiB
PHTML
Raw Normal View History

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/heihe">黑河数据集</a>');
$this->breadcrumb('黑河数据集');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/colorbox.css');
$this->headLink()->appendStylesheet('/css/author.css');
?>
<?php
if(!empty($this->error))
{
echo $this->error;
echo "<script>setTimeout('parent.$.fn.colorbox.close();',2000);</script>";
}else{?>
<div class="content" id="datalist">
<ul>
<?php
foreach($this->experts as $k=>$v)
{
echo '<li id="item_'.$k.'"><p>'.$v['name'] ." - ".
$v['email'].' - '.
$v['validation'].' - '.
$v['created'] .'
<lable id="delBtn_'.$k.'">
<a href="javascript:void(0);" onclick="del(\''.$k.'\',\''.$v['email'].'\')">删除</a></lable</p>
<p>邀请链接:'.$v['url'].'</p>
</li>';
}
?>
</ul>
</div>
<script>
function del(id,email){
var dom = "#delBtn_"+id;
var html = $(dom).html();
$.ajax({
'type':"POST",
'url':'/admin/data/project/ac/remove',
'data':'id=<?= $this->pid;?>&del='+email,
'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')
{$('#item_'+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;}
});
}
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4 style="font-size:16px;font-weight:bold;">'+html+'</h4>'});
}
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
</script>
<?php
}
?>