summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/controllers/StatisticController.php27
-rwxr-xr-xapplication/layouts/default.phtml2
-rwxr-xr-xapplication/models/EventMapper.php8
-rwxr-xr-xapplication/models/EventcategoryMapper.php19
-rw-r--r--application/views/scripts/statistic/index.phtml28
5 files changed, 63 insertions, 21 deletions
diff --git a/application/controllers/StatisticController.php b/application/controllers/StatisticController.php
index 1610f4c..92ba4bf 100644
--- a/application/controllers/StatisticController.php
+++ b/application/controllers/StatisticController.php
@@ -56,13 +56,34 @@ class StatisticController extends Zend_Controller_Action
/*if($this->acl->checkRight('eoo')) {
$eventList = $this->eventMapper->fetchAll();
- } else {
+ } else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
- }*/
-
+ }*/
+
$ret = $this->eventMapper->getCategoryCount($poolID);
echo json_encode($ret);
}
+
+ public function colorlistAction() {
+
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $poolID = $this->getRequest()->getParam('poolID');
+ $userIDsSession = new Zend_Session_Namespace('userIDs');
+ $userIDsSession->poolID = $poolID;
+
+ /*if($this->acl->checkRight('eoo')) {
+ $eventList = $this->eventMapper->fetchAll();
+ } else {
+ $eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
+ }*/
+
+ $ret = $this->eventcategoryMapper->getCategoryColor($poolID);
+
+ echo json_encode($ret);
+
+ }
+
} \ No newline at end of file
diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml
index c65ec37..a4abfa4 100755
--- a/application/layouts/default.phtml
+++ b/application/layouts/default.phtml
@@ -29,6 +29,8 @@ echo $this->headScript()."\n";
<script type='text/javascript' src='/media/js/jqplot.pointLabels.min.js'></script>
<script type='text/javascript' src='/media/js/jqplot.categoryAxisRenderer.min.js'></script>
<script type='text/javascript' src='/media/js/jqplot.barRenderer.min.js'></script>
+<script type="text/javascript" src='/media/js/jqplot.pieRenderer.min.js'></script>
+<script type="text/javascript" src='/media/js/jqplot.donutRenderer.min.js'></script>
</head>
<body>
diff --git a/application/models/EventMapper.php b/application/models/EventMapper.php
index 7ebb18f..af0b7b2 100755
--- a/application/models/EventMapper.php
+++ b/application/models/EventMapper.php
@@ -202,12 +202,4 @@ class Application_Model_EventMapper
return array($result);
}
- /* FROM "products" AS p JOIN "line_items" AS l
- * ON p.product_id = l.product_id
- *
- * ->join(array('l' => 'line_items'),
- * 'p.product_id = l.product_id');
- */
-
-
} \ No newline at end of file
diff --git a/application/models/EventcategoryMapper.php b/application/models/EventcategoryMapper.php
index b70a116..5298af1 100755
--- a/application/models/EventcategoryMapper.php
+++ b/application/models/EventcategoryMapper.php
@@ -152,6 +152,23 @@ class Application_Model_EventcategoryMapper
return array_diff($vv1,$vv2);
}
-
+ public function getCategoryColor($poolID) {
+
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $select = $this->getDbTable()->select()
+ ->distinct()
+ ->setIntegrityCheck(false)
+ ->from(array('pcec' => 'poolctrl_eventcategory'),
+ array('color' => 'pcec.color'))
+ ->join(array('pce' => 'poolctrl_event'),
+ 'pce.category = pcec.eventcategoryID')
+ ->where('pce.pbs_poolID = ?', $poolID)
+ ->group('pce.category');
+
+ $stmt = $db->query($select);
+ $result = $stmt->fetchAll(PDO::FETCH_NUM);
+
+ return $result;
+ }
} \ No newline at end of file
diff --git a/application/views/scripts/statistic/index.phtml b/application/views/scripts/statistic/index.phtml
index 17bcc15..511c364 100644
--- a/application/views/scripts/statistic/index.phtml
+++ b/application/views/scripts/statistic/index.phtml
@@ -30,29 +30,39 @@ function setPoolIDtmp() {
function plot() {
poolID = $("#poolselectbox option:selected").val();
$.get("/statistic/categorylist/poolID/" + poolID, function(data) {
- if(data == '') {
- $( "#noEventsDialog" ).dialog('open');
- $('#plot').empty();
- } else refreshPlot(data);
+ $.get("/statistic/colorlist/poolID/" + poolID, function(color) {
+ if(data == '') {
+ $( "#noEventsDialog" ).dialog('open');
+ $('#plot').empty();
+ } else refreshPlot(data);
+ }, "json");
}, "json");
}
-function refreshPlot(data) {
+function refreshPlot(data, color) {
$('#plot').empty();
$.jqplot('plot', data, {
seriesDefaults: {
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
+ //renderer: $.jqplot.PieRenderer,
+ renderer: $.jqplot.BarRenderer,
+ pointLabels: { show: true, edgeTolerance: -15 },
shadowAngle: 135,
rendererOptions: {
- barDirection: 'horizontal'
+ //showDataLabels: true,
+ barDirection: 'horizontal',
+ varyBarColor : true
}
},
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer
+ },
+ xaxis: {
+ renderer: $.jqplot.CategoryAxisRenderer
}
- }
+ },
+ seriesColors: [ "green", "blue", "red", "yellow" ], //color,
+ highlighter: { show: false }
});
}