修改数据可视化中得bug,修改后台管理员数量统计功能

This commit is contained in:
Li Jianxuan 2014-06-13 03:21:57 +00:00
parent 29604ab761
commit 775b0ee360
3 changed files with 125 additions and 107 deletions

View File

@ -24,7 +24,7 @@ class Admin_UserController extends Zend_Controller_Action
$uq=$this->db->query($sql);
$row=$uq->fetch();
$sqlt="select count(id) as total from users where usertype='administrator'";
$sqlt="select count(id) as total from users where usertype='{$this->view->config->auth->identifier}'";
$uqt=$this->db->query($sqlt);
$adminrow=$uqt->fetch();

View File

@ -27,7 +27,8 @@
<p class="content"><?= $item['description']; ?></p>
<p>
操作:
<a href="/admin/data/visual/uuid/<?php echo $item['uuid'];?>">编辑可视化要素</a>
<a href="/admin/data/visual/uuid/<?php echo $item['uuid'];?>">编辑可视化要素</a> |
<a href="/visual/view/uuid/<?= $item['uuid'] ?>">前台预览</a>
</p>
</li>
<?php endforeach; ?>

View File

@ -1,106 +1,123 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle()->setSeparator(' - ');
$theme = new Theme;
$theme->appendPlus($this,'highstock');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">数据与服务</a>');
$this->breadcrumb('数据可视化');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span12">
<h3><?= $this->info['title'] ?> <small>数据可视化查看</small></h3>
<h4><small>请在需要查看的可视化要素上点击以描绘图表,再次点击可取消显示</small></h4>
<hr />
<?php $vars = (new \Westdc\Visual\VariableEncoder)->normaldecode($this->data['vars']);?>
<?php foreach($vars as $k=>$v) { ?>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="<?= $v['dataset'] ?>" data-subdataset="<?= $v['subdataset'] ?>" data-seriename="<?= $v['seriename'] ?>">
<?= $v['seriename'] ?>
</a>
<?php } ?>
</div>
<!-- 页面内容 -->
<div class="span12">
<div id="datachart" style="width:100%;height:500px;"></div>
<a class="btn btn-primary control-btn-cls" href="javascript:void(0);">
清除图像
</a>
</div>
<!-- //页面内容 -->
</div>
<script>
_this = {};
$(function() {
$('#datachart').highcharts('StockChart', {
rangeSelector : {
selected : 1,
inputEnabled: $('#container').width() > 480
},
credits : {
enabled : false
}
});
var chart = $('#datachart').highcharts();
$(".control-btn").click(function(){
uuid = '<?= $this->info['uuid'] ?>';
dataset = $(this).data('dataset');
subdataset = $(this).data('subdataset');
seriename = $(this).data('seriename');
for(i in chart.series)
{
if(chart.series[i].name == seriename)
{
chart.series[i].remove();
return;
}
}
$.ajax({
'url': '/visual/data',
'data': 'uuid=' + uuid + '&dataset=' + dataset + '&subdataset=' + subdataset,
'method': 'GET',
'dataType': 'json',
'success': function(data){
chart.addSeries({
name: seriename,
data: data,
type : 'column'
});
},
'timeout': 30000,
'global' : true
});
});
$(".control-btn-cls").click(function(e) {
for(i in chart.series)
{
chart.series[i].remove();
}
});
});
$( document ).ajaxSend(function() {
$('#loading').css('display','none');
});
$( document ).ajaxSend(function() {
$('#loading').css('display','block');
});
$( document ).ajaxSend(function() {
$('#loading').css('display','none');
});
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle()->setSeparator(' - ');
$theme = new Theme;
$theme->appendPlus($this,'highstock');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">数据与服务</a>');
$this->breadcrumb('数据可视化');
$this->breadcrumb()->setSeparator(' > ');
?>
<div class="row">
<div class="span12">
<h3><?= $this->info['title'] ?> <small>数据可视化查看</small></h3>
<h4><small>请在需要查看的可视化要素上点击以描绘图表,再次点击可取消显示,绘制图像前可自主选择图像类型</small></h4>
<div class="btn-group linetypes" data-toggle="buttons-radio">
<button type="button" class="btn active" value="line">折线图</button>
<button type="button" class="btn" value="column">柱状图</button>
</div>
<hr />
<?php $vars = (new \Westdc\Visual\VariableEncoder)->normaldecode($this->data['vars']);?>
<?php foreach($vars as $k=>$v) { ?>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="<?= $v['dataset'] ?>" data-subdataset="<?= $v['subdataset'] ?>" data-seriename="<?= $v['seriename'] ?>">
<?= $v['seriename'] ?>
</a>
<?php } ?>
</div>
<!-- 页面内容 -->
<div class="span12">
<div id="datachart" style="width:100%;height:500px;"></div>
<a class="btn btn-primary control-btn-cls" href="javascript:void(0);">
清除图像
</a>
</div>
<!-- //页面内容 -->
</div>
<script>
_this = {};
_this.linetype = 'line';
$(function() {
$('.linetypes button').click(function(e) {
_this.linetype = $(this).val();
});
$('#datachart').highcharts('StockChart', {
rangeSelector : {
selected : 1,
inputEnabled: $('#container').width() > 480
},
credits : {
enabled : false
},
xAxis : {
allowDecimals : true
}
});
var chart = $('#datachart').highcharts();
$(".control-btn").click(function(){
uuid = '<?= $this->info['uuid'] ?>';
dataset = $(this).data('dataset');
subdataset = $(this).data('subdataset');
seriename = $(this).data('seriename');
for(i in chart.series)
{
if(chart.series[i].name == seriename)
{
chart.series[i].remove();
return;
}
}
$.ajax({
'url': '/visual/data',
'data': 'uuid=' + uuid + '&dataset=' + dataset + '&subdataset=' + subdataset,
'method': 'GET',
'dataType': 'json',
'success': function(data){
chart.addSeries({
name: seriename,
data: data,
type : _this.linetype,
dataGrouping: {
enabled: false,
forced: false,
}
});
},
'timeout': 30000,
'global' : true
});
});
$(".control-btn-cls").click(function(e) {
for(i in chart.series)
{
chart.series[i].remove();
}
});
});
$( document ).ajaxSend(function() {
$('#loading').css('display','none');
});
$( document ).ajaxSend(function() {
$('#loading').css('display','block');
});
$( document ).ajaxSend(function() {
$('#loading').css('display','none');
});
</script>