后台修改了查看在线申请时的查看项目,增加了按元数据uuid查看评论的功能

This commit is contained in:
Li Jianxuan 2012-06-06 09:45:19 +00:00
parent 65072d0317
commit bee9d5063f
4 changed files with 116 additions and 82 deletions

View File

@ -458,6 +458,8 @@ class Admin_DataController extends Zend_Controller_Action
function commentAction() function commentAction()
{ {
$delete=(int)$this->_getParam('delete'); $delete=(int)$this->_getParam('delete');
$uuid = $this->_getParam('uuid');
if ($delete) if ($delete)
{ {
$sql="delete from comments where id=?"; $sql="delete from comments where id=?";
@ -469,6 +471,33 @@ class Admin_DataController extends Zend_Controller_Action
} }
$this->_redirect("/admin/data/comment"); $this->_redirect("/admin/data/comment");
} }
if($uuid)
{
$sql = "SELECT c.*,md.title,md.uuid FROM comments c
LEFT JOIN metadata md ON md.uuid=c.uuid
WHERE c.uuid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($uuid));
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage($this->view->config->page->max);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$sql = "SELECT title FROM metadata WHERE uuid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($uuid));
$row = $sth->fetch();
$this->view->title = $row['title'];
return true;
}
$select=$this->db->select(); $select=$this->db->select();
$select->from('comments') $select->from('comments')
->joinLeft('metadata','metadata.uuid=comments.uuid','title') ->joinLeft('metadata','metadata.uuid=comments.uuid','title')

View File

