后台修改了查看在线申请时的查看项目,增加了按元数据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()
{
$delete=(int)$this->_getParam('delete');
$uuid = $this->_getParam('uuid');
if ($delete)
{
$sql="delete from comments where id=?";
@ -469,6 +471,33 @@ class Admin_DataController extends Zend_Controller_Action
}
$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->from('comments')
->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))
{
$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'))
->where('o.id in (select distinct(onlineappid) from dataorder)')
->order('o.id desc');

View File

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

View File

@ -1,42 +1,44 @@
<?php
$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->breadcrumb('详细信息');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/prototype.js');
?>
<div id="leftPanel">
<?= $this->partial('down/left.phtml'); ?>
</div>
<?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; ?>
<div id="rightPanel">
<table>
<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><?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['phone'];?></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['phone'];?></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><?php echo date('Y-m-d H:i:s', strtotime($this->infos['ts_created']));?></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>
</table>
<?php
$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->breadcrumb('详细信息');
$this->breadcrumb()->setSeparator(' > ');
$this->headScript()->appendFile('/js/prototype.js');
?>
<div id="leftPanel">
<?= $this->partial('down/left.phtml'); ?>
</div>
<?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; ?>
<div id="rightPanel">
<table>
<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><?php echo $this->infos['username'];?></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['unit'];?></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['postcode'];?></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>用途</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 $this->infos['project_title'];?></td></tr>
<tr><td>项目类型</td><td><?php echo $this->infos['project_type'];?></td></tr>
<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>