westdc-zf1/application/admin/views/scripts/stat/user-new.phtml

190 lines
7.1 KiB
PHTML
Raw Permalink Normal View History

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'jquery');
$this->theme->AppendPlus($this,'colorbox');
$this->headLink()->appendStylesheet('/css/jquery.jqplot.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin">后台首页</a>');
$this->breadcrumb()->setSeparator(' > ');
?>
<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="row-fluid">
<div class="span2">
<?= $this->partial('stat/left.phtml'); ?>
</div>
<div class="span10">
<?= $this->partial('stat/user-nav.phtml',array('ac'=>$this->ac)); ?>
<div class="cp">
方式:
<a href="/admin/stat/user/ac/new/by/month<?= $this->year ? "/year/".$this->year:"" ?>" class="btn btn-info <?= $this->by == "month" ? "disabled":"" ?>">按月</a>
<a href="/admin/stat/user/ac/new/by/year<?= $this->year ? "/year/".$this->year:"" ?>" class="btn btn-info <?= $this->by == "year" ? "disabled":"" ?>">按年</a>
<a href="/admin/stat/user/ac/new/by/monthavg<?= $this->year ? "/year/".$this->year:"" ?>" class="btn btn-info <?= $this->by == "monthavg" ? "disabled":"" ?>">月均值</a>
</div>
<div>
年份:
<?php if(in_array($this->by,array("year","monthavg") )) {?><a href="/admin/stat/user/ac/new/by/<?= $this->by ?>/year/-1" class="btn btn-info">所有</a><?php } ?>
<?php for($i = (int)date("Y");$i>=2004 ;$i--)
{
$active = $this->year == $i ? "disabled":"";
echo '<a href="/admin/stat/user/ac/new/by/'.$this->by.'/year/'.$i.'" class="btn btn-info '.$active.'">'.$i.'</a>';
}
?>
</div>
<?php if($this->by == 'month' && !empty($this->data)){ ?>
<hr />
<h4><?= $this->year ?>的按月新用户注册量统计</h4>
<div class="row-fluid">
<div class="span3">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>月份</th>
<th>增量</th>
</tr>
</thead>
<tbody>
<?php foreach($this->data as $k=>$v) {?>
<tr><td><?= $v['date_part'] ?></td><td><?= $v['count'] ?></td></tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span9">
<!-- 统计图表 -->
2014-01-16 03:15:24 +00:00
<script type="text/javascript">
$(function () {
<?php
$vars = array();
$month = array();
foreach ($this->data as $v)
{
$vars[] = $v['count'];
$month[]= "'".$v['date_part']."'";
}
?>
var s1 = [<?php echo join(',',$vars); ?>];
var ticks = [<?php echo join(',',$month); ?>];
plot1 = $.jqplot('chart_div_year_seq', [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_year_seq"></div>
</div>
</div>
<?php } ?>
<?php if($this->by == 'year' && !empty($this->data)){ ?>
<hr />
<h4><?= $this->year == -1 ? "所有":$this->year ?>的新用户注册量统计</h4>
<div class="row-fluid">
<div class="span3">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>年份</th>
<th>增量</th>
</tr>
</thead>
<tbody>
<?php foreach($this->data as $k=>$v) {?>
<tr><td><?= $v['date_part'] ?></td><td><?= $v['count'] ?></td></tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span9">
<!-- 统计图表 -->
<script type="text/javascript">
$(function () {
<?php
$vars = array();
$month = array();
foreach ($this->data as $v)
{
$vars[] = $v['count'];
$month[]= "'".$v['date_part']."'";
}
?>
var s1 = [<?php echo join(',',$vars); ?>];
var ticks = [<?php echo join(',',$month); ?>];
plot1 = $.jqplot('chart_div_year_seq', [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_year_seq"></div>
</div>
</div>
<?php } ?>
<?php if($this->by == 'monthavg' && !empty($this->data)){ ?>
<hr />
<h4><?= $this->year ?>的月均用户注册量</h4>
<div class="row-fluid">
<div class="span3">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>年份</th>
<th>月均</th>
</tr>
</thead>
<tbody>
<?php foreach($this->data as $k=>$v) {?>
<tr><td><?= $v['date_part'] ?></td><td><?= $v['count'] ?></td></tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span9">
<!-- 统计图表 -->
2014-01-16 03:15:24 +00:00
</div>
</div>
<?php } ?>
</div>
</div>