增加09年含沙量数据可视化

This commit is contained in:
Li Jianxuan 2014-05-23 07:41:52 +00:00
parent a8df49bff7
commit 12b8b26338
2 changed files with 84 additions and 4 deletions

View File

@ -16,19 +16,28 @@ $this->breadcrumb()->setSeparator(' > ');
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">青海三江源自然保护区2012年水资源监测含沙量数据</a></li>
<li class="active"><a href="#tab1" data-toggle="tab">青海三江源自然保护区水资源监测含沙量数据</a></li>
<li><a href="#tab2" data-toggle="tab">青海三江源区珍秦草地生态综合站2011年土壤水分监测数据</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc" data-subdataset="avg" data-seriename="2012逐月含沙量平均值">
平均值
2012年逐月平均值
</a>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc" data-subdataset="max" data-seriename="2012逐月含沙量最大值">
最大值
2012年逐月最大值
</a>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc" data-subdataset="min" data-seriename="2012逐月含沙量最小值">
最小值
2012年逐月最小值
</a>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc2009" data-subdataset="avg" data-seriename="2009逐月含沙量平均值">
2009年逐月平均值
</a>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc2009" data-subdataset="max" data-seriename="2009逐月含沙量最大值">
2009年逐月最大值
</a>
<a class="btn btn-default control-btn" href="javascript:void(0);" data-dataset="sc2009" data-subdataset="min" data-seriename="2009逐月含沙量最小值">
2009年逐月最小值
</a>
</div>
<div class="tab-pane" id="tab2">

View File

@ -0,0 +1,71 @@
<?php
//含沙量
//Sediment Concentration
namespace Westdc\Visual\Reader;
use Westdc\Visual\Record;
use Westdc\Visual\RecordInterface;
class Sc2009 extends Record implements RecordInterface
{
function __construct()
{
parent::__construct(__CLASS__);
}
public $subset;
public function switchDataset()
{
if(empty($this->subset))
{
$this->subset = "avg_sand";
return;
}
switch($this->subset){
case "avg":
$this->subset = "avg_sand";
break;
case "max" :
$this->subset = "max_sand";
break;
case "min" :
$this->subset = "min_sand";
break;
}
return;
}
public function getData()
{
$sql = "SELECT * FROM data_sands2009
ORDER BY
year ASC,
month ASC
";
$rs = $this->db->query($sql);
return $rs;
}
public function outPut()
{
$this->switchDataset();
$rs = $this->getData();
$data = array();
while($row = $rs->fetch())
{
$row['utctime'] = $this->utcMsTime(mktime(0,0,0,$row['month'],0,$row['year']));
$data[] = array($row['utctime'],$row[$this->subset]);
}
return $data;
}
}