后台离线申请管理中添加了上传申请表、重置申请表,查看申请表的功能

This commit is contained in:
Li Jianxuan 2013-09-05 01:56:30 +00:00
parent 3f4c945dbf
commit 04dbd9eeb9
11 changed files with 569 additions and 14 deletions

View File

@ -1,8 +1,9 @@
<?php <?php
use Helper\View as view; use Helpers\View as view;
use Files\Files; use Files\Files;
use Files\Output; use Files\Output;
use Files\Listener\FileListener; use Files\Listener\FileListener;
use Order\Manager\Offlineapp;
class Admin_DownController extends Zend_Controller_Action class Admin_DownController extends Zend_Controller_Action
{ {
@ -24,6 +25,135 @@ class Admin_DownController extends Zend_Controller_Action
//其他连接 //其他连接
} }
//新离线数据申请管理
function offlineappsAction()
{
$this->view->navIn = $ac = $this->_getParam('ac');
$this->view->offlineAppId = $offlineappid = $this->_getParam('offlineappid');
$submit = $this->_getParam('submit');
$search = $this->_getParam('search');
if(empty($ac))
{
$this->view->navIn = $ac = "notreceived";
}
if($ac == "view")
{
if(empty($offlineappid))
{
view::Post($this,"参数错误",-1);
return true;
}
$offlineapp = new Offlineapp();
if(view::isXmlHttpRequest() !== true)
{
$this->_helper->viewRenderer('offlineapps-view');
$this->view->data = $offlineapp->getOneAppInfo($offlineappid);
}else{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$this->jsonexit($offlineapp->getOneAppInfo($offlineappid));
}
return true;
}
if($ac == "notreceived")
{
$this->_helper->viewRenderer('offlineapps-notreceived');
$offlineapp = new Offlineapp();
$data = $offlineapp->fetchNotReceived();
view::addPaginator($data,$this,20);
return true;
}//未接收的
if($ac == "nopdf")
{
$this->_helper->viewRenderer('offlineapps-nopdf');
$offlineapp = new Offlineapp();
$data = $offlineapp->fetchNoPdf();
view::addPaginator($data,$this,20);
return true;
}//没有上传申请表的
if($ac == "notpassed")
{
$this->_helper->viewRenderer('offlineapps-notpassed');
$offlineapp = new Offlineapp();
$data = $offlineapp->fetchNotApprove();
view::addPaginator($data,$this,20);
return true;
}
//接收
if($ac == "receive")
{
$offlineapp = new Offlineapp();
$statue = $offlineapp->receive($offlineappid);
if($statue !== true)
{
view::Post($this,$statue);
}else{
view::Post($this,"接收成功",-1);
}
return true;
}
//发送给作者
if($ac == "toauthor")
{
$this->_helper->viewRenderer('offlineapps-toauthor');
if(empty($submit))
{
}else{
$offlineapp = new Offlineapp();
}
return true;
}
//退回
if($ac == "return")
{
if(empty($offlineappid))
{
view::Post($this,"参数错误",-1);
return true;
}
if(empty($submit))
{
}
return true;
}
//重置申请表
if($ac == "resetappform")
{
if(empty($offlineappid))
{
view::Post($this,"参数错误",-1);
return true;
}
$offlineapp = new Offlineapp();
$statue = $offlineapp->resetAppForm($offlineappid);
if($statue !== true)
{
view::Post($this,$statue);
}else{
view::Post($this,"重置成功",-1);
}
return true;
}
}
//离线数据申请管理 //离线数据申请管理
function offlineappAction() function offlineappAction()
{ {
@ -70,9 +200,9 @@ class Admin_DownController extends Zend_Controller_Action
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); $mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->send(); $mail->send();
$sql="select pdflink from offlineapp where id=?"; $sql="SELECT applicationform FROM dataorder WHERE offlineappid=$start";
$row=$this->db->fetchRow($sql,array($start)); $row=$this->db->fetchRow($sql,array($start));
$filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['pdflink']); $filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['applicationform']);
//对每条数据的管理员用户发送相应的邮件通知,同一用户的邮件需要合并 //对每条数据的管理员用户发送相应的邮件通知,同一用户的邮件需要合并
//需要取出对应数据的标题、uuid以及对应的作者的email一条数据可能有多个作者一次申请可能有多条数据对应同一个作者 //需要取出对应数据的标题、uuid以及对应的作者的email一条数据可能有多个作者一次申请可能有多条数据对应同一个作者
@ -644,7 +774,7 @@ class Admin_DownController extends Zend_Controller_Action
$this->jsonexit($statu); $this->jsonexit($statu);
return true; return true;
}else{ }else{
$sql = "UPDATE dataorder SET applicationform='{$statu['file']}' WHERE id=$id"; $sql = "UPDATE dataorder SET applicationform='{$statu['file']}' WHERE offlineappid=$id";
if($this->db->exec($sql)) if($this->db->exec($sql))
{ {
$this->jsonexit(array("success"=>1)); $this->jsonexit(array("success"=>1));
@ -656,6 +786,20 @@ class Admin_DownController extends Zend_Controller_Action
} }
} }
public function applicationformAction()
{
$ac = $this->_getParam('ac');
if($ac == "view")
{
$link = $this->_getParam('link');
$content=file_get_contents($link);
header("Content-Disposition: inline; filename=applicationform.pdf");
header("Content-Type:application/pdf");
echo $content;
exit();
}
}
//离线数据服务记录 //离线数据服务记录
function offlineAction() function offlineAction()
{ {

View File

@ -1,6 +1,7 @@
<ul> <ul>
<li class="title">申请管理与在线下载记录</li> <li class="title">申请管理与在线下载记录</li>
<li><a href="/admin/down/offlineapp">离线数据申请管理</a></li> <li><a href="/admin/down/offlineapp">离线数据申请管理</a></li>
<li><a href="/admin/down/offlineapps">离线数据申请管理(新)</a></li>
<li><a href="/admin/down/offline">离线数据服务记录</a></li> <li><a href="/admin/down/offline">离线数据服务记录</a></li>
<li><a href="/admin/down/fixoffline">手动同步离线申请用户与网站帐号</a></li> <li><a href="/admin/down/fixoffline">手动同步离线申请用户与网站帐号</a></li>
<li><a href="/admin/down/online">在线数据下载记录从20110908开始</a></li> <li><a href="/admin/down/online">在线数据下载记录从20110908开始</a></li>

View File

@ -77,9 +77,10 @@
<a href="javascript:action('deleted',<?= $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('deny',<?= $item['id']; ?>);" onclick="return confirm('确定拒绝该申请?')">拒绝</a> |
<a href="javascript:action('reset',<?= $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['orderid'] ?>);">上传申请表</a> <a href="javascript:void(0);" onclick="upload.showUploadForm(<?= $item['id'] ?>);">上传申请表</a>
<?php if(!empty($item['applicationform'])) { ?> <?php if(!empty($item['applicationform'])) { ?>
| <a href="javascript:void(0);" onclick="download(<?= $item['orderid'] ?>)">下载申请表</a> | <a href="/admin/down/applicationform/ac/view/?link=<?= urlencode($item['applicationform'])?>">查看申请表</a>
| <a href="/admin/down/offlineapps/ac/resetappform/?offlineappid=<?= $item['id'] ?>">重置申请表</a>
<?php }?> <?php }?>
</p> </p>
</li> </li>

View File

@ -0,0 +1,15 @@
<ul class="nav nav-pills">
<li class="<?= $this->navIn == "notreceived" ? "active":"" ?>">
<a href="/admin/down/offlineapps/ac/notreceived">未接收</a>
</li>
<li class="<?= $this->navIn == "nopdf" ? "active":"" ?>">
<a href="/admin/down/offlineapps/ac/nopdf">已接收未上传申请表</a>
</li>
<li class="<?= $this->navIn == "notpassed" ? "active":"" ?>">
<a href="/admin/down/offlineapps/ac/notpassed">待审批</a>
</li>
<li class="<?= $this->navIn == "passed" ? "active":"" ?>">
<a href="/admin/down/offlineapps/ac/passed">已上传申请表已通过</a>
</li>
</ul>

View File

@ -0,0 +1,73 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb()->setSeparator(' > ');
$this->Theme->AppendPlus($this,'colorbox');
$this->Theme->AppendPlus($this,'uploadify');
$this->Theme->AppendModel($this,'admin-down-offlineapps');
$this->Theme->AppendModel($this,'sfadmin');
function applicationform($form)
{
if(empty($form))
{
return "未提交";
}else{
return '<a href="/admin/down/applicationform/ac/download">点击下载</a>';
}
}
?>
<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 class="span9">
<?= $this->partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?>
<form action="" method="get" class="search input-append">
<input type="hidden" name="search" value='1' />
<input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<button type="submit" class="btn">搜索</button>
</form>
<table class="table table-bordered table-hover"><thead>
<tr>
<th><input type="checkbox" class="select_rows" data-tbody="list" /></th>
<th>申请者</th>
<th>提交时间</th>
<th>申请表</th>
<th>操作</th>
</tr></thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><input type="checkbox" class="select_item" value="<?= $item['orderid']?>" /></td>
<td><?php echo $item['realname'].'['.$item['username'].'] <span title="'.$item['title'].'">'.mb_substr($item['title'],0,15,"UTF-8")."</span>";echo mb_strlen($item['title'],"UTF-8") > 15 ? "...":"";?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td>
<td><?= applicationform($item['applicationform']) ?></td>
<td>
<a href="/admin/down/offlineapps/ac/view/?offlineappid=<?= $item['id'] ?>">查看详细</a>
<a href="/admin/down/offlineapps/ac/receive/?offlineappid=<?= $item['id'] ?>">接收</a>
<a href="/admin/down/offlineapps/ac/return/?offlineappid=<?= $item['id'] ?>">退回</a>
<a href="javascript:void(0);" onclick="upload.showUploadForm(<?= $item['id'] ?>);">上传申请表</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div><!-- span9 -->
</div>
<script>
var _this = {};
sfadmin.init();
</script>
<?= $this->partial('down/offlineapps-uploaderform.phtml'); ?>

View File

@ -0,0 +1,73 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb()->setSeparator(' > ');
$this->Theme->AppendPlus($this,'colorbox');
$this->Theme->AppendPlus($this,'uploadify');
$this->Theme->AppendModel($this,'admin-down-offlineapps');
$this->Theme->AppendModel($this,'sfadmin');
function applicationform($form)
{
if(empty($form))
{
return "未提交";
}else{
return '<a href="/admin/down/applicationform/ac/download">点击下载</a>';
}
}
?>
<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 class="span9">
<?= $this->partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?>
<form action="" method="get" class="search input-append">
<input type="hidden" name="search" value='1' />
<input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<button type="submit" class="btn">搜索</button>
</form>
<table class="table table-bordered table-hover"><thead>
<tr>
<th><input type="checkbox" class="select_rows" data-tbody="list" /></th>
<th>申请者</th>
<th>提交时间</th>
<th>申请表</th>
<th>操作</th>
</tr></thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><input type="checkbox" class="select_item" value="<?= $item['orderid']?>" /></td>
<td><?php echo $item['realname'].'['.$item['username'].'] <span title="'.$item['title'].'">'.mb_substr($item['title'],0,15,"UTF-8")."</span>";echo mb_strlen($item['title'],"UTF-8") > 15 ? "...":"";?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td>
<td><?= applicationform($item['applicationform']) ?></td>
<td>
<a href="/admin/down/offlineapps/ac/view/?offlineappid=<?= $item['id'] ?>">查看详细</a>
<a href="/admin/down/offlineapps/ac/toauthor/?offlineappid=<?= $item['id'] ?>">发给作者</a>
<a href="javascript:void(0);" onclick="upload.showUploadForm(<?= $item['id'] ?>);">上传申请表</a>
<a href="/admin/down/offlineapps/ac/resetappform/?offlineappid=<?= $item['id'] ?>" onclick="return confirm('是否确认重置该用户的申请表?')">重置申请表</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div><!-- span9 -->
</div>
<script>
var _this = {};
sfadmin.init();
</script>
<?= $this->partial('down/offlineapps-uploaderform.phtml'); ?>

View File

@ -0,0 +1,74 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb()->setSeparator(' > ');
$this->Theme->AppendPlus($this,'colorbox');
$this->Theme->AppendPlus($this,'uploadify');
$this->Theme->AppendModel($this,'admin-down-offlineapps');
$this->Theme->AppendModel($this,'sfadmin');
function applicationform($form)
{
if(empty($form))
{
return "未提交";
}else{
return '<a href="/admin/down/applicationform/ac/download">点击下载</a>';
}
}
?>
<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 class="span9">
<?= $this->partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?>
<form action="" method="get" class="search input-append">
<input type="hidden" name="search" value='1' />
<input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<button type="submit" class="btn">搜索</button>
</form>
<table class="table table-bordered table-hover"><thead>
<tr>
<th><input type="checkbox" class="select_rows" data-tbody="list" /></th>
<th>申请者</th>
<th>提交时间</th>
<th>申请表</th>
<th>操作</th>
</tr></thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><input type="checkbox" class="select_item" value="<?= $item['orderid']?>" /></td>
<td><?php echo $item['realname'].'['.$item['username'].'] <span title="'.$item['title'].'">'.mb_substr($item['title'],0,15,"UTF-8")."</span>";echo mb_strlen($item['title'],"UTF-8") > 15 ? "...":"";?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_created']));?></td>
<td><?= applicationform($item['applicationform']) ?></td>
<td>
<a href="/admin/down/offlineapps/ac/view/?offlineappid=<?= $item['id'] ?>">查看详细</a>
<a href="/admin/down/offlineapps/ac/receive/?offlineappid=<?= $item['id'] ?>">接收</a>
<a href="/admin/down/offlineapps/ac/return/?offlineappid=<?= $item['id'] ?>">退回</a>
<a href="javascript:void(0);" onclick="upload.showUploadForm(<?= $item['id'] ?>);">上传申请表</a>
<a href="/admin/down/offlineapps/ac/resetappform/?offlineappid=<?= $item['id'] ?>" onclick="return confirm('是否确认重置该用户的申请表?')">重置申请表</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div><!-- span9 -->
</div>
<script>
var _this = {};
sfadmin.init();
</script>
<?= $this->partial('down/offlineapps-uploaderform.phtml'); ?>

View File

@ -0,0 +1,42 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb()->setSeparator(' > ');
$this->Theme->AppendPlus($this,'colorbox');
$this->Theme->AppendPlus($this,'uploadify');
$this->Theme->AppendModel($this,'admin-down-offlineapps');
$this->Theme->AppendModel($this,'sfadmin');
function applicationform($form)
{
if(empty($form))
{
return "未提交";
}else{
return '<a href="/admin/down/applicationform/ac/download">点击下载</a>';
}
}
?>
<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 class="span9">
<?= $this->partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?>
<h2>发给作者</h2>
</div><!-- span9 -->
</div>
<script>
var _this = {};
sfadmin.init();
</script>
<?= $this->partial('down/offlineapps-uploaderform.phtml'); ?>

View File

@ -0,0 +1,19 @@
<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">允许上传20M以内的 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>
_this.SessionID = '<?php echo session_id(); ?>';
</script>

View File

@ -0,0 +1,63 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb()->setSeparator(' > ');
$this->Theme->AppendPlus($this,'colorbox');
$this->Theme->AppendPlus($this,'uploadify');
$this->Theme->AppendModel($this,'admin-down-offlineapps');
$this->Theme->AppendModel($this,'sfadmin');
function applicationform($form)
{
if(empty($form))
{
return "未提交";
}else{
return '<a href="/admin/down/applicationform/ac/download">点击下载</a>';
}
}
?>
<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 class="span9">
<?= $this->partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?>
<h2>查看详细</h2>
<ul>
<li>申请者:<?= $this->data[0]['username'] ?></li>
<li>单位:<?= $this->data[0]['unit'] ?></li>
<li>电话:<?= $this->data[0]['phone'] ?></li>
<li>地址:<?= $this->data[0]['address'] ?></li>
<li>邮编:<?= $this->data[0]['postcode'] ?></li>
<li>未签字pdf<?= $this->data[0]['pdflink'] ?></li>
<li>签字pdf<?= ( isset($this->data[0]['applicationform']) && !empty($this->data[0]['applicationform'])) ? '<a href="">查看</a> <a href="">下载</a>':"未提交"?></li>
<li>数据列表:<?= $this->data[0]['datalist'] ?></li>
<li>邮箱:<?= $this->data[0]['email'] ?></li>
<li>项目编号:<?= $this->data[0]['project_id'] ?></li>
<li>项目类型:<?= $this->data[0]['project_type'] ?></li>
<li>项目名称:<?= $this->data[0]['project_title'] ?></li>
<li>项目负责人:<?= $this->data[0]['leader'] ?></li>
<li>项目负责人职称:<?= $this->data[0]['leadertitle'] ?></li>
<li>项目介绍:<?= $this->data[0]['project'] ?></li>
<li>申请时间:<?= $this->data[0]['ts_created'] ?></li>
<li>接收时间:<?= $this->data[0]['ts_received'] ?></li>
<li>通过时间:<?= $this->data[0]['ts_approved'] ?></li>
</ul>
</div><!-- span9 -->
</div>
<script>
var _this = {};
sfadmin.init();
</script>
<?= $this->partial('down/offlineapps-uploaderform.phtml'); ?>

View File

@ -0,0 +1,50 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->breadcrumb()->setSeparator(' > ');
?>
<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 class="span9">
<?= $this->partial('down/offlineapps-navpills.phtml',array('navIn'=>$this->navIn)); ?>
<form action="" method="get" class="search input-append">
<input type="hidden" name="search" value='1' />
<input type="text" name="keyword" class="q" value="<?php echo $this->keyword; ?>" />
<button type="submit" class="btn">搜索</button>
</form>
<table class="table table-bordered table-hover"><thead>
<tr>
<th width='600'>元数据标题</th>
<th width='120'>责任编辑</th>
<th width='120'>接收时间</th>
<th width='180'>操作</th>
</tr></thead>
<?php if (count($this->paginator)): ?>
<tbody id="list">
<?php foreach ($this->paginator as $item): ?>
<tr>
<td><a href="/data/<?php echo $item['uuid'];?>"><?= $item['title']?></a></td>
<td><?php echo $item['realname'].'['.$item['username'].']'; ?></td>
<td><?php echo date("Y-m-d H:i",strtotime($item['ts_accepted']));?></td>
<td>
<a href="/admin/review/changeadmin/?id=<?php echo $item['id'];?>">分配编辑</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
<div class="pagenavi"><?= $this->paginator; ?></div>
</div><!-- span9 -->
</div>