westdc-zf1/application/admin/views/scripts/stat/month.phtml

177 lines
5.3 KiB
PHTML
Raw Normal View History

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headLink()->appendStylesheet('/css/jquery.jqplot.css');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<style>
.charts{margin:30px 0px;}
.charts .title{color:#003366;}
.cp {line-height:24px;}
.cp a{color:#4bb2c5;line-height:24px;}
.cp a:hover{color:#FFF;background:#4bb2c5;}
</style>
<div id="leftPanel">
<?= $this->partial('stat/left.phtml'); ?>
</div>
<div id="rightPanel">
<script language="javascript" type="text/javascript" src="/static/js/plot/jquery.jqplot.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.barRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.pieRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.categoryAxisRenderer.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.highlighter.js"></script>
<script language="javascript" type="text/javascript" src="/static/js/plot/plugins/jqplot.pointLabels.js"></script>
<div class="cp">
<span>选择年份:</span>
<a href="/admin/stat/month/y/2004">2004</a>
<a href="/admin/stat/month/y/2005">2005</a>
<a href="/admin/stat/month/y/2006">2006</a>
<a href="/admin/stat/month/y/2007">2007</a>
<a href="/admin/stat/month/y/2008">2008</a>
<a href="/admin/stat/month/y/2009">2009</a>
<a href="/admin/stat/month/y/2010">2010</a>
<a href="/admin/stat/month/y/2011">2011</a>
<a href="/admin/stat/month/y/2012">2012</a>
</div>
<div class="charts">
<div class="title" id="title_online"><?php echo $this->y.'年按月在线下载量统计';?></div>
<?php
if($this->data!='' && count($this->data)!= 0)
{
$data = $this->data;
?>
<script type="text/javascript">
$(function () {
<?php
$vars = array();
$month = array();
foreach ($data as $v)
{
$vars[] = $v['c'];
$month[]= "'".$v['m']."月'";
}
?>
var s1 = [<?php echo join(',',$vars); ?>];
var ticks = [<?php echo join(',',$month); ?>];
plot1 = $.jqplot('chart_div_online', [s1], {
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: false }
});
});
</script>
<div class="content" id="chart_div_online" style="width:600px;"></div>
<?php
}else
{
echo "暂无数据 (注:在线下载统计从2011年9月份起)";
}
?>
</div>
<div class="charts">
<div class="title" id="title_offline"><?php echo $this->y.'年按月离线下载量统计';?></div>
<?php
if($this->offline!='' && count($this->offline)!= 0)
{
$offline = $this->offline;
?>
<script type="text/javascript">
$(function () {
<?php
$vars_offline = array();
$month_offline = array();
foreach ($offline as $v)
{
$vars_offline[] = $v['c'];
$month_offline[]= "'".$v['m']."月'";
}
?>
var s1 = [<?php echo join(',',$vars_offline); ?>];
var ticks = [<?php echo join(',',$month_offline); ?>];
plot1 = $.jqplot('chart_div_offline', [s1], {
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: false }
});
});
</script>
<div class="content" id="chart_div_offline" style="width:600px;"></div>
<?php
}else
{
echo "暂无数据";
}
?>
</div>
<div class="charts">
<div class="title" id="title_newuser"><?php echo $this->y.'年按月新用户注册量';?></div>
<?php
if($this->newuser!='' && count($this->newuser)!=0)
{
$newuser = $this->newuser;
?>
<script type="text/javascript">
$(function () {
<?php
$vars_newuser = array();
$month_newuser = array();
foreach ($newuser as $v)
{
$vars_newuser[] = $v['c'];
$month_newuser[]= "'".$v['m']."月'";
}
?>
var s1 = [<?php echo join(',',$vars_newuser); ?>];
var ticks = [<?php echo join(',',$month_newuser); ?>];
plot1 = $.jqplot('chart_div_newuser', [s1], {
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: false }
});
});
</script>
<div class="content" id="chart_div_newuser" style="width:600px;"></div>
<?php
}else
{
echo "暂无数据";
}
?>
</div>
</div>