2013-03-29 07:29:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AboutController extends Zend_Controller_Action
|
|
|
|
{
|
|
|
|
function indexAction()
|
|
|
|
{
|
2013-05-03 12:59:04 +00:00
|
|
|
$archives=new Archive($this->db);
|
2013-11-10 09:05:25 +00:00
|
|
|
$this->view->item=$archives->getOneArchive('Mission and Goals','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function preDispatch()
|
|
|
|
{
|
|
|
|
$this->view->config = Zend_Registry::get('config');
|
|
|
|
$this->messenger=$this->_helper->getHelper('FlashMessenger');
|
|
|
|
$this->view->messages = $this->messenger->getMessages();
|
|
|
|
$this->db=Zend_Registry::get('db');
|
|
|
|
$this->view->pageID = "about-".$this->_request->getActionName();
|
|
|
|
}
|
|
|
|
function contactAction()
|
|
|
|
{
|
|
|
|
$form=new ContactForm();
|
|
|
|
$this->view->form=$form;
|
|
|
|
$this->view->addHelperPath('helper','Zend_View_Helper_');
|
|
|
|
if ($this->_request->isPost()) {
|
|
|
|
//发送邮件
|
|
|
|
$formData=$this->_request->getPost();
|
|
|
|
include_once("bcspamblock.php");
|
|
|
|
if (bcspamblock_verify() && $form->isValid($formData)) {
|
|
|
|
$mail=new Zend_Mail('utf-8');
|
|
|
|
$mail->setFrom($formData['email'],$formData['username']);
|
|
|
|
$mail->setBodyText($formData['body']);
|
|
|
|
$mail->setSubject($formData['subject']);
|
|
|
|
$mail->addTo($this->view->config->supportemail);
|
|
|
|
$mail->send();
|
2013-11-10 08:34:18 +00:00
|
|
|
$this->messenger->addMessage('Send Successful!');
|
2013-03-29 07:29:44 +00:00
|
|
|
$this->_redirect('/about/contact');
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
if ($auth->hasIdentity()) {
|
|
|
|
$user=$auth->getIdentity();
|
|
|
|
$formData['username']=($user->realname)?$user->realname:$user->username;
|
|
|
|
$formData['email']=$user->email;
|
|
|
|
$form->populate($formData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function termsAction()
|
|
|
|
{
|
2013-05-07 02:03:50 +00:00
|
|
|
$archives=new Archive($this->db);
|
2013-11-10 08:34:18 +00:00
|
|
|
$this->view->item=$archives->getOneArchive('Terms','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function backgroundAction()
|
|
|
|
{
|
2013-05-03 12:59:04 +00:00
|
|
|
$archives=new Archive($this->db);
|
2013-11-10 08:34:18 +00:00
|
|
|
$this->view->item=$archives->getOneArchive('CARD History','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function legalAction()
|
|
|
|
{
|
2013-05-03 12:59:04 +00:00
|
|
|
$archives=new Archive($this->db);
|
|
|
|
$this->view->item=$archives->getOneArchive('隐私政策','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function supportusAction()
|
|
|
|
{
|
2013-11-10 08:34:18 +00:00
|
|
|
$archives=new Archive($this->db);
|
|
|
|
$this->view->item=$archives->getOneArchive('Support Us','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function copyrightAction()
|
|
|
|
{
|
2013-11-10 08:34:18 +00:00
|
|
|
$archives=new Archive($this->db);
|
2013-11-10 09:01:24 +00:00
|
|
|
$this->view->item=$archives->getOneArchive('Use and Copyrights','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function linkAction()
|
|
|
|
{
|
|
|
|
$archives=new Archive($this->db);
|
|
|
|
$this->view->item=$archives->getOneArchive('友情链接','about');
|
|
|
|
}
|
|
|
|
function honorAction()
|
|
|
|
{
|
|
|
|
$archives=new Archive($this->db);
|
|
|
|
$this->view->item=$archives->getOneArchive('服务成效','about');
|
|
|
|
}
|
|
|
|
function sponsorsAction()
|
|
|
|
{
|
2013-11-10 08:34:18 +00:00
|
|
|
$archives=new Archive($this->db);
|
|
|
|
$this->view->item=$archives->getOneArchive('Sponsors','about');
|
2013-03-29 07:29:44 +00:00
|
|
|
}
|
|
|
|
function publicationAction()
|
|
|
|
{
|
|
|
|
$ac = $this->_request->getParam("ac");
|
|
|
|
$siteid="e31f5ea7-a4af-4ae3-9ac1-1a84132c4338";//site uuid from geonetowrk
|
|
|
|
if(empty($ac))
|
|
|
|
{
|
2014-05-08 13:25:27 +00:00
|
|
|
$sql="select * from mdref mr left join reference r on mr.refid=r.id where mr.uuid=? and mr.reftype=0 order by r.year desc,r.title asc";
|
2012-09-05 02:26:20 +00:00
|
|
|
$sth = $this->db->prepare($sql);
|
|
|
|
$sth->execute(array($siteid));
|
|
|
|
$rows = $sth->fetchAll();
|
2013-03-29 07:29:44 +00:00
|
|
|
} elseif ($ac=='patent' || $ac=='report') {
|
|
|
|
$archives=new Archive($this->db);
|
|
|
|
$rows=$archives->getArchive($ac);
|
|
|
|
$this->_helper->viewRenderer($ac);
|
2012-11-30 18:16:06 +00:00
|
|
|
}
|
|
|
|
$paginator = Zend_Paginator::factory($rows);
|
|
|
|
$paginator->setCurrentPageNumber($this->_getParam('page'));
|
|
|
|
$paginator->setItemCountPerPage(10);
|
|
|
|
$paginator->setView($this->view);
|
|
|
|
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
2013-03-29 07:29:44 +00:00
|
|
|
$this->view->paginator=$paginator;
|
|
|
|
}
|
2009-03-06 03:20:46 +00:00
|
|
|
}
|