summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSebastian Wagner2011-09-30 17:09:23 +0200
committerSebastian Wagner2011-09-30 17:09:23 +0200
commita19068db1ccc0982fa604edd32a7e5351e2e2388 (patch)
tree6c47536137b9d7104806ac7361310dc7d16e9107 /application
parentbugfix (diff)
downloadpoolctrl-a19068db1ccc0982fa604edd32a7e5351e2e2388.tar.gz
poolctrl-a19068db1ccc0982fa604edd32a7e5351e2e2388.tar.xz
poolctrl-a19068db1ccc0982fa604edd32a7e5351e2e2388.zip
some changes
Diffstat (limited to 'application')
-rw-r--r--application/controllers/StatisticController.php22
-rwxr-xr-xapplication/models/EventcategoryMapper.php31
-rwxr-xr-xapplication/views/scripts/event/index.phtml2
-rw-r--r--application/views/scripts/statistic/index.phtml34
4 files changed, 73 insertions, 16 deletions
diff --git a/application/controllers/StatisticController.php b/application/controllers/StatisticController.php
index cb36b89..4def963 100644
--- a/application/controllers/StatisticController.php
+++ b/application/controllers/StatisticController.php
@@ -37,13 +37,19 @@ class StatisticController extends Zend_Controller_Action
$this->view->right = $this->acl->checkRight($rightShortcut);
}
+ public function dumpAction() {
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+ $data = $this->_request->getParam("data");
+ var_dump($data);
+ }
+
public function categorylistAction() {
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$poolID = $this->getRequest()->getParam('poolID');
$userIDsSession = new Zend_Session_Namespace('userIDs');
- $category = $this->getRequest()->getParam('category');
$userIDsSession->poolID = $poolID;
if($this->acl->checkRight('eoo')) {
@@ -51,7 +57,7 @@ class StatisticController extends Zend_Controller_Action
} else {
$eventList = $this->eventMapper->findBy(array("pbs_membershipID", $this->userIDsNamespace['membershipID']));
}
-
+
$count = 0;
foreach ($eventList as $event){
@@ -60,6 +66,16 @@ class StatisticController extends Zend_Controller_Action
$count += 1;
}
}
- echo $count;
+ //echo $count;
+
+ $ret = array();
+
+ $ret[] = array(3,'Lecture');
+ $ret[] = array(2,'Boot');
+ $ret[] = array(65,'Shutdown');
+ $ret[] = array(20,'Maintenance');
+
+ echo json_encode(array($ret));
+
}
} \ No newline at end of file
diff --git a/application/models/EventcategoryMapper.php b/application/models/EventcategoryMapper.php
index b70a116..1ba0369 100755
--- a/application/models/EventcategoryMapper.php
+++ b/application/models/EventcategoryMapper.php
@@ -82,6 +82,37 @@ class Application_Model_EventcategoryMapper
return $this->_dbTable;
}
+
+ /*public function getCategoryCount() {
+
+
+ $select = $db->select()
+ ->from(array('p' => 'products'),
+ array('product_id'))
+ ->join(array('l' => 'line_items'),
+ 'p.product_id = l.product_id',
+ array('line_items_per_product' => 'COUNT(*)'))
+ ->group('p.product_id');
+
+
+// Erzeugt diese Anfrage:
+// SELECT p."product_id", COUNT(*) AS line_items_per_product
+// FROM "products" AS p JOIN "line_items" AS l
+// ON p.product_id = l.product_id
+// GROUP BY p.product_id
+ *
+ *
+ *
+ *
+ * SELECT category, COUNT( * ) AS count
+ * FROM `poolctrl_event`
+ * GROUP BY category
+ * LIMIT 0 , 30
+
+
+ }*/
+
+
public function save(Application_Model_Eventcategory $eventcategory)
{
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index aaf277c..f5beb9e 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -621,7 +621,7 @@ var dayClick = false;
autoOpen: false,
width: 600,
modal: true,
- title: 'Edit ' + event.title,
+ title: 'Edit ' + selectedEvent.title,
buttons: {
"Cancel": function() {
$(this).dialog("close");
diff --git a/application/views/scripts/statistic/index.phtml b/application/views/scripts/statistic/index.phtml
index 369a5a8..d6c9ca9 100644
--- a/application/views/scripts/statistic/index.phtml
+++ b/application/views/scripts/statistic/index.phtml
@@ -15,6 +15,7 @@ var lecture = 0;
var boot = 0;
var shutdown = 0;
var maintenance = 0;
+var foo;
//fetch all poolevents of the selected #poolselectbox value
function fetchPoolEvents() {
@@ -28,16 +29,29 @@ function setPoolIDtmp() {
function plot() {
poolID = $("#poolselectbox option:selected").val();
- $.get("/statistic/categorylist/poolID/" + poolID + "/category/" + 1, function(data) {lecture = data;});
- $.get("/statistic/categorylist/poolID/" + poolID + "/category/" + 3, function(data) {boot = data;});
- $.get("/statistic/categorylist/poolID/" + poolID + "/category/" + 4, function(data) {shutdown = data;});
- $.get("/statistic/categorylist/poolID/" + poolID + "/category/" + 2, function(data) {maintenance = data; refreshPlot();});
+
+ $.get("/statistic/categorylist/poolID/" + poolID + "/category/" + 2, function(data) {
+// lecture = data.lecture;
+// boot = data.boot;
+// shutdown = data.shutdown;
+// maintenance = data.maintenance;
+ refreshPlot(data);
+// $.ajax({
+// type: 'POST',
+// url: "/statistic/dump",
+// data: {data: [[[boot,'Boot'], [shutdown,'Shutdwon'], [maintenance,'Maintenance'], [lecture,'Lecture']]]},
+// success: function(){alert("done");},
+// dataType: "json"
+// });
+
+ }, "json");
}
-function refreshPlot() {
+function refreshPlot(data) {
$('#plot').empty();
- $.jqplot('plot', [
- [[boot,'Boot'], [shutdown,'Shutdwon'], [maintenance,'Maintenance'], [lecture,'Lecture']]], {
+// $.jqplot('plot', [
+// [[boot,'Boot'], [shutdown,'Shutdwon'], [maintenance,'Maintenance'], [lecture,'Lecture']]], {
+ $.jqplot('plot', data, {
seriesDefaults: {
renderer:$.jqplot.BarRenderer,
// Show point labels to the right ('e'ast) of each bar.
@@ -68,11 +82,7 @@ $(document).ready(function(){
poolIDtmp = $("#poolselectbox option:selected").val();
fetchPoolEvents();
});
-
- // For horizontal bar charts, x an y values must will be "flipped"
- // from their vertical bar counterpart.
});
</script>
-<div id="plot"
- style="height: 400px; width: 700px;"></div>
+<div id="plot" style="height: 400px; width: 700px;"></div>