From 39f4e347eb33cd116ee5d7bd929347d52ee755f1 Mon Sep 17 00:00:00 2001 From: Nael Date: Thu, 6 Mar 2014 01:38:20 +0100 Subject: [PATCH] oh yeah, its gettin forward bitches! --- uVote/api/api_uvote.php | 3 ++ uVote/api/votes/votes.php | 12 ++++++ ...DATA_GRAPH_BT_TO_UVOTE_OVERALL_BY_TIME.php | 19 ++++++++++ uVote/dbd/qq/UVOTE_DATA_PARTY_PER_POLL.php | 2 +- .../qq/UVOTE_DATA_USERS_CHOICE_PER_POLL.php | 2 +- uVote/page/default_page/default_page.php | 6 ++- uVote/page/default_page/js/loadtexts.js | 37 ++++++++++++++++++- uVote/page/default_page/vote.tpl | 12 ++---- uVote/page/default_register/register.tpl | 2 +- uVote/page/user_main_uVote/uVote.tpl | 24 +++++++----- 10 files changed, 94 insertions(+), 25 deletions(-) create mode 100644 uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_UVOTE_OVERALL_BY_TIME.php diff --git a/uVote/api/api_uvote.php b/uVote/api/api_uvote.php index 8af9c52..0341952 100644 --- a/uVote/api/api_uvote.php +++ b/uVote/api/api_uvote.php @@ -33,4 +33,7 @@ class api_uvote extends \SYSTEM\API\api_login { return votes::vote_submit($poll_ID); } + + public static function call_graph_bt_to_uvote_overall_by_time($timespan = 84600){ + return votes::get_graph_bt_to_uvote_overall_by_time($timespan);} } diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index f568fbc..2dfbc65 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -1,6 +1,18 @@ next()){ + $result[] = array( 0 => $row['day'], + 'class_match' => $row['class_match'] / ($row['class_match']+$row['class_mismatch']+1), + 'class_mismatch' => $row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']+1)); + } + return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; + } + public static function getAllVotesOfGroup($groupid){ return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));} diff --git a/uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_UVOTE_OVERALL_BY_TIME.php b/uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_UVOTE_OVERALL_BY_TIME.php new file mode 100644 index 0000000..4ce5330 --- /dev/null +++ b/uVote/dbd/qq/UVOTE_DATA_GRAPH_BT_TO_UVOTE_OVERALL_BY_TIME.php @@ -0,0 +1,19 @@ +'. ''. ''. - ''; - ''; + ''. + ''. + ''. + ''; } private function css(){ diff --git a/uVote/page/default_page/js/loadtexts.js b/uVote/page/default_page/js/loadtexts.js index dcd7f0a..d5b2fc9 100644 --- a/uVote/page/default_page/js/loadtexts.js +++ b/uVote/page/default_page/js/loadtexts.js @@ -79,12 +79,16 @@ $(document).ready(function() { $(this).tab('show'); load_user_main_tab($(this).attr('action')); }); - + //load_user_main_tab('user_main_uVote'); - }); + }); }); +function drawChart(){ + //load_visualisation('#graph_bt_uv_overall',84600); +} + function load_user_main_tab(action){ switch(action){ @@ -236,4 +240,33 @@ function loadApiPic(id) { }).complete(function() { }); +} + +function load_visualisation(id, timespan){ + $('img#loader').show(); + $.getJSON('./api.php?call=graph_bt_to_uvote_overall_by_time',function(json){ + if(!json || json.status != true || !json.result){ + $('img#loader').hide(); + return; + } + json = json.result; + $('img#loader').hide(); + var data = new google.visualization.DataTable(); + first = true; + $.each(json[0], function(key, value){ + if(first){ + data.addColumn('datetime',key); + first = false; + } else { + data.addColumn('number',key); + } + }); + $.each(json, function(key, value){ + first = true; + data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [parseFloat(v)];}}));}); + + console.log(data); + var options = {title: id, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{}, vAxis:{logScale: false}, interpolateNulls: false, width: "300", height: "250"}; + new google.visualization.LineChart(document.getElementById(id)).draw(data, options); + }); } \ No newline at end of file diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index 6dc3f69..df93ac5 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -1,25 +1,21 @@ - - -
${title}
${full_vote_btn}
+ ${bt} + uVote
${uv} - ${uv_count} -
-
-
+ ${uv_count} +
diff --git a/uVote/page/default_register/register.tpl b/uVote/page/default_register/register.tpl index 430cbeb..7fd1828 100644 --- a/uVote/page/default_register/register.tpl +++ b/uVote/page/default_register/register.tpl @@ -1,4 +1,4 @@ -
+


diff --git a/uVote/page/user_main_uVote/uVote.tpl b/uVote/page/user_main_uVote/uVote.tpl index 09aeb18..42a3d9f 100644 --- a/uVote/page/user_main_uVote/uVote.tpl +++ b/uVote/page/user_main_uVote/uVote.tpl @@ -1,13 +1,17 @@ -
-
- ${welcome_text} - -
Übereinstimmung von uVote & Politik
- ${uvote_to_bt} - -
- +
+ ${welcome_text} +
+ + +
Übereinstimmung von uVote & Politik
+ ${uvote_to_bt} + +
+
+
+ +
+
Entscheidungsverhalten der uVote Community