@ -680,7 +680,7 @@ class Admin_DownController extends Zend_Controller_Action
if(empty($show) && empty($delete)) if(empty($show) && empty($delete))
{ {
$select=$this->db->select(); $select=$this->db->select();
$select->from('onlineapp as o',array('id','userid','unit','username','ts_created','project')) $select->from('onlineapp as o',array('id','userid','unit','username','ts_created','project','project_id','project_type','project_title'))
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid')) ->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->where('o.id in (select distinct(onlineappid) from dataorder)') ->where('o.id in (select distinct(onlineappid) from dataorder)')
->order('o.id desc'); ->order('o.id desc');

View File

@ -1,41 +1,44 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('后台管理'); $this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css'); $this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>'); $this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>'); $this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('数据反馈管理</a>'); $this->breadcrumb('数据反馈管理</a>');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div id="leftPanel"> <div id="leftPanel">
<?= $this->partial('data/left.phtml'); ?> <?= $this->partial('data/left.phtml'); ?>
</div> </div>
<div id="rightPanel"> <div id="rightPanel">
<?php if ($this->msg or $this->messages) :?> <?php if(isset($this->title)) {
<div id="message"> echo "元数据《".$this->title."》的所有评论";
<?php if ($this->msg) : ?> }?>
<p><?php echo $this->msg; ?></p> <?php if ($this->msg or $this->messages) :?>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <div id="message">
<p><?php echo $msg; ?></p> <?php if ($this->msg) : ?>
<?php endforeach;endif; ?> <p><?php echo $this->msg; ?></p>
</div> <?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<?php endif; ?> <p><?php echo $msg; ?></p>
<?= $this->paginator; ?> <?php endforeach;endif; ?>
<?php if (count($this->paginator)): ?> </div>
<div id="comments"> <?php endif; ?>
<?php foreach ($this->paginator as $item): ?> <?= $this->paginator; ?>
<ul> <?php if (count($this->paginator)): ?>
<li>用户名:<?php ($item['url'])?print '<a href="'.$item['url'].'">'.$item['author'].'</a>':print $item['author']; ?> <div id="comments">
EMAIL<?= $item['email']; ?> <?php foreach ($this->paginator as $item): ?>
[类型:<?= $item['type']; ?>,创建时间:<?= date('Y-m-d',strtotime($item['ts_created'])); ?> <ul>
。操作: <a href="/admin/data/comment/delete/<?= $item['id']; ?>">删除</a></li> <li>用户名:<?php ($item['url'])?print '<a href="'.$item['url'].'">'.$item['author'].'</a>':print $item['author']; ?>
<li>元数据:<a href="/data/<?= $item['uuid']; ?>"><?= $item['title']; ?></a></li> EMAIL<?= $item['email']; ?>
<li><?= $item['content']; ?></li> [类型:<?= $item['type']; ?>,创建时间:<?= date('Y-m-d',strtotime($item['ts_created'])); ?>
<li>IP:<?= $item['ip']; ?>AGENT:<?= $item['agent']; ?></li> 。操作: <a href="/admin/data/comment/delete/<?= $item['id']; ?>">删除</a></li>
</ul> <li>元数据:<a href="/data/<?= $item['uuid']; ?>"><?= $item['title']; ?></a></li>
<?php endforeach; ?> <li><?= $item['content']; ?></li>
</div> <li>IP:<?= $item['ip']; ?>AGENT:<?= $item['agent']; ?></li>
<?php endif; ?> </ul>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div> </div>

View File

@ -1,42 +1,44 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('后台管理'); $this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css'); $this->headLink()->appendStylesheet('/css/admin.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台管理首页</a>'); $this->breadcrumb('<a href="/admin">后台管理首页</a>');
$this->breadcrumb('<a href="/admin/down">申请管理</a>'); $this->breadcrumb('<a href="/admin/down">申请管理</a>');
$this->breadcrumb('详细信息'); $this->breadcrumb('详细信息');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/prototype.js'); $this->headScript()->appendFile('/js/prototype.js');
?> ?>
<div id="leftPanel"> <div id="leftPanel">
<?= $this->partial('down/left.phtml'); ?> <?= $this->partial('down/left.phtml'); ?>
</div> </div>
<?php if ($this->msg or $this->messages) :?> <?php if ($this->msg or $this->messages) :?>
<div id="message"> <div id="message">
<?php if ($this->msg) : ?> <?php if ($this->msg) : ?>
<p><?php echo $this->msg; ?></p> <p><?php echo $this->msg; ?></p>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?> <?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<p><?php echo $msg; ?></p> <p><?php echo $msg; ?></p>
<?php endforeach;endif; ?> <?php endforeach;endif; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div id="rightPanel">
<table>
<div id="rightPanel"> <tr><td>用户</td><td><a href="/admin/user/show/id/<?php echo $this->infos['uid'];?>"><?php echo $this->infos['uname'];?> </a> <a href="/admin/down/user/show/<?php echo $this->infos['uid'];?>">用户下载记录 </a></td></tr>
<table> <tr><td>姓名</td><td><?php echo $this->infos['username'];?></td></tr>
<tr><td>用户</td><td><a href="/admin/user/show/id/<?php echo $this->infos['uid'];?>"><?php echo $this->infos['uname'];?> </a> <a href="/admin/down/user/show/<?php echo $this->infos['uid'];?>">用户下载记录 </a></td></tr> <tr><td>数据</td><td><a href="/data/<?php echo $this->infos['uuid'];?>"><?php echo $this->infos['title'];?></a><a href="/admin/down/data/show/<?php echo $this->infos['uuid'];?>">数据下载记录</a></td></tr>
<tr><td>姓名</td><td><?php echo $this->infos['username'];?></td></tr> <tr><td>单位</td><td><?php echo $this->infos['unit'];?></td></tr>
<tr><td>单位</td><td><?php echo $this->infos['unit'];?></td></tr> <tr><td>电话</td><td><?php echo $this->infos['phone'];?></td></tr>
<tr><td>电话</td><td><?php echo $this->infos['phone'];?></td></tr> <tr><td>地址</td><td><?php echo $this->infos['address'];?></td></tr>
<tr><td>地址</td><td><?php echo $this->infos['address'];?></td></tr> <tr><td>邮编</td><td><?php echo $this->infos['postcode'];?></td></tr>
<tr><td>邮编</td><td><?php echo $this->infos['postcode'];?></td></tr> <tr><td>电话</td><td><?php echo $this->infos['phone'];?></td></tr>
<tr><td>电话</td><td><?php echo $this->infos['phone'];?></td></tr> <tr><td>Email</td><td><?php echo $this->infos['email'];?></td></tr>
<tr><td>Email</td><td><?php echo $this->infos['email'];?></td></tr> <tr><td>用途</td><td><textarea style="width:500px;height:200px;font-size:12px;"><?php echo $this->infos['project'];?></textarea></td></tr>
<tr><td>用途</td><td><textarea style="width:500px;height:200px;font-size:12px;"><?php echo $this->infos['project'];?></textarea></td></tr> <tr><td>项目编号</td><td><?php echo $this->infos['project_id'];?></td></tr>
<tr><td>时间</td><td><?php echo date('Y-m-d H:i:s', strtotime($this->infos['ts_created']));?></td></tr> <tr><td>项目标题</td><td><?php echo $this->infos['project_title'];?></td></tr>
<tr><td>数据</td><td><a href="/data/<?php echo $this->infos['uuid'];?>"><?php echo $this->infos['title'];?></a><a href="/admin/down/data/show/<?php echo $this->infos['uuid'];?>">数据下载记录</a></td></tr> <tr><td>项目类型</td><td><?php echo $this->infos['project_type'];?></td></tr>
</table> <tr><td>项目信息</td><td><?php echo $this->infos['project'];?></td></tr>
<tr><td>时间</td><td><?php echo date('Y-m-d H:i:s', strtotime($this->infos['ts_created']));?></td></tr>
</table>
</div> </div>