summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
authorsebastian wagner2011-10-06 12:51:19 +0200
committersebastian wagner2011-10-06 12:51:19 +0200
commitffc760340392d97dbf4c578129a995f4901d0fe8 (patch)
tree2332ae2bcaa51afa569c5dfd5dc436d6b3c04471 /application/views
parentsome statistic changes (diff)
downloadpoolctrl-ffc760340392d97dbf4c578129a995f4901d0fe8.tar.gz
poolctrl-ffc760340392d97dbf4c578129a995f4901d0fe8.tar.xz
poolctrl-ffc760340392d97dbf4c578129a995f4901d0fe8.zip
category and running
Diffstat (limited to 'application/views')
-rw-r--r--application/views/scripts/statistic/category.phtml99
-rw-r--r--application/views/scripts/statistic/running.phtml33
2 files changed, 132 insertions, 0 deletions
diff --git a/application/views/scripts/statistic/category.phtml b/application/views/scripts/statistic/category.phtml
new file mode 100644
index 0000000..44fb749
--- /dev/null
+++ b/application/views/scripts/statistic/category.phtml
@@ -0,0 +1,99 @@
+<h1>Statistic - Category</h1>
+
+<link
+ rel="stylesheet" type="text/css"
+ href="/media/css/jquery.jqplot.min.css" />
+
+<select id="poolselectbox" name="PoolSelectbox"
+ onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
+ <option value="default">Please choose a Pool</option>
+</select>
+
+<script>
+
+//fetch all poolevents of the selected #poolselectbox value
+function fetchPoolEvents() {
+ poolID = $("#poolselectbox option:selected").val();
+ plot();
+}
+
+function setPoolIDtmp() {
+ poolIDtmp = $("#poolselectbox option:selected").val();
+ }
+
+function plot() {
+ poolID = $("#poolselectbox option:selected").val();
+ $.get("/statistic/categorylist/poolID/" + poolID, function(data) {
+ $.get("/statistic/colorlist/poolID/" + poolID, function(color) {
+ if(data == '') {
+ $( "#noEventsDialog" ).dialog('open');
+ $('#plot').empty();
+ } else refreshPlot(data);
+ }, "json");
+ }, "json");
+}
+
+function refreshPlot(data, color) {
+ $('#plot').empty();
+ $.jqplot('plot', data, {
+ seriesDefaults: {
+ //renderer: $.jqplot.PieRenderer,
+ renderer: $.jqplot.BarRenderer,
+ pointLabels: { show: true, edgeTolerance: -15 },
+ shadowAngle: 135,
+ rendererOptions: {
+ //showDataLabels: true,
+ barDirection: 'horizontal',
+ varyBarColor : true
+ }
+ },
+ axes: {
+ yaxis: {
+ renderer: $.jqplot.CategoryAxisRenderer
+ },
+ xaxis: {
+ renderer: $.jqplot.CategoryAxisRenderer
+ }
+ },
+ seriesColors: [ "green", "blue", "red", "yellow" ], //color,
+ highlighter: { show: false }
+ });
+}
+
+$(document).ready(function(){
+
+ //fetch poollist from pbs database
+ $.get("/event/getpoollist/", function(getpoollistresult){
+ $("#poolselectbox").append(getpoollistresult);
+ poolIDtmp = $("#poolselectbox option:selected").val();
+ fetchPoolEvents();
+ });
+});
+
+$(function() {
+ $( "#noEventsDialog" ).dialog({
+ autoOpen: false,
+ width: 600,
+ modal: true,
+ title: "No Events",
+ buttons: {
+ "OK": function() {
+ $(this).dialog("close");
+ }
+ },
+ open: function () {
+ $(".ui-dialog-titlebar-close").hide();
+ //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
+ }
+ });
+ });
+
+</script>
+
+<div id="plot"
+ style="height: 400px; width: 700px;"></div>
+
+<!-- no events -->
+<div id="noEventsDialog" style="display: none">
+<p>There are no events in this pool to plot a statistic</p>
+</div> \ No newline at end of file
diff --git a/application/views/scripts/statistic/running.phtml b/application/views/scripts/statistic/running.phtml
new file mode 100644
index 0000000..ada2431
--- /dev/null
+++ b/application/views/scripts/statistic/running.phtml
@@ -0,0 +1,33 @@
+<h1>Statistic - Running</h1>
+
+<link
+ rel="stylesheet" type="text/css"
+ href="/media/css/jquery.jqplot.min.css" />
+
+<select id="poolselectbox" name="PoolSelectbox"
+ onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
+ <option value="default">Please choose a Pool</option>
+</select>
+
+<script>
+
+//fetch all poolevents of the selected #poolselectbox value
+function fetchPoolEvents() {
+ poolID = $("#poolselectbox option:selected").val();
+}
+
+function setPoolIDtmp() {
+ poolIDtmp = $("#poolselectbox option:selected").val();
+ }
+
+$(document).ready(function(){
+
+ //fetch poollist from pbs database
+ $.get("/event/getpoollist/", function(getpoollistresult){
+ $("#poolselectbox").append(getpoollistresult);
+ poolIDtmp = $("#poolselectbox option:selected").val();
+ fetchPoolEvents();
+ });
+});
+
+</script> \ No newline at end of file