200 lines
7.8 KiB
PHTML
200 lines
7.8 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/down">申请管理</a>');
|
||
$this->Theme->AppendPlus($this,'colorbox');
|
||
$this->Theme->AppendPlus($this,'uploadify');
|
||
$this->breadcrumb('离线数据申请管理</a>');
|
||
$this->breadcrumb()->setSeparator(' > ');
|
||
?>
|
||
<div class="row-fluid">
|
||
<div class="span2">
|
||
<?= $this->partial('down/left.phtml'); ?>
|
||
</div>
|
||
<div class="span10">
|
||
<?php if ($this->msg or $this->messages) :?>
|
||
<div id="message">
|
||
<?php if ($this->msg) : ?>
|
||
<p><?php echo $this->msg; ?></p>
|
||
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
|
||
<p><?php echo $msg; ?></p>
|
||
<?php endforeach;endif; ?>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<h4>离线数据申请管理</h4>
|
||
|
||
<div style="overflow:hidden">
|
||
<div class="pull-left">
|
||
<a href="/admin/down/offlineapp/status/4" class="btn btn-info">已收到的申请</a>
|
||
<a href="/admin/down/offlineapp/status/-1" class="btn btn-info">已拒绝的申请</a>
|
||
<a href="/admin/down/offlineapp/ac/pending" class="btn btn-info">待处理的申请</a>
|
||
<a href="/admin/down/offline" class="btn btn-info">已通过的申请(离线服务记录)</a>
|
||
</div>
|
||
|
||
<div class="input-append pull-right">
|
||
<form id="datasearch" class="search_form" action="">
|
||
<input type="text" id="keyword" name="q" value="<?php if(!empty($this->q)) echo $this->q; ?>" />
|
||
<input type="hidden" name="order" value="<?php if(!empty($this->search_order)) echo $this->search_order; ?>" />
|
||
<input type="hidden" name="sort" value="<?php if(!empty($this->search_sort)) echo $this->search_sort; ?>" />
|
||
<button type="submit" class="btn" id="search_btn">搜索</button>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="datalist" style="overflow:hidden">
|
||
<?php
|
||
if (count($this->paginator)):
|
||
echo '<ul class="unstyled">';
|
||
$autoindex=0;
|
||
foreach ($this->paginator as $item):
|
||
$autoindex++;?>
|
||
<li id="list_<?php echo $item['id'];?>" class="well well-small">
|
||
<p>
|
||
<?= $autoindex ?>.
|
||
<a href="mailto:<?= $item['email']; ?>?subject=答复数据申请问题"><?= $item['username']; ?></a> |
|
||
申请时间:<?= date('Y-m-d',strtotime($item['ts_created'])); ?>
|
||
<?php if(!empty($item['ts_received'])) echo " | 收到时间:".date('Y-m-d',strtotime($item['ts_received']));?>
|
||
</p>
|
||
<p>
|
||
单位:<?= $item['unit']; ?> |
|
||
地址:<?= $item['address']; ?> |
|
||
邮编:<?= $item['postcode']; ?>
|
||
</p>
|
||
<p>
|
||
用途:
|
||
<p style="width:95%;margin:0px auto;"><q><cite><?= $item['project'].'['.$item['project_title'].' | '.$item['project_type'].' | '.$item['project_id'].']'; ?></cite></q></p>
|
||
</p>
|
||
<p>
|
||
数据清单:<?= $item['datalist']; ?>
|
||
</p>
|
||
<p>
|
||
<a href="/admin/down/offlineapp/view/<?= $item['id']; ?>">原始申请表</a> |
|
||
<?php if ($item['datastatus']==3) : ?>
|
||
<span id="start_<?= $item['id']; ?>"><a href="javascript:action('start',<?= $item['id']; ?>);" onclick="return confirm('确定收到该申请?')">收到</a></span> |
|
||
<?php endif; ?>
|
||
<a href="javascript:action('finish',<?= $item['id']; ?>);" onclick="return confirm('确定确定通过该申请?')">通过</a> |
|
||
<a href="javascript:action('deleted',<?= $item['id']; ?>);" onclick="return confirm('确定将此记录删除?')">删除</a> |
|
||
<a href="javascript:action('deny',<?= $item['id']; ?>);" onclick="return confirm('确定拒绝该申请?')">拒绝</a> |
|
||
<a href="javascript:action('reset',<?= $item['id']; ?>);" onclick="return confirm('是否重置该申请?')">重置</a> |
|
||
<a href="javascript:void(0);" onclick="upload.showUploadForm(<?= $item['id'] ?>);">上传签字申请表</a>
|
||
<?php if(!empty($item['applicationform'])) { ?>
|
||
| <a href="/admin/down/applicationform/ac/view/?link=<?= urlencode($item['applicationform'])?>">查看签字申请表</a>
|
||
| <a href="/admin/down/offlineapps/ac/resetappform/?offlineappid=<?= $item['id'] ?>" onclick="return confirm('是否重置该申请表?')">重置申请表</a>
|
||
<?php }?>
|
||
</p>
|
||
</li>
|
||
<?php endforeach;
|
||
echo "</ul>";
|
||
endif; ?>
|
||
<div class="pagenavi"><?= $this->paginator; ?></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="upload-form" class="modal hide fade" tabindex="-1" aria-hidden="true">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h3 id="myModalLabel">申请表上传</h3>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form id="application-form">
|
||
<div id="fsUploadProgress">允许上传30M以内的 PDF 文件</div>
|
||
<input type="file" name="Filedata" id="file_upload" />
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn" data-dismiss="modal" aria-hidden="true">取消上传</button>
|
||
<button class="btn btn-primary">上传完成</button>
|
||
</div>
|
||
</div>
|
||
<script>
|
||
//var param = {};
|
||
//var upload_count = 0;
|
||
var uploader;
|
||
var param;
|
||
$(function() {
|
||
$('#file_upload').uploadify({
|
||
'swf' : '/js/lib/uploadify/uploadify.swf',
|
||
'uploader' : '/admin/down/uploadapplicationform',
|
||
'multi' : false,
|
||
'auto' : true,
|
||
'fileTypeExts' : '*.pdf; *.jpg',
|
||
'onUploadSuccess' : function(file, data, response) {
|
||
upload.onsuccess(file, data, response);
|
||
},
|
||
'onUploadStart' : function(file) {
|
||
$('#file_upload').uploadify('settings','formData',param);
|
||
}
|
||
});
|
||
});
|
||
|
||
var upload = {
|
||
onsuccess : function(file, data, response){
|
||
_data = $.parseJSON(data);
|
||
if(!$.isEmptyObject(_data.error))
|
||
{
|
||
alert(_data.error);
|
||
}else{
|
||
$('#upload-form').modal('hide');
|
||
window.location = window.location;
|
||
}
|
||
},
|
||
showUploadForm : function(id){
|
||
$('#upload-form').modal('show');
|
||
param = {
|
||
"PHPSESSID" : "<?php echo session_id(); ?>",
|
||
'orderid' : id
|
||
};
|
||
}
|
||
};
|
||
|
||
function action(name,id){
|
||
var url;
|
||
if(name == "start")
|
||
{url = '/admin/down/offlineapp/start/'+id;}
|
||
if(name == "finish")
|
||
{url = '/admin/down/offlineapp/finish/'+id;}
|
||
if(name == "deleted")
|
||
{url = '/admin/down/offlineapp/cancel/'+id;}
|
||
if(name == "deny")
|
||
{url = '/admin/down/offlineapp/deny/'+id;}
|
||
if(name == "reset")
|
||
{url = '/admin/down/offlineapp/reset/'+id;}
|
||
$.ajax({
|
||
'type':"POST",
|
||
'url':url,
|
||
'data':'',
|
||
'success':OnDataLoad,
|
||
'timeout': 30000,
|
||
'error': AjaxError
|
||
});
|
||
}
|
||
function OnDataLoad(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.started)!='undefined')
|
||
{$('#start_'+data.started).remove();}
|
||
if(typeof(data.finish) != 'undefined')
|
||
{$('#list_'+data.finish).fadeOut();}
|
||
}
|
||
else{
|
||
Alert('出现错误,请稍后再试');
|
||
}
|
||
}
|
||
function AjaxError(){
|
||
$.colorbox({'innerWidth':'50%','html':'<img src="/images/alert_big_error.png" /><h4>处理中出现错误,请刷新页面后重试</h4>'});
|
||
}
|
||
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
|
||
$(".inline").colorbox({inline:true, width:"50%"});
|
||
function Alert(html){
|
||
$.colorbox({'innerWidth':'50%','html':'<h4 style="font-size:16px;font-weight:bold;">'+html+'</h4>'});
|
||
}
|
||
</script>
|