增加了新闻中心的控制器及视图 ,采用新UI

This commit is contained in:
Li Jianxuan 2011-09-23 03:49:10 +00:00
parent 41016eddbc
commit 482a3c8801
5 changed files with 365 additions and 130 deletions

View File

@ -0,0 +1,113 @@
<?php
class Admin_NewsController extends Zend_Controller_Action
{
function preDispatch()
{
$this->db=Zend_Registry::get('db');
$this->view->config = Zend_Registry::get('config');
$this->messenger=$this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->messenger->getMessages();
$this->_helper->layout->setLayout('administry');//新UI
}
function postDispatch()
{
$this->view->messages = $this->messenger->getMessages();
}
function indexAction()
{
}//indexAction 首页
function catlogAction()
{
$add = $this->_request->getParam('add');
$submit = $this->_request->getParam('submit');
$delete = $this->_request->getParam('delete');
$edit = $this->_request->getParam('edit');
if($add)
{
if(empty($submit))
$this->_helper->viewRenderer('catlogadd');
else{
$title = $this->_request->getParam('ctitle');
$keyword = $this->_request->getParam('keyword');
$discript = $this->_request->getParam('discript');
$sql="insert into news_catlog (title,keyword,discript) values ('$title','$keyword','$discript')";
if($this->db->exec($sql) > 0)
{
$this->messenger->addMessage('提示信息:栏目添加成功!');
$this->_redirect('/admin/news/catlog');
}
}
}//栏目添加
if($delete>0)
{
$sql = "delete from news_catlog where id='$delete'";
if($this->db->exec($sql)>0)
{
$this->messenger->addMessage('提示信息:栏目删除成功!');
$this->_redirect('/admin/news/catlog');
}
}//栏目删除
if($edit>0)
{
$title = $this->_request->getParam('ctitle');
$keyword = $this->_request->getParam('keyword');
$discript = $this->_request->getParam('discript');
$orders = $this->_request->getParam('orders');
$sql="update news_catlog set title='$title',keyword='$keyword',discript='$discript',orders='$orders' where id='$edit'";
if($this->db->exec($sql)>0)
{
$this->messenger->addMessage('提示信息:栏目编辑成功!');
$this->_redirect('/admin/news/catlog');
}
}//栏目编辑
else
{
$sql="select * from news_catlog order by orders desc";
$re=$this->db->query($sql);
$catlogs=$re->fetchAll();
$this->view->catlogs=$catlogs;
}//栏目列表
}//栏目管理
function newsaddAction()
{
$sql="select * from news_catlog order by orders";
$re = $this->db->query($sql);
$types = $re->fetchAll();
$this->view->types=$types;
}//newsadd 新闻添加
}

View File

@ -0,0 +1,35 @@
<!-- Page footer -->
<footer id="bottom">
<div class="wrapper">
<nav>
<a href="/about/contact" >联系我们</a> &middot;
<a href="/about/terms">使用条款和免责申明</a> &middot;
<a href="#">Reports</a> &middot;
<a href="#">Users</a> &middot;
<a href="#">Media</a> &middot;
<a href="#">Events</a> &middot;
<a href="#">Newsletter</a> &middot;
<a href="#">Settings</a>
</nav>
<p>Copyright &copy; 2006-2011 <b>中国西部环境与生态科学数据中心</b> | 陇ICP备05000491号</p>
</div>
</footer>
<!-- End of Page footer -->
<!-- Animated footer -->
<footer id="animated">
<ul>
<li><a href="#">Dashboard</a></li>
<li><a href="#">Content</a></li>
<li><a href="#">Reports</a></li>
<li><a href="#">Users</a></li>
<li><a href="#">Media</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Newsletter</a></li>
<li><a href="#">Settings</a></li>
</ul>
</footer>
<!-- End of Animated footer -->
<!-- Scroll to top link -->
<a href="#" id="totop">^ scroll to top</a>

View File

