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

171 lines
7.0 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('黑河数据集');
$this->breadcrumb()->setSeparator(' > ');
$this->theme->AppendPlus($this,'jquery');
// $this->theme->AppendPlus($this,'colorbox');
$this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/lib/colorbox/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/js/lib/colorbox/colorbox.css');
?>
<div class="row">
<div class="hidden-sm hidden-xs col-md-2">
<?= $this->partial('data/left.phtml'); ?>
</div>
<div class="col-md-10 col-sm-12">
<?php if(!empty($this->searchLink)){ ?>
<div class="input-group form-group">
<form id="datasearch" class="search_form input-group" action="<?= $this->searchLink ?>">
<input class="form-control" type="text" id="keyword" name="q" value="<?= $this->searchKeyword; ?>" placeholder="搜索关键字" />
<span class="input-group-btn"><button type="submit" class="btn btn-default" id="search_btn">搜索</button></span>
</form>
</div>
<?php }?>
<div class="">
<a href="/admin/data/project/ac/status" class="btn btn-info">统计</a>
<a href="/admin/data/project/ac/datas" class="btn btn-info">计划内的数据</a>
<a href="/admin/data/project/ac/userdown" class="btn btn-info">计划内的下载纪录</a>
</div>
<h5>
<?= $this->Count; ?> 条记录
</h5>
<div id="datalistZ">
<?php
if (count($this->paginator)):
echo "<ul class=list-unstyled>";
$autoindex=0;
foreach ($this->paginator as $item):
$autoindex++;
?>
<li class="well well-sm">
<h3><span class="title"><?php echo $item['title'];?></span></h3>
<p class="text-muted">
编号:<?= $item['code'];?>&nbsp;&nbsp;|&nbsp;&nbsp;
负责人:<?= $item['name'];?>&nbsp;&nbsp;|&nbsp;&nbsp;
开始时间:<?= $item['pstart'];?>&nbsp;&nbsp;|&nbsp;&nbsp;
<span id="status_alias_<?= $item['id']?>" <?php if ($item['status'] == 3) echo 'class="glyphicon glyphicon-ok text-success"'; else echo 'class="glyphicon glyphicon-pencil text-warning"'; ?> >状态:<?= $item['status_alias'];?></span>
</p>
<p>
<a href="javascript:void(0);" onclick="$('#inviteFrom_<?= $item['id'];?>').toggle();">邀请跟踪专家</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a class="iframe" href="/admin/data/project/ac/showexpert/id/<?= $item['id'];?>">查看跟踪专家</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="/admin/data/project/ac/upload/pid/<?= $item['id']?>" class="iframe">上传计划</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="javascript:void(0);" onclick="changeStatus(<?= $item['id'];?>,<?= $item['status']?>)">状态修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<?php if(!empty($item['attachid'])) { ?>
<a href="/service/attach/id/<?= $item['attachid'];?>">下载</a>
<?php } ?>
</p>
<div id="inviteFrom_<?= $item['id'];?>" style="display:none;" class="form-inline">
<input class="form-control" type="text" id="expert_name_<?= $item['id'];?>" value="<?= $this->input_NameDefaultVal ?>"
onfocus="if(this.value=='<?= $this->input_NameDefaultVal ?>'){this.value=''}" onblur="if(this.value==''){this.value='<?= $this->input_NameDefaultVal ?>'}" />
<input class="form-control" type="text" id="expert_email_<?= $item['id'];?>" value="<?= $this->input_EmailDefaultVal ?>"
onfocus="if(this.value=='<?= $this->input_EmailDefaultVal ?>'){this.value=''}" onblur="if(this.value==''){this.value='<?= $this->input_EmailDefaultVal ?>'}" />
<button type="button " class="btn btn-primary" onclick="invite(<?= $item['id'];?>)" id="inviteBtn_<?= $item['id'];?>">邀请</button>
</div>
</li>
<?php
endforeach;
echo "</ul>";
endif; ?>
</div>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
<div style="display:none;">
<div id="confirm_dialog" class="cbox_content">
<div class="sepH_c tac"><strong>状态修改</strong></div>
<div id="cbox_dialog_content" class="sepH_c ">
<select id="status_selector" style="width:300px;" name="" class="form-control">
<?php
foreach($this->project_status as $k=>$v)
{
echo '<option value="'.$k.'">'.$v.'</option>';
}
?>
</select>
</div>
<div class="tac pull-right" id="cbox_ctl_btns">
<a href="javascript:void(0);" class="btn btn-success btn-sm" id="confirm_yes"
onclick="changeStatusAction($('#status_selector').attr('name'),$('#status_selector').val());">确定</a>
<a href="javascript:void(0);" class="btn btn-danger btn-sm" id="confirm_no" onclick="$.colorbox.close();">取消</a>
</div>
</div>
</div>
</div>
<script>
function changeStatus(project,status)
{
$('#status_selector').attr('name',project);
$.colorbox({
initialHeight: '0',
initialWidth: '0',
href: "#confirm_dialog",
inline: true,
opacity: '0.7'
});
}
function changeStatusAction(project,code)
{
$.ajax({
'type':"POST",
'url':'/admin/data/project/ac/changestatus',
'data':'p='+project + '&s='+code,
'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.status)!='undefined')
{$('#status_alias_'+project).html(data.status);}
}
else{
Alert('出现错误,请稍后再试');
}
},
'timeout': 30000,
'error': function(){Alert('处理中出现错误,请刷新页面后重试');}
});
}
function invite(id){
var dom = "#inviteBtn_"+id;
var html = $(dom).html();
$.ajax({
'type':"POST",
'url':'/admin/data/project/ac/invite',
'data':'id='+id+'&name='+$('#expert_name_'+id).val()+'&email='+$('#expert_email_'+id).val(),
'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.invited)!='undefined')
{$('#expert_name_'+id).val('');$('#expert_email_'+id).val('');}
}
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:"50%", height:"50%"});
</script>