From 7e7aced5a15c75d059bcf56bbf0a4bfd978d5928 Mon Sep 17 00:00:00 2001 From: Nael Date: Thu, 20 Feb 2014 15:42:14 +0100 Subject: [PATCH 01/11] poll count --- uVote/api/votes/votes.php | 3 ++ uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php | 11 ++++++ uVote/page/default_page/js/loadtexts.js | 37 +++++++++++++------ uVote/page/user_main_urVote/all_polls.tpl | 1 + uVote/page/user_main_urVote/urVote.tpl | 4 +- .../user_main_urVote/user_main_urVote.php | 11 +++++- 6 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php create mode 100644 uVote/page/user_main_urVote/all_polls.tpl diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 9e46688..8f2ef04 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -3,6 +3,9 @@ class votes { public static function getAllVotesOfGroup($groupid){ return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));} + + public static function countAllPolls($group){ + return \DBD\UVOTE_DATA_COUNT_VOTES::QP($group);} public static function insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){ return \DBD\UVOTE_GENERATE_VOTELIST::QI(array($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice));} diff --git a/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php b/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php new file mode 100644 index 0000000..1cac244 --- /dev/null +++ b/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php @@ -0,0 +1,11 @@ +
${urVote_title}
+
${urVote_user_party_compare}
${choices_user_ID} @@ -12,6 +13,7 @@ ${choices_bt_to_user} - + + ${poll_compare} \ No newline at end of file diff --git a/uVote/page/user_main_urVote/user_main_urVote.php b/uVote/page/user_main_urVote/user_main_urVote.php index f65bacd..396187c 100644 --- a/uVote/page/user_main_urVote/user_main_urVote.php +++ b/uVote/page/user_main_urVote/user_main_urVote.php @@ -1,8 +1,14 @@ user_per_party_overall(); $vars['choices_bt_to_user'] = $this->user_to_bt(); + $vars['poll_compare'] = $this->count_all_polls(); $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); $vars = array_merge($vars, \SYSTEM\locale::getStrings(150)); From 41068ea7b0aa37c3df11e09d66c163bdab0a5cdf Mon Sep 17 00:00:00 2001 From: Nael Date: Fri, 21 Feb 2014 13:00:55 +0100 Subject: [PATCH 02/11] statistics --- uVote/api/votes/votes.php | 5 +++-- uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php | 4 ++-- uVote/page/default_page/default_page.php | 7 +++++-- uVote/page/user_main_urVote/user_main_urVote.php | 14 +++++++------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 8f2ef04..5b8a4cc 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -4,8 +4,9 @@ class votes { public static function getAllVotesOfGroup($groupid){ return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));} - public static function countAllPolls($group){ - return \DBD\UVOTE_DATA_COUNT_VOTES::QP($group);} + public static function countAllPolls(){ + $res = \DBD\UVOTE_DATA_COUNT_VOTES::QQ(); + return $res;} public static function insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){ return \DBD\UVOTE_GENERATE_VOTELIST::QI(array($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice));} diff --git a/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php b/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php index 1cac244..a0348f0 100644 --- a/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php +++ b/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php @@ -1,11 +1,11 @@ 0 ? 'Abstimmen' : 'Ansehen'; $vote['time_left'] = round($time_remain/($time_span+1)*100,0); $vote['time_done'] = 100-$vote['time_left']; + if($time_remain > 0){ + $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); } else { $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); @@ -68,11 +71,11 @@ class default_page extends SYSTEM\PAGE\Page { public function html(){ $vars = array(); $vars['js'] = $this->js(); - $vars['css'] = $this->css(); + $vars['css'] = $this->css(); $vars['votelist'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->generate_votelist() : $this->get_coverpage() ; $vars['registerform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->getloggedinform() : $this->exchange_registerform(); $vars['loginform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->exchange_loginform() : $this->getloginform() ; - $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; + $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); $vars = array_merge($vars, \SYSTEM\locale::getStrings(150)); diff --git a/uVote/page/user_main_urVote/user_main_urVote.php b/uVote/page/user_main_urVote/user_main_urVote.php index 396187c..ea4691b 100644 --- a/uVote/page/user_main_urVote/user_main_urVote.php +++ b/uVote/page/user_main_urVote/user_main_urVote.php @@ -3,9 +3,9 @@ class user_main_urVote extends SYSTEM\PAGE\Page { private function count_all_polls (){ $result = ''; - $vars = votes::countAllPolls(1); - new INFO('bla'.print_r($vars, true)); - return $result; + $vars = votes::countAllPolls(); + new INFO(print_r($vars, true)); + return $result; } private function user_to_bt(){ @@ -20,7 +20,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page { WHERE user_ID = ?;', array(\SYSTEM\SECURITY\Security::getUser()->id)); while($row = $res->next()){ - $row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2); + $row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH']+1)*100,2); $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/bt_to_user_overall.tpl'), $row);; } return $result; @@ -45,10 +45,10 @@ class user_main_urVote extends SYSTEM\PAGE\Page { } public function html(){ - $vars = array(); - $vars['choices_user_ID'] = $this->user_per_party_overall(); - $vars['choices_bt_to_user'] = $this->user_to_bt(); + $vars = array(); $vars['poll_compare'] = $this->count_all_polls(); + $vars['choices_user_ID'] = $this->user_per_party_overall(); + $vars['choices_bt_to_user'] = $this->user_to_bt(); $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); $vars = array_merge($vars, \SYSTEM\locale::getStrings(150)); From 4993da10e91d76c93e985bceaa5de22f57a40142 Mon Sep 17 00:00:00 2001 From: Nael Date: Sat, 22 Feb 2014 11:10:33 +0100 Subject: [PATCH 03/11] new data --- uVote/api/votes/votes.php | 5 ++++ uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php | 11 ++++++++ uVote/page/default_bulletin/bulletin.tpl | 27 +++++++++---------- uVote/page/default_page/page.tpl | 2 +- uVote/page/user_main/main_menu.tpl | 16 +++++------ uVote/page/user_main_uVote/uVote.tpl | 23 ++++++++++++---- .../page/user_main_uVote/user_main_uVote.php | 24 +++++++++++++++++ .../page/user_main_uVote/votecountchoice.tpl | 9 ++++--- .../user_main_uVote/votecountchoicebt.tpl | 4 +++ uVote/page/user_main_urVote/urVote.tpl | 3 +-- .../user_main_urVote/user_main_urVote.php | 10 ++++--- 11 files changed, 97 insertions(+), 37 deletions(-) create mode 100644 uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php create mode 100644 uVote/page/user_main_uVote/votecountchoicebt.tpl diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 5b8a4cc..f57a2d3 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -72,6 +72,11 @@ class votes { return $res; } + public static function get_all_votes_bt(){ + $res = \DBD\UVOTE_DATA_CHOICE_BT_OVERALL::QA(); + return $res; + } + public static function get_bar_bt_per_poll($poll_ID){ return \DBD\UVOTE_DATA_BT_PER_POLL::Q1(array($poll_ID));} diff --git a/uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php b/uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php new file mode 100644 index 0000000..b096ef1 --- /dev/null +++ b/uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php @@ -0,0 +1,11 @@ + - ${bars_user} +
+
+ ${bars_user} +
+
+

Ergebnis Bundestag

+ ${bars_bt} +
+
+ ${bars_party} +
-
-

Ergebnis Bundestag

- ${bars_bt} -
+ -
- +
${vote_buttons}
-

- -
- ${bars_party} -
-
\ No newline at end of file diff --git a/uVote/page/default_page/page.tpl b/uVote/page/default_page/page.tpl index 4daa1b9..380da23 100644 --- a/uVote/page/default_page/page.tpl +++ b/uVote/page/default_page/page.tpl @@ -42,7 +42,7 @@
-
+
${votelist}
diff --git a/uVote/page/user_main/main_menu.tpl b/uVote/page/user_main/main_menu.tpl index e35e4c8..777c250 100644 --- a/uVote/page/user_main/main_menu.tpl +++ b/uVote/page/user_main/main_menu.tpl @@ -1,4 +1,4 @@ -
+
-
-
-

uVote BETA Feedback

- -
- -
\ No newline at end of file +
+
+

uVote BETA Feedback

+ +
+ +
diff --git a/uVote/page/user_main_uVote/uVote.tpl b/uVote/page/user_main_uVote/uVote.tpl index ab0a69b..6dbed93 100644 --- a/uVote/page/user_main_uVote/uVote.tpl +++ b/uVote/page/user_main_uVote/uVote.tpl @@ -1,6 +1,19 @@ - - - - +
+ +
Entscheidungsverhalten der uVote Community
+ ${votes_all} -
${uVote_overall_votes_title}
\ No newline at end of file + + Wie oft die uVote Community +
insgesamt Dafür, Dagegen oder +
Enthaltung gestimmt hat.
+
+
+
Entscheidungsverhalten des Bundestags
+ + ${votes_all_bt} + + Wie oft der Bundestag +
Dafür, Dagegen oder +
Enthaltung gestimmt hat.
+
\ No newline at end of file diff --git a/uVote/page/user_main_uVote/user_main_uVote.php b/uVote/page/user_main_uVote/user_main_uVote.php index 79f5ea6..16515ee 100644 --- a/uVote/page/user_main_uVote/user_main_uVote.php +++ b/uVote/page/user_main_uVote/user_main_uVote.php @@ -22,10 +22,34 @@ class user_main_uVote extends SYSTEM\PAGE\Page { } return $result; } + private function votes_all_bt(){ + $votes = votes::get_all_votes_bt(); + $result = ''; + foreach($votes as $vote){ + switch($vote['bt_choice']){ + case 1: + $vote['bt_choice'] = 'PRO'; + break; + case 2: + $vote['bt_choice'] = 'CONTRA'; + break; + case 3: + $vote['bt_choice'] = 'ENTH'; + break; + case 0: + $vote['bt_choice'] = 'OPEN'; + } + //$vote['count']; + //$vote['choice']; + $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/votecountchoicebt.tpl'),$vote); + } + return $result; + } public function html(){ $vars = array(); $vars['votes_all'] = $this->votes_all(); + $vars['votes_all_bt'] = $this->votes_all_bt(); $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); $vars = array_merge($vars, \SYSTEM\locale::getStrings(150)); return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars); diff --git a/uVote/page/user_main_uVote/votecountchoice.tpl b/uVote/page/user_main_uVote/votecountchoice.tpl index 0ffd93f..aef1e8b 100644 --- a/uVote/page/user_main_uVote/votecountchoice.tpl +++ b/uVote/page/user_main_uVote/votecountchoice.tpl @@ -1,4 +1,5 @@ - - ${choice} - ${count} - \ No newline at end of file +
+${choice} +${count} + +
diff --git a/uVote/page/user_main_uVote/votecountchoicebt.tpl b/uVote/page/user_main_uVote/votecountchoicebt.tpl new file mode 100644 index 0000000..dfd975b --- /dev/null +++ b/uVote/page/user_main_uVote/votecountchoicebt.tpl @@ -0,0 +1,4 @@ +
+${bt_choice} +${count} +
diff --git a/uVote/page/user_main_urVote/urVote.tpl b/uVote/page/user_main_urVote/urVote.tpl index e6ccf71..3fa6692 100644 --- a/uVote/page/user_main_urVote/urVote.tpl +++ b/uVote/page/user_main_urVote/urVote.tpl @@ -14,6 +14,5 @@ ${choices_bt_to_user} - - ${poll_compare} + \ No newline at end of file diff --git a/uVote/page/user_main_urVote/user_main_urVote.php b/uVote/page/user_main_urVote/user_main_urVote.php index ea4691b..0fb2d47 100644 --- a/uVote/page/user_main_urVote/user_main_urVote.php +++ b/uVote/page/user_main_urVote/user_main_urVote.php @@ -21,12 +21,16 @@ class user_main_urVote extends SYSTEM\PAGE\Page { array(\SYSTEM\SECURITY\Security::getUser()->id)); while($row = $res->next()){ $row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH']+1)*100,2); + $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/bt_to_user_overall.tpl'), $row);; } - return $result; + return $result; + $row['votes_cast'] = round(($row['class_MATCH']+$row['class_MISSMATCH']),2); } - private function user_per_party_overall(){ + + + private function user_per_party_overall(){ //$vars = votes::get_user_per_party_overall(array(\SYSTEM\SECURITY\Security::getUser()->id)); $result = ''; $con = new \SYSTEM\DB\Connection(); @@ -46,7 +50,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page { public function html(){ $vars = array(); - $vars['poll_compare'] = $this->count_all_polls(); +// $vars['poll_compare'] = $this->count_all_polls(); $vars['choices_user_ID'] = $this->user_per_party_overall(); $vars['choices_bt_to_user'] = $this->user_to_bt(); $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; From ebaf058a70771935a5e61cdd9ff25f87cc0d9dcd Mon Sep 17 00:00:00 2001 From: Nael Date: Sun, 23 Feb 2014 21:48:10 +0100 Subject: [PATCH 04/11] statistics for vote.tpl thx to rylon --- uVote/api/votes/votes.php | 8 +++ .../qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php | 11 ++++ .../qq/UVOTE_DATA_USERS_CHOICE_PER_POLL.php | 11 ++++ uVote/page/default_page/default_page.php | 51 +++++++++++++++++-- uVote/page/default_page/parties_on_vote.tpl | 4 ++ uVote/page/default_page/vote.tpl | 18 +++---- .../user_main_urVote/bt_to_user_overall.tpl | 2 +- 7 files changed, 92 insertions(+), 13 deletions(-) create mode 100644 uVote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php create mode 100644 uVote/dbd/qq/UVOTE_DATA_USERS_CHOICE_PER_POLL.php create mode 100644 uVote/page/default_page/parties_on_vote.tpl diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index f57a2d3..463be9a 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -87,6 +87,9 @@ class votes { return \DBD\UVOTE_DATA_USER_TO_BT::QA(array($user_ID)); } + public static function get_users_choice_per_poll($poll_ID){ + return \DBD\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));} + public static function get_voteinfo($poll_ID){ $con = new \SYSTEM\DB\Connection(new \DBD\uVote()); $res = $con->prepare( 'selVoteByID', @@ -98,6 +101,11 @@ class votes { public static function get_barsperparty($poll_ID){ return \DBD\UVOTE_DATA_PARTY_PER_POLL::QA(array($poll_ID));} + + public static function get_party_choice($poll_ID, $party){ + $res = \DBD\UVOTE_DATA_PARTY_CHOICE_PER_POLL::Q1(array($poll_ID, $party)); + return $res; + } public static function write_vote($poll_ID, $vote){ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ diff --git a/uVote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php b/uVote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php new file mode 100644 index 0000000..8998286 --- /dev/null +++ b/uVote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php @@ -0,0 +1,11 @@ +tablerow_class(votes::getUserPollData($vote['ID'])); + $vote['vote_class'] = $this->tablerow_class(votes::getUserPollData($vote['ID'])); $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); $vote['full_vote_btn'] = $time_remain > 0 ? 'Abstimmen' : 'Ansehen'; $vote['time_left'] = round($time_remain/($time_span+1)*100,0); $vote['time_done'] = 100-$vote['time_left']; + $cdu = votes::get_party_choice($vote['ID'], 'cdu'); + $vote['cdu'] = $this->get_party_per_poll($cdu['choice']); + $vote['choice_class_cdu'] = $this->tablerow_class($cdu['choice']); + $csu = votes::get_party_choice($vote['ID'], 'csu'); + $vote['csu'] = $this->get_party_per_poll($csu['choice']); + $vote['choice_class_csu'] = $this->tablerow_class($csu['choice']); + $spd = votes::get_party_choice($vote['ID'], 'spd'); + $vote['spd'] = $this->get_party_per_poll($spd['choice']); + $vote['choice_class_spd'] = $this->tablerow_class($spd['choice']); + $gruene = votes::get_party_choice($vote['ID'], 'gruene'); + $vote['gruene'] = $this->get_party_per_poll($gruene['choice']); + $vote['choice_class_gruene'] = $this->tablerow_class($gruene['choice']); + $linke = votes::get_party_choice($vote['ID'], 'linke'); + $vote['linke'] = $this->get_party_per_poll($linke['choice']); + $vote['choice_class_linke'] = $this->tablerow_class($linke['choice']); - if($time_remain > 0){ - + $uvote = votes::get_users_choice_per_poll($vote['ID']); + $vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : ''; + + $vote['uv_pro'] = $vote['uv_con'] = $vote['uv_ent'] = '<2'; + foreach($uvote as $v){ + switch($v['choice']){ + case 1: $vote['uv_pro'] = $v['count'] > 1 ? $v['count'] : '<2'; break; + case 2: $vote['uv_con'] = $v['count'] > 1 ? $v['count'] : '<2'; break; + case 3: $vote['uv_ent'] = $v['count'] > 1 ? $v['count'] : '<2'; break; + default: + } + } + $vote['title'] = utf8_encode($vote['title']); + + if($time_remain > 0){ $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); } else { $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); @@ -53,6 +81,23 @@ class default_page extends SYSTEM\PAGE\Page { return $result[0].$result[1]; } + private function get_party_per_poll($choice){ + switch($choice){ + case 1: + return 'PRO'; + case 2: + return 'CON'; + case 3: + return 'ENT'; + default: + return 'NONE'; + } + + + + } + + public function get_coverpage(){ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/cover.tpl'), array());} diff --git a/uVote/page/default_page/parties_on_vote.tpl b/uVote/page/default_page/parties_on_vote.tpl new file mode 100644 index 0000000..5a66521 --- /dev/null +++ b/uVote/page/default_page/parties_on_vote.tpl @@ -0,0 +1,4 @@ + + ${choice}
+ + \ No newline at end of file diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index 624efaa..256620c 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -6,17 +6,17 @@ ${full_vote_btn} - 123
- 123
- 123
- 123
- 123 + ${cdu}
+ ${csu}
+ ${spd}
+ ${gruene}
+ ${linke} - + uv - 123 - 123 - 123 + ${uv_pro} + ${uv_con} + ${uv_ent} diff --git a/uVote/page/user_main_urVote/bt_to_user_overall.tpl b/uVote/page/user_main_urVote/bt_to_user_overall.tpl index cd2c1f8..34cff78 100644 --- a/uVote/page/user_main_urVote/bt_to_user_overall.tpl +++ b/uVote/page/user_main_urVote/bt_to_user_overall.tpl @@ -4,5 +4,5 @@ ${class_MATCH} ${class_MISSMATCH} - ${match_percentage} + ${match_percentage}% \ No newline at end of file From 7d3eead162bd035cce824b1299c7640d8ea4c086 Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 23 Feb 2014 21:48:24 +0100 Subject: [PATCH 05/11] uvote sql sample --- uVote/dbd/qq/select_user_voted_notvoted_overall.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 uVote/dbd/qq/select_user_voted_notvoted_overall.sql diff --git a/uVote/dbd/qq/select_user_voted_notvoted_overall.sql b/uVote/dbd/qq/select_user_voted_notvoted_overall.sql new file mode 100644 index 0000000..9c4f4e5 --- /dev/null +++ b/uVote/dbd/qq/select_user_voted_notvoted_overall.sql @@ -0,0 +1,2 @@ +SELECT SUM(CASE WHEN uvote_data.user_ID = 15 THEN 1 ELSE 0 END) as voted, + SUM(CASE WHEN uvote_data.user_ID = 15 THEN 0 ELSE 1 END) as not_voted FROM uvote_data RIGHT JOIN uvote_votes ON ( uvote_data.poll_ID = uvote_votes.ID AND uvote_data.user_ID = 15); \ No newline at end of file From fbcde01b67b11f7998b04c9ccc09c70537a66b8f Mon Sep 17 00:00:00 2001 From: Nael Date: Sun, 23 Feb 2014 23:35:53 +0100 Subject: [PATCH 06/11] nice new statistics... oh man world revolution is coming DUDES! --- uVote/api/votes/votes.php | 3 +++ uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php | 11 --------- uVote/dbd/qq/UVOTE_DATA_TEMP_VOTES.php | 13 +++++++++++ uVote/page/user_main/main_menu.tpl | 2 +- .../page/user_main_uVote/user_main_uVote.php | 2 +- uVote/page/user_main_urVote/all_polls.tpl | 8 ++++++- uVote/page/user_main_urVote/urVote.tpl | 23 +++++++++++-------- .../user_main_urVote/user_main_urVote.php | 15 +++++++----- 8 files changed, 47 insertions(+), 30 deletions(-) delete mode 100644 uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php create mode 100644 uVote/dbd/qq/UVOTE_DATA_TEMP_VOTES.php diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 463be9a..97a464e 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -77,6 +77,9 @@ class votes { return $res; } + public static function get_user_temp_votes($user_ID){ + return \DBD\UVOTE_DATA_TEMP_VOTES::Q1(array($user_ID, $user_ID, $user_ID));} + public static function get_bar_bt_per_poll($poll_ID){ return \DBD\UVOTE_DATA_BT_PER_POLL::Q1(array($poll_ID));} diff --git a/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php b/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php deleted file mode 100644 index a0348f0..0000000 --- a/uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php +++ /dev/null @@ -1,11 +0,0 @@ - +
+
+ ${voice_weight} +

Ergebnis Bundestag

${bars_bt} @@ -16,6 +19,6 @@
${vote_buttons}
-
+ \ No newline at end of file diff --git a/uVote/page/default_bulletin/default_bulletin.php b/uVote/page/default_bulletin/default_bulletin.php index 57f0d4d..3a8fea8 100644 --- a/uVote/page/default_bulletin/default_bulletin.php +++ b/uVote/page/default_bulletin/default_bulletin.php @@ -38,6 +38,12 @@ class default_bulletin extends SYSTEM\PAGE\Page { return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_bt.tpl'), $vars); } + private function voice_weight(){ + $vars = votes::get_count_user_votes_per_poll($this->poll_ID); + $vars['voteweight'] = 1/$vars['count']*100; + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);; + } + private function vote_buttons($poll_expired){ $user_poll = votes::getUserPollData($this->poll_ID); if($poll_expired){ @@ -105,6 +111,7 @@ class default_bulletin extends SYSTEM\PAGE\Page { $vars['css'] = $this->css(); $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; $vars ['vote_buttons'] = $this->vote_buttons($poll_expired); + $vars['voice_weight'] = $this->voice_weight(); $vars['poll_ID'] = $this->poll_ID; $vars = array_merge($vars,votes::get_voteinfo($this->poll_ID)); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$vars); diff --git a/uVote/page/default_bulletin/voteweight.tpl b/uVote/page/default_bulletin/voteweight.tpl new file mode 100644 index 0000000..fc5d06f --- /dev/null +++ b/uVote/page/default_bulletin/voteweight.tpl @@ -0,0 +1,4 @@ +
+ Dein aktuelles Stimmgewicht bei dieser Abstimmung: + ${voteweight}% +
\ No newline at end of file diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index 256620c..b03f632 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -1,25 +1,27 @@ - + + - - + - -
+

${title}

- Nr.${ID} - ${full_vote_btn} + ${full_vote_btn}
+ ${cdu}
${csu}
${spd}
${gruene}
${linke}
- uv - ${uv_pro} - ${uv_con} - ${uv_ent} - + + + ${uv_pro} + ${uv_con} + ${uv_ent} + diff --git a/uVote/page/user_main_uVote/uVote.tpl b/uVote/page/user_main_uVote/uVote.tpl index 6dbed93..fcda0fd 100644 --- a/uVote/page/user_main_uVote/uVote.tpl +++ b/uVote/page/user_main_uVote/uVote.tpl @@ -15,5 +15,10 @@ Wie oft der Bundestag
Dafür, Dagegen oder -
Enthaltung gestimmt hat.
- \ No newline at end of file +
Enthaltung gestimmt hat. + +
+
+
+ ${user_count} Nutzer auf uVote +
\ No newline at end of file diff --git a/uVote/page/user_main_uVote/user_main_uVote.php b/uVote/page/user_main_uVote/user_main_uVote.php index 237db0e..3abb4c2 100644 --- a/uVote/page/user_main_uVote/user_main_uVote.php +++ b/uVote/page/user_main_uVote/user_main_uVote.php @@ -46,10 +46,17 @@ class user_main_uVote extends SYSTEM\PAGE\Page { return $result; } + private function user_count(){ + $vars = votes::get_user_count(); + return $vars['count']; + } + + public function html(){ $vars = array(); $vars['votes_all'] = $this->votes_all(); $vars['votes_all_bt'] = $this->votes_all_bt(); + $vars['user_count'] = $this->user_count(); $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); $vars = array_merge($vars, \SYSTEM\locale::getStrings(150)); return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars); From 97a3a80150b7e3fbea29c198cd0b85670fb4ac58 Mon Sep 17 00:00:00 2001 From: Nael Date: Sat, 1 Mar 2014 16:36:18 +0100 Subject: [PATCH 08/11] corrected bar --- uVote/page/user_main_uVote/uVote.tpl | 7 ++++--- uVote/page/user_main_urVote/all_polls.tpl | 14 ++++++++------ uVote/page/user_main_urVote/urVote.tpl | 2 +- uVote/page/user_main_urVote/user_main_urVote.php | 4 +++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/uVote/page/user_main_uVote/uVote.tpl b/uVote/page/user_main_uVote/uVote.tpl index fcda0fd..339476d 100644 --- a/uVote/page/user_main_uVote/uVote.tpl +++ b/uVote/page/user_main_uVote/uVote.tpl @@ -1,15 +1,16 @@ -
+
Entscheidungsverhalten der uVote Community
- + ${votes_all} Wie oft die uVote Community
insgesamt Dafür, Dagegen oder
Enthaltung gestimmt hat.
-
+
Entscheidungsverhalten des Bundestags
+
${votes_all_bt} diff --git a/uVote/page/user_main_urVote/all_polls.tpl b/uVote/page/user_main_urVote/all_polls.tpl index ee3c9f4..474008d 100644 --- a/uVote/page/user_main_urVote/all_polls.tpl +++ b/uVote/page/user_main_urVote/all_polls.tpl @@ -1,7 +1,9 @@ -
Deine aktuelle Abstimmungsquote
-
Abgestimmt/
-
Offene Abstimmungen
-
-
-
+
Deine Abstimmungsquote
+
+
Abgestimmt/
+
Offen
+
+
${voted}
+
${not_voted}
+
\ No newline at end of file diff --git a/uVote/page/user_main_urVote/urVote.tpl b/uVote/page/user_main_urVote/urVote.tpl index e4d58bb..59f468d 100644 --- a/uVote/page/user_main_urVote/urVote.tpl +++ b/uVote/page/user_main_urVote/urVote.tpl @@ -13,7 +13,7 @@
-
+
${user_temp_votes}
diff --git a/uVote/page/user_main_urVote/user_main_urVote.php b/uVote/page/user_main_urVote/user_main_urVote.php index 1261ccc..956a30b 100644 --- a/uVote/page/user_main_urVote/user_main_urVote.php +++ b/uVote/page/user_main_urVote/user_main_urVote.php @@ -7,7 +7,9 @@ class user_main_urVote extends SYSTEM\PAGE\Page { $nv = $vars['not_voted']; return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/all_polls.tpl'), array( 'vote_perc'=> round($v/($nv+$v)*100,0), - 'no_vote_perc'=> round($nv/($nv+$v)*100,0))); + 'no_vote_perc'=> round($nv/($nv+$v)*100,0), + 'voted'=> $v, + 'not_voted'=> $nv)); } private function user_to_bt(){ From 89eac11f932832fd16e5931bd73098f4a9b6bea5 Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 2 Mar 2014 18:07:49 +0100 Subject: [PATCH 09/11] fixed uvote all-votes-display stuff --- uVote/page/default_page/default_page.php | 82 +++++++++++++----------- uVote/page/default_page/vote.tpl | 17 ++--- uVote/page/default_page/vote_bt.tpl | 1 + uVote/page/default_page/vote_uv.tpl | 1 + 4 files changed, 52 insertions(+), 49 deletions(-) create mode 100644 uVote/page/default_page/vote_bt.tpl create mode 100644 uVote/page/default_page/vote_uv.tpl diff --git a/uVote/page/default_page/default_page.php b/uVote/page/default_page/default_page.php index 4c35dda..ae06b1f 100644 --- a/uVote/page/default_page/default_page.php +++ b/uVote/page/default_page/default_page.php @@ -30,47 +30,59 @@ class default_page extends SYSTEM\PAGE\Page { } } - public function generate_votelist(){ - + private static function badge_class($choice){ + switch($choice){ + case 1: + return 'badge-success'; + case 2: + return 'badge-important'; + case 3: + return ''; + default: + return ''; + } + } + + public function generate_votelist(){ $result = array('',''); $votes = votes::getAllVotesOfGroup(1); foreach($votes as $vote){ $time_remain = strtotime($vote['time_end'])- microtime(true); $time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']); - $vote['vote_class'] = $this->tablerow_class(votes::getUserPollData($vote['ID'])); - $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); - $vote['full_vote_btn'] = $time_remain > 0 ? 'Abstimmen' : 'Ansehen'; + $vote_count = votes::get_count_user_votes_per_poll($vote['ID']); + + $vote['title'] = utf8_encode($vote['title']); $vote['time_left'] = round($time_remain/($time_span+1)*100,0); $vote['time_done'] = 100-$vote['time_left']; - $cdu = votes::get_party_choice($vote['ID'], 'cdu'); - $vote['cdu'] = $this->get_party_per_poll($cdu['choice']); - $vote['choice_class_cdu'] = $this->tablerow_class($cdu['choice']); - $csu = votes::get_party_choice($vote['ID'], 'csu'); - $vote['csu'] = $this->get_party_per_poll($csu['choice']); - $vote['choice_class_csu'] = $this->tablerow_class($csu['choice']); - $spd = votes::get_party_choice($vote['ID'], 'spd'); - $vote['spd'] = $this->get_party_per_poll($spd['choice']); - $vote['choice_class_spd'] = $this->tablerow_class($spd['choice']); - $gruene = votes::get_party_choice($vote['ID'], 'gruene'); - $vote['gruene'] = $this->get_party_per_poll($gruene['choice']); - $vote['choice_class_gruene'] = $this->tablerow_class($gruene['choice']); - $linke = votes::get_party_choice($vote['ID'], 'linke'); - $vote['linke'] = $this->get_party_per_poll($linke['choice']); - $vote['choice_class_linke'] = $this->tablerow_class($linke['choice']); - $uvote = votes::get_users_choice_per_poll($vote['ID']); - $vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : ''; - - $vote['uv_pro'] = $vote['uv_con'] = $vote['uv_ent'] = '<2'; - foreach($uvote as $v){ - switch($v['choice']){ - case 1: $vote['uv_pro'] = $v['count'] > 1 ? $v['count'] : '<2'; break; - case 2: $vote['uv_con'] = $v['count'] > 1 ? $v['count'] : '<2'; break; - case 3: $vote['uv_ent'] = $v['count'] > 1 ? $v['count'] : '<2'; break; - default: + $vote['full_vote_btn'] = $time_remain > 0 ? 'Abstimmen' : 'Ansehen'; + $vote['uv'] = $vote['bt'] = ''; + $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5'; + + $user_vote = votes::getUserPollData($vote['ID']); + if($user_vote){ + //user vote + $vote['vote_class'] = $this->tablerow_class($user_vote); + + //bt vote + $party_votes = votes::get_barsperparty($vote['ID']); + $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); + foreach($party_votes as $pv){ + $vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_bt.tpl'), + array( 'party' => $pv['party'], + 'choice' => $this->get_party_per_poll($pv['choice']), + 'choice_class' => $this->tablerow_class($pv['choice']))); + } + + //uvote vote + $uvote = votes::get_users_choice_per_poll($vote['ID']); + $vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : ''; + foreach($uvote as $v){ + $vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_uv.tpl'), + array( 'badge' => self::badge_class($v['choice']), + 'perc' => $v['count'] > 0 ? $v['count']/$vote_count['count']*100 : 0)); } } - $vote['title'] = utf8_encode($vote['title']); if($time_remain > 0){ $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); @@ -82,7 +94,7 @@ class default_page extends SYSTEM\PAGE\Page { } private function get_party_per_poll($choice){ - switch($choice){ + switch($choice){ case 1: return 'PRO'; case 2: @@ -91,13 +103,9 @@ class default_page extends SYSTEM\PAGE\Page { return 'ENT'; default: return 'NONE'; - } - - - + } } - public function get_coverpage(){ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/cover.tpl'), array());} diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index b03f632..a42a295 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -8,20 +8,13 @@
- ${cdu}
- ${csu}
- ${spd}
- ${gruene}
- ${linke} + ${bt}
- - ${uv_pro} - ${uv_con} - ${uv_ent} - + +
+ ${uv} + ${uv_count}
diff --git a/uVote/page/default_page/vote_bt.tpl b/uVote/page/default_page/vote_bt.tpl new file mode 100644 index 0000000..57a4a31 --- /dev/null +++ b/uVote/page/default_page/vote_bt.tpl @@ -0,0 +1 @@ +${choice}
\ No newline at end of file diff --git a/uVote/page/default_page/vote_uv.tpl b/uVote/page/default_page/vote_uv.tpl new file mode 100644 index 0000000..0172bb6 --- /dev/null +++ b/uVote/page/default_page/vote_uv.tpl @@ -0,0 +1 @@ +${perc}%
\ No newline at end of file From 52c61c5eb4a2518a56f73eafdc9ebd05428ced56 Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 2 Mar 2014 18:22:16 +0100 Subject: [PATCH 10/11] fixed visibility of vote-results in bulletin --- .../default_bulletin/default_bulletin.php | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/uVote/page/default_bulletin/default_bulletin.php b/uVote/page/default_bulletin/default_bulletin.php index 3a8fea8..78aa978 100644 --- a/uVote/page/default_bulletin/default_bulletin.php +++ b/uVote/page/default_bulletin/default_bulletin.php @@ -44,8 +44,7 @@ class default_bulletin extends SYSTEM\PAGE\Page { return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);; } - private function vote_buttons($poll_expired){ - $user_poll = votes::getUserPollData($this->poll_ID); + private function vote_buttons($poll_expired,$user_poll){ if($poll_expired){ if(!$user_poll){ return '

Stimme hier ab

@@ -98,21 +97,29 @@ class default_bulletin extends SYSTEM\PAGE\Page { public function html(){ $poll_expired = \DBD\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID)); + $user_vote = votes::getUserPollData($this->poll_ID); /*$poll_data = array(); $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(1)); $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(2)); $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(3));*/ $vars = array(); - $vars['bars_party'] = $poll_expired ? '' : $this->bars_party(); - $vars['bars_user'] = $this->bars_user(); - $vars['bars_bt'] = $this->bars_bt(); + $vars['bars_party'] = $vars['bars_user'] = $vars['bars_bt'] = $vars['voice_weight'] = 'Vote to see results!'; $vars['js'] = $this->js(); $vars['css'] = $this->css(); - $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; - $vars ['vote_buttons'] = $this->vote_buttons($poll_expired); - $vars['voice_weight'] = $this->voice_weight(); + $vars['poll_ID'] = $this->poll_ID; + $vars['vote_buttons'] = $this->vote_buttons($poll_expired,$user_vote); + + if($user_vote){ + $vars['bars_party'] = $poll_expired ? '' : $this->bars_party(); + $vars['bars_user'] = $this->bars_user(); + $vars['bars_bt'] = $this->bars_bt(); + $vars['voice_weight'] = $this->voice_weight(); + } + + $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; + $vars = array_merge($vars,votes::get_voteinfo($this->poll_ID)); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$vars); } From 44637112aeeea4b9df5e357da695fd84091ede40 Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 2 Mar 2014 18:26:22 +0100 Subject: [PATCH 11/11] cleanup --- .../default_bulletin/default_bulletin.php | 12 +++---- uVote/page/default_page/default_page.php | 33 +++++++++---------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/uVote/page/default_bulletin/default_bulletin.php b/uVote/page/default_bulletin/default_bulletin.php index 78aa978..ac36ddc 100644 --- a/uVote/page/default_bulletin/default_bulletin.php +++ b/uVote/page/default_bulletin/default_bulletin.php @@ -17,15 +17,15 @@ class default_bulletin extends SYSTEM\PAGE\Page { private function bars_party(){ $partyvotes = votes::get_barsperparty($this->poll_ID); - $pbpp = ""; + $result = ""; foreach($partyvotes as $vote){ $vote['party_yes'] = round($vote['votes_pro']/$vote['total']*100,0); $vote['party_no'] = round($vote['votes_contra']/$vote['total']*100,0); $vote['party_ent'] = round(($vote['nr_attending'] - $vote['votes_pro'] - $vote['votes_contra'])/$vote['total']*100,0); - $pbpp .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote); + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote); } - return $pbpp; + return $result; } private function bars_bt(){ @@ -41,7 +41,7 @@ class default_bulletin extends SYSTEM\PAGE\Page { private function voice_weight(){ $vars = votes::get_count_user_votes_per_poll($this->poll_ID); $vars['voteweight'] = 1/$vars['count']*100; - return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);; + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars); } private function vote_buttons($poll_expired,$user_poll){ @@ -99,10 +99,6 @@ class default_bulletin extends SYSTEM\PAGE\Page { $poll_expired = \DBD\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID)); $user_vote = votes::getUserPollData($this->poll_ID); - /*$poll_data = array(); - $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(1)); - $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(2)); - $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(3));*/ $vars = array(); $vars['bars_party'] = $vars['bars_user'] = $vars['bars_bt'] = $vars['voice_weight'] = 'Vote to see results!'; $vars['js'] = $this->js(); diff --git a/uVote/page/default_page/default_page.php b/uVote/page/default_page/default_page.php index ae06b1f..ea5b3e9 100644 --- a/uVote/page/default_page/default_page.php +++ b/uVote/page/default_page/default_page.php @@ -14,9 +14,21 @@ class default_page extends SYSTEM\PAGE\Page { } private function css(){ - return '';} - - + return '';} + + private function get_party_per_poll($choice){ + switch($choice){ + case 1: + return 'PRO'; + case 2: + return 'CON'; + case 3: + return 'ENT'; + default: + return 'NONE'; + } + } + private static function tablerow_class($choice){ switch($choice){ case 1: @@ -91,20 +103,7 @@ class default_page extends SYSTEM\PAGE\Page { } } return $result[0].$result[1]; - } - - private function get_party_per_poll($choice){ - switch($choice){ - case 1: - return 'PRO'; - case 2: - return 'CON'; - case 3: - return 'ENT'; - default: - return 'NONE'; - } - } + } public function get_coverpage(){ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/cover.tpl'), array());}