@ -0,0 +1,81 @@
<?php
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$user = $auth->getIdentity();
$uname=$user->username;
}
?>
<!-- Header -->
<header id="top">
<div class="wrapper">
<!-- Title/Logo - can use text instead of image -->
<div id="title"><span>中国西部环境与生态科学数据中心 - 管理中心</span></div>
<!-- Top navigation -->
<div id="topnav">
<a href="#"><img class="avatar" SRC="/static/img/user_32.png" alt="" /></a>
Logged in as <b><?php echo $uname;?></b>
<span>|</span> <a href="/account/edit">设置</a>
<span>|</span> <a href="/account/logout">注销</a><br />
<small>You have <a href="#" class="high"><b>1</b> new message!</a></small>
</div>
<!-- End of Top navigation -->
<!-- Main navigation -->
<nav id="menu">
<ul class="sf-menu">
<li><a href="/"><span>网站首页</span></a></li>
<li><a href="/admin"><span>后台首页</span></a></li>
<li><a href="/admin/data"><span>数据管理</span></a>
<ul>
<li><a href="/admin/data/md">元数据管理</a></li>
<li><a href="/admin/data/comment">数据反馈管理</a></li>
<li><a href="/admin/data/reference">数据文献关联管理</a></li>
<li><a href="/admin/data/import">上传元数据文件</a></li>
<li><a href="/admin/data/batchimport">导入服务器元数据目录</a></li>
<li><a href="/admin/data/datafileimport">导入数据目录</a></li>
<li><a href="/admin/data/sync">同步GeoNetwork元数据</a></li>
<li><a href="/admin/data/datasetcd">特色数据集管理</a></li>
<li><a href="/admin/data/newsletter">数据中心通讯管理</a></li>
<li><a href="/admin/data/feature">特色推荐</a></li>
<li><a href="/admin/data/source">项目来源管理</a></li>
</ul>
</li>
<li><a href="/admin/down"><span>申请管理</span></a>
<ul>
<li><a href="/admin/down/offlineapp">离线数据申请管理</a></li>
<li><a href="/admin/down/offline">离线数据服务记录</a></li>
<li><a href="/admin/down/fixoffline">手动同步离线申请用户与网站帐号</a></li>
<li><a href="/admin/down/online">在线数据下载记录从20110908开始</a></li>
<li><a href="/admin/down/user">用户下载记录</a></li>
<li><a href="/admin/down/data">数据下载记录</a></li>
</ul>
</li>
<li><a href="/admin/user"><span>用户管理</span></a>
<ul>
<li><a href="/admin/user/">用户管理首页</a></li>
<li><a href="/admin/user/list">普通用户列表</a></li>
<li><a href="/admin/user/adminlist">管理员列表</a></li>
</ul>
</li>
<li><a href="/admin/stat"><span>统计数据</span></a>
<ul>
<li><a href="/admin/stat/">统计概况</a></li>
<li><a href="/admin/stat/awstatsweb">awstats web统计</a></li>
<li><a href="/admin/stat/awstatsftp">awstats ftp统计</a></li>
<li><a href="/admin/stat/webalizer">webalizer统计</a></li>
<li><a href="/admin/stat/water">WATER项目</a></li>
</ul>
</li>
<li id="nav_news"><a href="/admin/news"><span>新闻中心</span></a>
</li>
</ul>
</nav>
<!-- End of Main navigation -->
<!-- Aside links -->
<aside><b>简体中文</b> &middot; <a href="#">English</a></aside>
<!-- End of Aside links -->
</div>
</header>
<!-- End of Header -->

View File

