恢复reviewcontroller中的错误

newscontroller中增加了newslist动作和视图
This commit is contained in:
Li Jianxuan 2011-10-21 08:12:04 +00:00
parent 5f50f2b2cd
commit 5a73f9e78d
3 changed files with 145 additions and 8 deletions

View File

@ -17,15 +17,22 @@ class Admin_NewsController extends Zend_Controller_Action
{ {
}//indexAction 首页 }//indexAction 首页
function listAction(){ function newslistAction(){
}
$sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id";
$rs = $this->db->query($sql);
$rows = $rs->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_param.phtml');
$this->view->paginator=$paginator;
}//newslistAction 新闻列表
function catlogAction() function catlogAction()
{ {

View File

@ -358,13 +358,15 @@ class Admin_ReviewController extends Zend_Controller_Action
$mail->addTo($row['email']); $mail->addTo($row['email']);
$mail->setSubject($mailtp->getSubject()); $mail->setSubject($mailtp->getSubject());
$filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid); $filecontent=file_get_contents("http://" . $_SERVER['HTTP_HOST'].'/data/doc/review/1/uuid/'.$uuid);
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, base64_encode($row['title'].'.doc')); $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, $row['title'].'.doc');
if($mail->send()) if($mail->send())
{ {
$this->messenger->addMessage('成功再次邀请专家:'.$row['realname']); $this->messenger->addMessage('成功再次邀请专家:'.$row['realname']);
$this->_redirect("/admin/review/inreview/show/$id");
}else }else
{ {
$this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件'); $this->messenger->addMessage('邀请专家'.$row['realname'].'的邮件发送失败,请尝试手动发送邀请邮件');
$this->_redirect("/admin/review/inreview/show/$id");
} }
} }
$searchjoin = ""; $searchjoin = "";

View File

@ -0,0 +1,128 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/static/js/jquery.dataTables.min.js');
?>
<!-- Page title -->
<div id="pagetitle">
<div class="wrapper">
<h1>新闻中心</h1>
<!-- Quick search box -->
<form action="" method="get"><input class="" type="text" id="q" name="q" /></form>
</div>
</div>
<!-- End of Page title -->
<!-- Page content -->
<div id="page">
<!-- Wrapper -->
<div class="wrapper">
<!-- Right column/section -->
<aside class="column width2 first">
<?= $this->partial('news/left.phtml'); ?>
</aside>
<!-- End of Right column/section -->
<!-- Left column/section -->
<section class="column width6">
<h3>新闻列表</h3>
<hr/>
<div>
<a href="/admin/news/newslist">新闻列表</a>
</div>
<?php if ($this->msg or $this->messages) :?>
<div class="box box-info">
<?php if ($this->msg) : ?>
<?php echo $this->msg; ?>
<?php endif; if ($this->messages): foreach($this->messages as $msg): ?>
<?php echo $msg; ?>
<?php endforeach;endif; ?>
<script language="javascript">
setTimeout('$(".box-info").remove()',5000);
</script>
</div>
<?php endif; ?>
<table id="report" class="stylized full" style="">
<thead>
<tr>
<th width="50%">新闻标题</th>
<th width="25%">所属栏目</th>
<th width="25%">新闻管理</th>
</tr>
</thead>
<tbody>
<?php
if(count($this->paginator))
{
foreach ($this->paginator as $v)
{
echo '
<tr>
<td class="title">
<div id="paddiv'.$v['id'].'">
<a id="titlebtn'.$v['id'].'"><b>'.$v['title'].'</b></a>
<div class="listingDetails">
<div class="pad">
<b>详细信息</b>
<p>作者:'.$v['writer'].'</p>
<p>关键词:'.$v['keyword'].'</p>
<p>描述:'.$v['description'].'</p>
<p>添加时间:'.date("Y-m-d H:i",$v['writetime']).'</p>
<p>发布时间:'.date("Y-m-d H:i",$v['pubtime']).'</p>
<p>来源:'.$v['source'].'</p>
<p>点击:'.$v['click'].'</p>
</div>
</div></div>
</td>
<td>'.$v['catlog'].'</td>
<td>
<a href="javascript:showpad('.$v['id'].');"><b>编辑</b></a>
<a href="/admin/news/catlog/delete/'.$v['id'].'" onclick="return confirm(\'是否确定删除该栏目\')">删除</a></td>
</tr>
';
}
}
else
{
echo '
<tr><td>暂无数据</td><td></td></tr>
';
}
?>
</tbody>
</table>
<hr/>
<div class="pagenavi"><?= $this->paginator; ?></div>
</section>
<!-- End of Left column/section -->
</div>
<!-- End of Wrapper -->
</div>
<!-- End of Page content -->
<script type="text/javascript">
$('#nav_news').addClass("current");
$(document).ready(function(){
/* setup navigation, content boxes, etc... */
Administry.setup();
/* expandable rows */
Administry.expandableRows();
});
function showpad(id){
$('#titlebtn'+id).click();
}
</script>