From 12b8b26338209ff4a9a142cdef85f9c5b21c38a2 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 23 May 2014 07:41:52 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A009=E5=B9=B4=E5=90=AB=E6=B2=99?= =?UTF-8?q?=E9=87=8F=E6=95=B0=E6=8D=AE=E5=8F=AF=E8=A7=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/views/scripts/visual/index.phtml | 17 +++-- .../module/Westdc/Visual/Reader/Sc2009.php | 71 +++++++++++++++++++ 2 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 application/module/Westdc/Visual/Reader/Sc2009.php diff --git a/application/default/views/scripts/visual/index.phtml b/application/default/views/scripts/visual/index.phtml index 9282928f..1e3e474b 100644 --- a/application/default/views/scripts/visual/index.phtml +++ b/application/default/views/scripts/visual/index.phtml @@ -16,19 +16,28 @@ $this->breadcrumb()->setSeparator(' > ');
diff --git a/application/module/Westdc/Visual/Reader/Sc2009.php b/application/module/Westdc/Visual/Reader/Sc2009.php new file mode 100644 index 00000000..3cd9c522 --- /dev/null +++ b/application/module/Westdc/Visual/Reader/Sc2009.php @@ -0,0 +1,71 @@ +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; + } + +} \ No newline at end of file