添加了离线下载记录中更新PDF的功能

This commit is contained in:
Li Jianxuan 2014-01-07 07:01:25 +00:00
parent a6efab68c9
commit 329a25b59e
1 changed files with 84 additions and 20 deletions

View File

@ -2,21 +2,23 @@
$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/down">申请管理</a>');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/colorbox.css');
$this->Theme->AppendPlus($this,'colorbox');
$this->Theme->AppendPlus($this,'uploadify');
$this->breadcrumb('离线数据申请管理</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="leftPanel">
<style>
table thead tr th {background:#EBF2F6;color:#444;}
.high{background:#444;color:#FFF;}
</style>
<div class="row-fluid">
<div class="span3">
<?= $this->partial('down/left.phtml'); ?>
</div>
<div id="rightPanel">
<div class="span9">
<?php if ($this->msg or $this->messages) :?>
<div id="message">
<?php if ($this->msg) : ?>
@ -42,35 +44,39 @@
</div>
<?php if (count($this->paginator)): ?>
<table>
<table class="table table-bordered table-hover">
<thead><tr>
<th width='70'>姓名</th>
<th width='150'>单位</th>
<th width='150'>地址</th>
<th width='50'>邮编</th>
<th width='300'>用途</th>
<th width='300'>数据清单</th>
<th width='120'>申请时间</th>
<th width='100'>操作</th>
<th width="52">姓名</th>
<th>单位</th>
<th>地址</th>
<th>邮编</th>
<th>用途</th>
<th>数据清单</th>
<th>申请时间</th>
<th>操作</th>
</tr></thead>
<tbody>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr class="<?php if($autoindex%2 == 0) echo 'even'; else echo 'odd'; ?>">
<td><a href="/admin/user/show/id/<?php echo $item['userid'];?>"><img src="/images/user.gif" /></a> <a href="/admin/down/user/show/<?php echo $item['userid'];?>"><?= $item['username']?></a> </td>
<td><a href="/admin/down/user/show/<?php echo $item['userid'];?>"><?= $item['username']?></a> </td>
<td><?= $item['unit']; ?></td>
<td><?= $item['address']; ?></td>
<td><?= $item['postcode']; ?></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['project'].'['.$item['project_title'].' | '.$item['project_type'].' | '.$item['project_id'].']'; ?></textarea></td>
<td><textarea readonly="readonly" style="width:300px;height:100px;border:none;font-size:12px;<?php if($autoindex%2 == 0) echo 'background:#CCCCCC;'; else echo 'background:#FFF;'; ?>"><?= $item['datalist']; ?></textarea></td>
<td><textarea readonly="readonly" style="width:280px;height:100px;border:none;font-size:12px;"><?= $item['project'].'['.$item['project_title'].' | '.$item['project_type'].' | '.$item['project_id'].']'; ?></textarea></td>
<td><textarea readonly="readonly" style="width:280px;height:100px;border:none;font-size:12px;"><?= $item['datalist']; ?></textarea></td>
<td><?= date('Y-m-d',strtotime($item['ts_created'])); ?></td>
<td>
<a href="/admin/down/offline/edit/<?= $item['id']; ?><?php if(empty($this->page)) "" ; else echo "/page/".$this->page; ?>">编辑</a> |
<a href="/admin/down/offline/delete/<?= $item['id']; ?>" title="该操作将删除此记录并且删除与此记录有关的申请记录!请谨慎操作" onclick="return confirm('请仅删除测试用途的离线服务记录!')">删除</a> |
<a href="/admin/down/offlineapp/view/<?= $item['id']; ?>">PDF</a> |
<a href="/admin/down/offline/show/<?= $item['id']; ?>">详细</a> |
<a href="javascript:action('finish',<?= $item['id']; ?>);" onclick="return confirm('确定确定重新通过该申请?')">重新通过</a>
<a href="javascript:action('finish',<?= $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>
<?php }?>
</td>
</tr>
<?php endforeach; ?>
@ -78,6 +84,64 @@
<?php endif; ?>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div>
</div><!-- row -->
<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
};
}
};
</script>
<script>
function action(name,id){
var url;