修改数据可视化中得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); $uq=$this->db->query($sql);
$row=$uq->fetch(); $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); $uqt=$this->db->query($sqlt);
$adminrow=$uqt->fetch(); $adminrow=$uqt->fetch();

View File

@ -27,7 +27,8 @@
<p class="content"><?= $item['description']; ?></p> <p class="content"><?= $item['description']; ?></p>
<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> </p>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>

View File

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