增加了查看在审状态数据的功能,修改了邀请专家的动作

This commit is contained in:
Li Jianxuan 2011-10-09 03:49:20 +00:00
parent 5aa28f17c7
commit cf732de1c1
3 changed files with 142 additions and 33 deletions

View File

@ -167,11 +167,45 @@ class Admin_ReviewController extends Zend_Controller_Action
function inreviewAction(){ function inreviewAction(){
} $show = $this->_request->getParam('show');
$search = $this->_request->getParam('search');
$keyword = $this->_request->getParam('keyword');
if($show>0)
{
}//查看详细
else
{
$sql = "select m.id,md.title,m.status from mdstatus m
left join metadata md on md.uuid=m.uuid
where m.status in (3,4)";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
foreach ($rows as $k=>$v)
{
$rows[$k]['status']=$this->rewiterstatus($v['status']);
}
$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;
}//列表
}//在审元数据
function inviteAction(){ function inviteAction(){
$id = $this->_request->getParam('id'); $id = $this->_request->getParam('id');
if(empty($id))
{
$this->_redirect("/admin/review");
}
$search = $this->_request->getParam('search'); $search = $this->_request->getParam('search');
$keyword = $this->_request->getParam('keyword'); $keyword = $this->_request->getParam('keyword');
$submit = $this->_request->getParam('submit'); $submit = $this->_request->getParam('submit');
@ -186,40 +220,59 @@ class Admin_ReviewController extends Zend_Controller_Action
{ {
if(is_array($exps)) if(is_array($exps))
{ {
echo "s"; $sql = "select m.uuid,m.title from metadata m
left join mdstatus s on s.uuid=m.uuid
where s.id='$id'";
$rs = $this -> db -> query($sql);
$md = $rs -> fetchAll();
$uuid = $md['uuid'];
foreach ($exps as $v)
{
$sql = "select id from mdexpertreview where uuid='$uuid' and ";
$sql = "insert into mdexpertreview ";
}
}
else
{
$this->messenger->addMessage('请选择要邀请的专家');
$this->_redirect("/admin/review/invite/?id=$id");
} }
} }
$searchjoin = "";
if(!empty($search) && !empty($keyword))
{
$searchjoin = " where u.username like '%$keyword%'
or u.realname like '%$keyword%'
or u.unit like '%$keyword%'
or u.email like '%$keyword%'";
$this->view->keyword = $keyword;
}
$sql = "select u.id,u.username,u.realname,u.unit,u.phone,u.email from users u
right join mdexperts me on u.id=me.id
$searchjoin";
$re = $this->db->query($sql);
$rows = $re->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;
$sql = "select m.title from metadata m $searchjoin = "";
left join mdstatus s on s.uuid=m.uuid if(!empty($search) && !empty($keyword))
where s.id='$id'"; {
$searchjoin = " where u.username like '%$keyword%'
$re = $this->db->query($sql); or u.realname like '%$keyword%'
$title = $re->fetch(); or u.unit like '%$keyword%'
$this->view->md=$title; or u.email like '%$keyword%'";
$this->view->keyword = $keyword;
}
$sql = "select u.id,u.username,u.realname,u.unit,u.phone,u.email from users u
right join mdexperts me on u.id=me.id
$searchjoin";
$re = $this->db->query($sql);
$rows = $re->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;
$sql = "select m.title from metadata m
left join mdstatus s on s.uuid=m.uuid
where s.id='$id'";
$re = $this->db->query($sql);
$title = $re->fetch();
$this->view->md=$title;
} }

View File

@ -0,0 +1,56 @@
<?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('元数据评审');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="divContent">
<div id="leftPanel">
<?= $this->partial('review/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; ?>
<div id="rightPanel">
<table>
<tr style="color:#FFF;background:#0a3e68;line-height:30px;">
<td width='40'>ID</td>
<td width='500'>标题</td>
<td width='100'>状态</td>
<td width="150">操作</td>
</tr>
<?php if (count($this->paginator)): ?>
<?php $autoindex=0;?>
<?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?>
<tr <?php if($autoindex%2 == 0) echo 'bgcolor="#CCCCCC"'; else echo 'bgcolor="#FFFFFF"'; ?>>
<td><?php echo $item['id']; ?></td>
<td><?php echo $item['title']; ?></td>
<td><?php echo $item['status']; ?></td>
<td><a href="/admin/inreview/show/<?php echo $item['id']; ?>">查看详细</a></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</table>
<div style="width:50%;text-align:left;">
<?= $this->paginator; ?></div>
</div>
</div>
</div>

View File

@ -54,7 +54,7 @@
<?php foreach ($this->paginator as $item): ?> <?php foreach ($this->paginator as $item): ?>
<?php $autoindex++;?> <?php $autoindex++;?>
<tr <?php if($autoindex%2 == 0) echo 'bgcolor="#CCCCCC"'; else echo 'bgcolor="#FFFFFF"'; ?>> <tr <?php if($autoindex%2 == 0) echo 'bgcolor="#CCCCCC"'; else echo 'bgcolor="#FFFFFF"'; ?>>
<td><input type="checkbox" name="exps[]" /></td> <td><input type="checkbox" name="exps[]" value="<?php echo $item['id']; ?>" /></td>
<td><?php echo $item['id']; ?></td> <td><?php echo $item['id']; ?></td>
<td><?php echo $item['username']; ?></td> <td><?php echo $item['username']; ?></td>
<td><?php echo $item['realname']; ?></td> <td><?php echo $item['realname']; ?></td>
@ -65,7 +65,7 @@
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
<input type="submit" value="邀请选中的专家评审《<?php echo $this->md['title'];?>》" /> <input type="submit" value="邀请选中的专家评审《<?php echo $this->md['title'];?>》" onclick="return confirm('是否确定邀请已选择的专家')" />
</form> </form>
<div style="width:50%;text-align:left;"> <div style="width:50%;text-align:left;">
<?= $this->paginator; ?></div> <?= $this->paginator; ?></div>