@ -2,130 +2,112 @@
$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()->setSeparator(' > ');
$this->headScript()->appendFile('/js/jquery-1.6.4.min.js');
$this->headScript()->appendFile('/js/jquery.masonry.min.js');
?>
<style>
.tables{width:320px;float:left;}
.tables .stitle{width:100%;font-size:16px;font-weight:bold;}
</style>
<div id="divContent">
<div id="leftPanel">
<?= $this->partial('stat/left.phtml'); ?>
</div>
<div id="rightPanel">
<div class="tables">
<div class="stitle">概况</div>
<table>
<thead>
<tr><td width="200">key</td><td width="100">value</td></tr>
</thead>
<tr>
<td>用户总数</td>
<td><?php echo $this->alluser['num'];?></td>
</tr>
<tr>
<td>metadata数据总数</td>
<td><?php echo $this->alldata['num'];?></td>
</tr>
<tr>
<td>数据下载总次数</td>
<td><?php echo $this->alldown['num'];?></td>
</tr>
<tr>
<td>已通过的离线申请</td>
<td><?php echo $this->allpass['num'];?></td>
</tr>
<tr>
<td>未通过的离线申请</td>
<td><?php echo $this->nopass['num'];?></td>
</tr>
<tr>
<td>在线下载申请次数</td>
<td><?php echo $this->onlinedown['num'];?></td>
</tr>
</table>
</div>
<div class="tables">
<div class="stitle">数据下载量概况</div>
<table>
<thead>
<tr><td width="200"></td><td width="100">单位:GB</td></tr>
</thead>
<tr>
<td>总下载数据量</td>
<td><?php echo round($this->allsize['num'],2);?></td>
</tr>
<tr>
<td>离线下载数据量</td>
<td><?php echo round($this->offlinesize['num'],2);?></td>
</tr>
<tr>
<td>在线下载数据量</td>
<td><?php echo round($this->onlinesize['num'],2);?></td>
</tr>
<!-- 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 -->
</table>
</div>
<!-- Page content -->
<div id="page">
<!-- Wrapper -->
<div class="wrapper">
<!-- Right column/section -->
<aside class="column width2 first">
<div id="rightmenu">
<header>
<h3>新闻中心管理</h3>
</header>
<dl class="first">
<dt><img width="16" height="16" alt="" SRC="/static/img/key.png"></dt>
<dd><a href="/admin/news/catlog">栏目管理</a></dd>
<dd class="last">创建、编辑、删除栏目</dd>
<dt><img width="16" height="16" alt="" SRC="/static/img/help.png"></dt>
<dd><a href="/admin/news/newslist">新闻管理</a></dd>
<dd class="last">查看、编辑、搜索、删除新闻</dd>
<dt><img width="16" height="16" alt="" SRC="/static/img/help.png"></dt>
<dd><a href="/admin/news/newsadd">发布新闻</a></dd>
<dd class="last">为网站发布一篇新闻</dd>
</dl>
</div>
<div class="content-box">
<header>
<h3>Latest in the Community</h3>
</header>
<section>
<dl>
<dt>Maximize every interaction with a client</dt>
<dd><a href="#">Read more</a></dd>
<dt>Diversification for Small Business Owners</dt>
<dd><a href="#">Read more</a></dd>
</dl>
</section>
</div>
</aside>
<!-- End of Right column/section -->
<!-- Left column/section -->
<section class="column width6">
<h3>最新发布的新闻</h3>
<hr/>
<div class="clear">&nbsp;</div>
</section>
<!-- End of Left column/section -->
</div>
<!-- End of Wrapper -->
</div>
<!-- End of Page content -->
<img src="http://designerz-crew.info/start/callb.png">
<div class="tables">
<div class="stitle">各单位离线下载情况</div>
<table>
<thead>
<tr>
<td width="200">单位名称</td>
<td width="100">离线下载次数</td>
</tr>
</thead>
<?php
foreach($this->unitoffline as $k=>$v)
{
echo '<tr>
<td>'.$v['unit'].'</td>
<td>'.$v['num'].'</td>
</tr>';
}
?>
</table>
</div>
<div class="tables">
<div class="stitle">各单位在线下载情况</div>
<table>
<thead>
<tr>
<td width="200">单位名称</td>
<td width="100">在线下载次数</td>
</tr>
</thead>
<?php
foreach($this->unitonline as $k=>$v)
{
echo '<tr>
<td>'.$v['unit'].'</td>
<td>'.$v['num'].'</td>
</tr>';
}
?>
</table>
</div>
</div>
</div>
<script type="text/javascript" language="javascript">
$(function(){
$('#rightPanel').masonry({
itemSelector : '.tables',
columnWidth : 340
});
<script type="text/javascript">
$(document).ready(function(){
/* setup navigation, content boxes, etc... */
Administry.setup();
/* progress bar animations - setting initial values */
Administry.progress("#progress1", 1, 5);
Administry.progress("#progress2", 2, 5);
Administry.progress("#progress3", 2, 5);
/* flot graphs */
var sales = [{
label: 'Total Paid',
data: [[1, 0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,900],[8,0],[9,0],[10,0],[11,0],[12,0]]
},{
label: 'Total Due',
data: [[1, 0],[2,0],[3,0],[4,0],[5,0],[6,422.10],[7,0],[8,0],[9,0],[10,0],[11,0],[12,0]]
}
];
var plot = $.plot($("#placeholder"), sales, {
bars: { show: true, lineWidth: 1 },
legend: { position: "nw" },
xaxis: { ticks: [[1, "Jan"], [2, "Feb"], [3, "Mar"], [4, "Apr"], [5, "May"], [6, "Jun"], [7, "Jul"], [8, "Aug"], [9, "Sep"], [10, "Oct"], [11, "Nov"], [12, "Dec"]] },
yaxis: { min: 0, max: 1000 },
grid: { color: "#666" },
colors: ["#0a0", "#f00"]
});
});
$('#nav_news').addClass("current");
</script>

View File

@ -1,8 +1,32 @@
<ul>
<li class="title">信息统计</li>
<li><a href="/admin/stat/">统计概况</a></li>
<li><a href="/admin/stat/awstatsweb">awstats web统计</a></li>
<li><a href="/admin/stat/awstatsftp">awstats ftp统计</a></li>
<li><a href="/admin/stat/webalizer">webalizer统计</a></li>
<li><a href="/admin/stat/water">WATER项目</a></li>
</ul>
<div id="rightmenu">
<header>
<h3>新闻中心管理</h3>
</header>
<dl class="first">
<dt><img width="16" height="16" alt="" SRC="/static/img/90.png"></dt>
<dd><a href="/admin/news/catlog">栏目管理</a></dd>
<dd class="last">创建、编辑、删除栏目</dd>
<dt><img width="16" height="16" alt="" SRC="/static/img/27.png"></dt>
<dd><a href="/admin/news/newslist">新闻管理</a></dd>
<dd class="last">查看、编辑、搜索、删除新闻</dd>
<dt><img width="16" height="16" alt="" SRC="/static/img/21.png"></dt>
<dd><a href="/admin/news/newsadd">发布新闻</a></dd>
<dd class="last">为网站发布一篇新闻</dd>
</dl>
</div>
<div class="content-box">
<header>
<h3>Tips</h3>
</header>
<section>
<dl>
<dt>在栏目编辑中,再次点击“编辑”按钮可以关闭栏目编辑窗口</dt>
<dd><a href="/admin/news/catlog">去试试</a></dd>
<dt>新闻添加中可以直接上传图片</dt>
<dd><a href="/admin/news/newsadd">去试试</a></dd>
</dl>
</section>
</div>