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=';