-
-
-
-
-
- Impressum
-
-
diff --git a/uvote/page/default_page/tpl/vote.tpl b/uvote/page/default_page/tpl/vote.tpl
deleted file mode 100644
index c071dee..0000000
--- a/uvote/page/default_page/tpl/vote.tpl
+++ /dev/null
@@ -1,67 +0,0 @@
-
- ${impressum_header}
- ${impressum_1}
- ${impressum_2}
- ${impressum_3}
- ${impressum_4}
- ${impressum_5}
+
+
-
+
-
+
-
+
-
+ Follow @uvote_de
+
+
+
+ Impressum
+ ${loginform}
-
+
-
+
-
-
-
-
+
+ ${menu}
+
-
-
-
-
-
\ No newline at end of file
diff --git a/uvote/page/default_register/default_register.php b/uvote/page/default_register/default_register.php
index 01e5414..28b112b 100644
--- a/uvote/page/default_register/default_register.php
+++ b/uvote/page/default_register/default_register.php
@@ -4,7 +4,8 @@ class default_register extends SYSTEM\PAGE\Page {
private function css(){
return '';}
-
+ public static function js(){
+ return array(\SYSTEM\WEBPATH(new \PPAGE(),'default_register/js/default_register.js'));}
public function html(){
$vars = array();
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
diff --git a/uvote/page/default_register/js/default_register.js b/uvote/page/default_register/js/default_register.js
new file mode 100644
index 0000000..ca2aa8c
--- /dev/null
+++ b/uvote/page/default_register/js/default_register.js
@@ -0,0 +1,22 @@
+function init_default_register(){
+ register_registerform();
+ }
+ function register_registerform(){
+ //console.log("wegwegwegwegwegweg");
+ $("#register_user_form input").not("[type=submit]").jqBootstrapValidation(
+ {
+ preventSubmit: true,
+ submitError: function($form, event, errors) {},
+ submitSuccess: function($form, event){
+ $.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) {
+ if(data == 1){
+ window.location.reload();
+ } else {
+ $('#help-block-user-password-combi-wrong').attr('style', 'display: block;');
+ }
+ });
+ event.preventDefault();
+ }
+ });
+}
+
diff --git a/uvote/page/default_register/tpl/register.tpl b/uvote/page/default_register/tpl/register.tpl
index 2e9f067..7a43234 100644
--- a/uvote/page/default_register/tpl/register.tpl
+++ b/uvote/page/default_register/tpl/register.tpl
@@ -1,66 +1,19 @@
-
-
-
- ${bt}
-
-
-
-
- uVote
-
- ${uv}
-
- ${uv_count}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- Welcome + Willkommen auf uvote.eu!
-
-
-
- ${welcome_text}
-
-
-
-
- ${welcome_text}
-
-
+
+
+
diff --git a/uvote/page/user_main_impressum/user_main_impressum.php b/uvote/page/user_main_impressum/user_main_impressum.php
new file mode 100644
index 0000000..ac51a6d
--- /dev/null
+++ b/uvote/page/user_main_impressum/user_main_impressum.php
@@ -0,0 +1,10 @@
+';}
+ return '';}
public function html(){
$vars = array();
@@ -22,7 +22,7 @@ class user_main_myVote extends SYSTEM\PAGE\Page {
$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\PAGE\text::tag('uvote'));
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_myVote/tpl/myVote.tpl'), $vars);
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_options/tpl/user_main_options.tpl'), $vars);
}
}
\ No newline at end of file
diff --git a/uvote/page/user_main_poll/js/user_main_poll.js b/uvote/page/user_main_poll/js/user_main_poll.js
new file mode 100644
index 0000000..f466f63
--- /dev/null
+++ b/uvote/page/user_main_poll/js/user_main_poll.js
@@ -0,0 +1,26 @@
+function init_user_main_poll(){
+ $('#btnvote_yes').click(function () {
+ vote_click($(this).attr('poll_ID'),1);
+ });
+ $('#btnvote_no').click(function () {
+ vote_click($(this).attr('poll_ID'),2);
+ });
+ $('#btnvote_off').click(function () {
+ vote_click($(this).attr('poll_ID'),3);
+ });
+ $('#user_main').resize(function(){
+ $('#pollframe').height($('#user_main').height());
+ });
+
+}
+function vote_click (poll_ID, vote) {
+ $.getJSON('./api.php?call=vote&action=vote&poll_ID=' + poll_ID + '&vote=' + vote, function(data) {
+ var items = [];
+ if(data.status == true){
+ alert("success");
+ system.reload();
+ } else {
+ alert(data.result.message);
+ }
+ });
+}
\ No newline at end of file
diff --git a/uvote/page/user_main_poll/tpl/bars_user.tpl b/uvote/page/user_main_poll/tpl/bars_user.tpl
new file mode 100644
index 0000000..0839b29
--- /dev/null
+++ b/uvote/page/user_main_poll/tpl/bars_user.tpl
@@ -0,0 +1,6 @@
+
-
- - Gallery -
-
-
-
+
diff --git a/uvote/page/page_uvote.php b/uvote/page/page_uvote.php
index faf5ecc..5c9d805 100644
--- a/uvote/page/page_uvote.php
+++ b/uvote/page/page_uvote.php
@@ -4,39 +4,49 @@ class page_uvote extends \SYSTEM\API\api_default {
public static function default_page($_escaped_fragment_ = NULL){
return (new default_page())->html($_escaped_fragment_);}
-
- public static function page_open_bulletin ($poll_ID){
+
+ public static function page_user_main_start(){
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
return (new default_register ())->html();}
- return (new default_bulletin($poll_ID))->html();}
+ return (new user_main_start())->html();}
-
- public static function page_user_main(){
+ public static function page_user_main_analysis(){
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
return (new default_register ())->html();}
- return (new user_main())->html();}
+ return (new user_main_analysis())->html();}
- public static function page_user_main_uVote(){
- return (new user_main_uVote())->html();}
-
- public static function page_user_main_urVote(){
- return (new user_main_urVote())->html();}
-
- public static function page_user_main_myVote(){
- return (new user_main_myVote())->html();}
+ public static function page_user_main_options(){
+ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
+ return (new default_register ())->html();}
+ return (new user_main_options())->html();}
public static function page_user_main_poll($poll_ID) {
//return (new user_main_poll($poll_ID))->html();}
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
return (new default_register ())->html();}
- return (new default_bulletin($poll_ID))->html();}
+ return (new user_main_poll($poll_ID))->html();}
+ public static function page_user_main_poll_sub($poll_ID) {
+ //return (new user_main_poll($poll_ID))->html();}
+ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
+ return (new default_register ())->html();}
+ return (new user_main_poll_sub($poll_ID))->html();}
+
+ public static function page_user_main_votelist(){
+ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
+ return (new default_register ())->html();}
+ return (new user_main_votelist())->html();}
- public static function page_user_list(){
- return (new user_list())->html();}
+ public static function page_user_main_impressum(){
+ return (new user_main_impressum())->html();}
+
- public static function page_user_list_active(){
- return (new user_list_active())->html();}
+ public static function page_user_main_loggedout_start(){
+ return \SYSTEM\PAGE\text::get('welcome_text');
+ }
+ public static function page_user_main_loggedout_news(){
+ return user_main_start::newsfeed();
+ }
+ private function default_register(){
+ return (new default_register ())->html();}
- public static function page_user_list_ended(){
- return (new user_list_ended())->html();}
}
\ No newline at end of file
diff --git a/uvote/page/user_list/css/list_menu.css b/uvote/page/user_list/css/list_menu.css
deleted file mode 100644
index 40f7469..0000000
--- a/uvote/page/user_list/css/list_menu.css
+++ /dev/null
@@ -1,7 +0,0 @@
-#tabbable_list_menu {
- padding-right: 50px;
-}
-
-#tab-content_list_menu {
- padding-top: 10px;
-}
\ No newline at end of file
diff --git a/uvote/page/user_list/js/user_list.js b/uvote/page/user_list/js/user_list.js
deleted file mode 100644
index 4937c75..0000000
--- a/uvote/page/user_list/js/user_list.js
+++ /dev/null
@@ -1,39 +0,0 @@
-function init_user_list(){
- $('#tabs_user_list a').click(function (e) {
- //e.preventDefault();
- });
- $('.btn_vote').click(function () {
- //vote_click($(this).attr('poll_ID'));
- //$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
- //open_vote($(this).attr('poll_ID'));
- //register_registerform();
- });
- $('.btn_fade').click(function () {
- $('#vote_data_panel' + $(this).attr('poll_ID')).toggle();
- });
-}
-
-function init_user_list_active(){
- $('.btn_fade').click(function () {
- $('#vote_data_panel' + $(this).attr('poll_ID')).show();
- });
- $('.btn_vote').click(function () {
- system.load('start(user_main(poll));poll.'+ $(this).attr('poll_ID'))
- //vote_click($(this).attr('poll_ID'));
- //$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
- //open_vote($(this).attr('poll_ID'));
- //register_registerform();
- })
-}
-function init_user_list_ended(){
- $('.btn_fade').click(function () {
- $('#vote_data_panel' + $(this).attr('poll_ID')).show();
- });
- $('.btn_vote').click(function () {
- //vote_click($(this).attr('poll_ID'));
- //$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
- // open_vote($(this).attr('poll_ID'));
- // register_registerform();
- system.load('start(user_main(poll));poll.'+ $(this).attr('poll_ID'))
- })
-}
\ No newline at end of file
diff --git a/uvote/page/user_list/list_menu.tpl b/uvote/page/user_list/list_menu.tpl
deleted file mode 100644
index 38b5fe8..0000000
--- a/uvote/page/user_list/list_menu.tpl
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
\ No newline at end of file
+
-
- - Registrieren -
-
-
-
+
+
-
-
-
diff --git a/uvote/page/user_list/user_list.php b/uvote/page/user_list/user_list.php
deleted file mode 100644
index 7a0f62a..0000000
--- a/uvote/page/user_list/user_list.php
+++ /dev/null
@@ -1,21 +0,0 @@
-html();
-
-
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list/list_menu.tpl'),$vars);
- }
-
-}
\ No newline at end of file
diff --git a/uvote/page/user_list_active/tpl/active.tpl b/uvote/page/user_list_active/tpl/active.tpl
deleted file mode 100644
index 4700613..0000000
--- a/uvote/page/user_list_active/tpl/active.tpl
+++ /dev/null
@@ -1,2 +0,0 @@
-
-${votelist}
\ No newline at end of file
diff --git a/uvote/page/user_list_active/user_list_active.php b/uvote/page/user_list_active/user_list_active.php
deleted file mode 100644
index 8d06192..0000000
--- a/uvote/page/user_list_active/user_list_active.php
+++ /dev/null
@@ -1,106 +0,0 @@
- 0 ? 'Abstimmen' : 'Ansehen';
- $vote['uv'] = $vote['bt'] = '';
- $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5';
-
- $user_vote = votes::getUserPollData($vote['ID']);
- $vote['vote_class'] = $this->tablerow_class($user_vote);
- 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/tpl/vote_bt.tpl'),
- array( 'party' => $pv['party'],
- 'choice' => $this->get_party_per_poll($pv['choice']),
- 'choice_class' => $this->badge_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/tpl/vote_uv.tpl'),
- array( 'badge' => self::badge_class($v['choice']),
- 'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0));
- }
- }
-
- //new panels:
- $vote['panel_class'] = default_page::panel_class($user_vote);
-
- if($time_remain > 0){
- $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
- } else {
- $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
- }
- }
- return $result[0].$result[1];
- }
-
- public function html(){
- $vars = array();
- $vars['votelist'] = $this->generate_votelist();
- $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_active/tpl/active.tpl'), $vars);
- }
-
-}
\ No newline at end of file
diff --git a/uvote/page/user_list_ended/tpl/ended.tpl b/uvote/page/user_list_ended/tpl/ended.tpl
deleted file mode 100644
index da5f81c..0000000
--- a/uvote/page/user_list_ended/tpl/ended.tpl
+++ /dev/null
@@ -1,2 +0,0 @@
-Ended List:
-${votelist}
\ No newline at end of file
diff --git a/uvote/page/user_list_ended/user_list_ended.php b/uvote/page/user_list_ended/user_list_ended.php
deleted file mode 100644
index f20dfc2..0000000
--- a/uvote/page/user_list_ended/user_list_ended.php
+++ /dev/null
@@ -1,105 +0,0 @@
- 0 ? 'Abstimmen' : 'Ansehen';
- $vote['uv'] = $vote['bt'] = '';
- $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5';
-
- $user_vote = votes::getUserPollData($vote['ID']);
- $vote['vote_class'] = $this->tablerow_class($user_vote);
- 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/tpl/vote_bt.tpl'),
- array( 'party' => $pv['party'],
- 'choice' => $this->get_party_per_poll($pv['choice']),
- 'choice_class' => $this->badge_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/tpl/vote_uv.tpl'),
- array( 'badge' => self::badge_class($v['choice']),
- 'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0));
- }
- }
-
- //new panels:
- $vote['panel_class'] = default_page::panel_class($user_vote);
-
- if($time_remain > 0){
- $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
- } else {
- $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
- }
- }
- return $result[0].$result[1];
- }
-
- public function html(){
- $vars = array();
- $vars['votelist'] = $this->generate_votelist();
- $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_ended/tpl/ended.tpl'), $vars);
- }
-
-}
\ No newline at end of file
diff --git a/uvote/page/user_main/css/main_menu.css b/uvote/page/user_main/css/main_menu.css
deleted file mode 100644
index 100066d..0000000
--- a/uvote/page/user_main/css/main_menu.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.tabbable#tabbable_main_menu {
- padding-right: 50px;
-}
\ No newline at end of file
diff --git a/uvote/page/user_main/js/user_main.js b/uvote/page/user_main/js/user_main.js
deleted file mode 100644
index 99d2afa..0000000
--- a/uvote/page/user_main/js/user_main.js
+++ /dev/null
@@ -1,47 +0,0 @@
-function init_user_main(){
- register_registerform();
- $('#feedback_submit').click(function (data){
- var test = $('textarea#feedback_text').val();
- send_feedback(test);
- });
- $('#tabs_user_main a').click(function (e) {
- //e.preventDefault();
- });
-}
-
-function init_myvote(){
- $('.add_data_submit').click(function () {
- submit_add_data();
- alert('success');
- });
-}
-
-function init_poll(){
- $('.btnvote_yes').click(function () {
- vote_click($(this).attr('poll_ID'),1);
- });
- $('.btnvote_no').click(function () {
- vote_click($(this).attr('poll_ID'),2);
- });
- $('.btnvote_off').click(function () {
- vote_click($(this).attr('poll_ID'),3);
- });
- $('.submit_pro').click(function () {
- submit_c_data($(this).attr('poll_ID'));
- alert('success');
- });
- $('.c_up').click(function () {
- submit_commentrate($(this).attr('c_ID'), 1);
- });
- $('.c_down').click(function () {
- submit_commentrate($(this).attr('c_ID'), 2);
- });
- $('.c_spam').click(function () {
- submit_commentrate($(this).attr('c_ID'), 3);
- });
- $('#test').click(function(){
- $('#myModal').modal();
- });
-
- register_registerform();
-}
\ No newline at end of file
diff --git a/uvote/page/user_main/main_menu.tpl b/uvote/page/user_main/main_menu.tpl
deleted file mode 100644
index 055e91d..0000000
--- a/uvote/page/user_main/main_menu.tpl
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/uvote/page/user_main/user_main.php b/uvote/page/user_main/user_main.php
deleted file mode 100644
index 8bffbf8..0000000
--- a/uvote/page/user_main/user_main.php
+++ /dev/null
@@ -1,22 +0,0 @@
-exchange_loginformmain() : $this->getloginformmain() ;
- $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main/main_menu.tpl'),$vars);
- }
-
-}
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/js/user_main_analysis.js b/uvote/page/user_main_analysis/js/user_main_analysis.js
new file mode 100644
index 0000000..226a3cd
--- /dev/null
+++ b/uvote/page/user_main_analysis/js/user_main_analysis.js
@@ -0,0 +1,305 @@
+function init_user_main_analysis(){
+$('.acc_toggle').click(function(){
+ $(this).find('i').toggleClass('glyphicon-circle-arrow-down').toggleClass('glyphicon-circle-arrow-up');
+});
+
+
+
+/* -------- clickhandlers for basic_stats_tab --------
+----------- set specifies tab type, --------
+----------- cat specifies perspective, --------
+----------- body specifies load-to element -------- */
+$('#a_acc_2').click(function () {
+ var set = 'basic';
+ var cat = 'user';
+ var body = '#acc_2_body';
+ load_tab(set, cat, body);
+});
+$('#a_acc_8').click(function () {
+ var set = 'basic';
+ var cat = 'community';
+ var body = '#acc_8_body';
+ load_tab(set, cat, body);
+});
+$('#a_acc_10').click(function () {
+ var set = 'basic';
+ var cat = 'bt';
+ var body = '#acc_10_body';
+ load_tab(set, cat, body);
+});
+
+/* -------- clickhandlers for bilance_stats_tab --------
+----------- set specifies tab type, --------
+----------- cat specifies perspective, --------
+----------- body specifies load-to element -------- */
+$('#a_acc_3').click(function () {
+ var set = 'bilance';
+ var cat = 'user';
+ var body = '#acc_3_body';
+ load_tab(set, cat, body);
+});
+$('#a_acc_6').click(function () {
+ var set = 'bilance';
+ var cat = 'user_bt';
+ var body = '#acc_6_body';
+ load_tab(set, cat, body);
+});
+$('#a_acc_9').click(function () {
+ var set = 'bilance';
+ var cat = 'community';
+ var body = '#acc_9_body';
+ load_tab(set, cat, body);
+});
+$('#a_acc_11').click(function () {
+ var set = 'bilance';
+ var cat = 'bt';
+ var body = '#acc_11_body';
+ load_tab(set, cat, body);
+});
+
+/* -------- clickhandlers for bilance_choice_stats_tab --------
+----------- set specifies tab type, --------
+----------- cat specifies perspective, --------
+----------- body specifies load-to element -------- */
+$('#a_acc_4').click(function () {
+ var set = 'bilance_choice';
+ var cat = 'user_party';
+ var body = '#acc_4_body';
+ load_tab(set, cat, body);
+});
+$('#a_acc_12').click(function () {
+ var set = 'bilance_choice';
+ var cat = 'user_bt';
+ var body = '#acc_12_body';
+ load_tab(set, cat, body);
+});
+
+/* -------- clickhandlers for google charts -------- */
+$('#a_acc_7').click(function () {
+ $('#acc_7_body').load(load_visualisation_urvote('graph_user_to_party_overall_bt', 84600));
+});
+$('#a_acc_13').click(function () {
+ $('#acc_13_body').load(load_visualisation_user_to_parties_overall('donut_user_to_party_overall', 84600),
+ load_visualisation_bt_to_parties_overall('donut_bt_to_party_overall', 84600),
+ load_visualisation_community_to_parties_overall('donut_community_to_party_overall', 84600));
+
+});
+$('#a_acc_5').click(function () {
+ $('#acc_5_body').load(load_visualisation_user_to_party_overall('graph_user_to_party_overall_cdu', 'cdu', 84600),
+ load_visualisation_user_to_party_overall('graph_user_to_party_overall_csu', 'csu', 84600),
+ load_visualisation_user_to_party_overall('graph_user_to_party_overall_spd', 'spd', 84600),
+ load_visualisation_user_to_party_overall('graph_user_to_party_overall_gruene', 'gruene', 84600),
+ load_visualisation_user_to_party_overall('graph_user_to_party_overall_linke', 'linke', 84600));
+});
+}
+
+function load_tab(set, cat, body){
+ $(body).load('./api.php?call=load_tab&set=' + set + '&cat=' + cat, 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)];}}));});
+
+ var options = {title: 'Übereinstimmung uVote Community/Bundestag', aggregationTarget: 'category', selectionMode: 'multiple', /*curveType: 'function',*/ /*focusTarget: 'category',*/ chartArea:{}, vAxis:{format:'#%', logScale: false}, interpolateNulls: false, width: "300", height: "250"};
+ //LineChart
+ new google.visualization.ColumnChart(document.getElementById(id)).draw(data, options);
+ });
+}
+function load_visualisation_urvote(id, timespan){
+ $('img#loader').show();
+ $.getJSON('./api.php?call=graph_bt_to_user_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)];}}));});
+
+ var options = {title: 'Übereinstimmung mit dem Bundestag',
+ aggregationTarget: 'category',
+ selectionMode: 'multiple',
+ legend: 'none',
+ animation:{
+ duration: 1000,
+ easing: 'out',},
+ chartArea:{},
+// vAxis:{logScale: false},
+ vAxis: {viewWindow: {min: 0, max: 100}},
+ lineWidth: 7,
+ interpolateNulls: false,
+ width: "800",
+ height: "250"};
+ new google.visualization.LineChart(document.getElementById(id)).draw(data, options);
+ });
+}
+
+function load_visualisation_user_to_party_overall(id, party, timespan){
+ $('img#loader').show();
+ $.getJSON('./api.php?call=graph_party_to_user_overall_by_time&party=' + party,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)];}}));});
+
+
+ var options = { title: 'Übereinstimmung mit ' + party,
+ aggregationTarget: 'category',
+ selectionMode: 'multiple',
+ legend: 'none',
+ chartArea:{},
+// vAxis:{logScale: false},
+ vAxis: {viewWindow: {min: 0, max: 100}},
+ lineWidth: 7,
+ interpolateNulls: false,
+ width: "800",
+ height: "250"};
+ new google.visualization.LineChart(document.getElementById(id)).draw(data, options);
+ });
+}
+function load_visualisation_user_to_parties_overall(id, timespan){
+ $('img#loader').show();
+ $.getJSON('./api.php?call=donut_party_to_user_overall',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('string',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 v;}else{return [parseFloat(v)];}}));});
+ var options = { title: 'Übereinstimmung mit den Fraktionen relativ zueinander',
+ titleTextStyle: {fontSize: 14, bold: 0, italic: 0},
+ pieSliceText: 'label',
+ legend: 'none',
+ colors: ['#000736', '#0022FF', '#33FF00', '#D2067A', '#F20101'],
+ pieHole: '0.4',
+ chartArea:{},
+ width: "350",
+ height: "400"};
+ new google.visualization.PieChart(document.getElementById(id)).draw(data, options);
+ });
+}
+function load_visualisation_community_to_parties_overall(id, timespan){
+ $('img#loader').show();
+ $.getJSON('./api.php?call=donut_party_to_community_overall',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('string',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 v;}else{return [parseFloat(v)];}}));});
+ var options = { title: 'Übereinstimmung mit den Fraktionen relativ zueinander',
+ titleTextStyle: {fontSize: 14, bold: 0, italic: 0},
+ pieSliceText: 'label',
+ legend: 'none',
+ colors: ['#000736', '#0022FF', '#33FF00', '#D2067A', '#F20101'],
+ pieHole: '0.4',
+ chartArea:{},
+ width: "350",
+ height: "400"};
+ new google.visualization.PieChart(document.getElementById(id)).draw(data, options);
+ });
+}
+function load_visualisation_bt_to_parties_overall(id, timespan){
+ $('img#loader').show();
+ $.getJSON('./api.php?call=donut_party_to_user_overall',function(json){
+ if(!json || json.status != true || !json.result){
+ $('img#loader').hide();
+ return;
+ }
+ json = json.result;
+ $('img#loader').hide();
+ var data = google.visualization.arrayToDataTable([
+ ['party', 'seats'],
+ ['cdu', 255],
+ ['csu', 56],
+ ['grüne', 63],
+ ['linke', 64],
+ ['spd', 193]
+ ]);
+ var options = { title: 'Sitzverteilung im Plenum',
+ titleTextStyle: {fontSize: 14, bold: 0, italic: 0},
+ pieSliceText: 'label',
+ legend: 'none',
+ colors: ['#000736', '#0022FF', '#33FF00', '#D2067A', '#F20101'],
+ pieHole: '0.4',
+ chartArea:{},
+ width: "350",
+ height: "400"};
+ new google.visualization.PieChart(document.getElementById(id)).draw(data, options);
+ });
+}
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/according_laws.tpl b/uvote/page/user_main_analysis/tpl/according_laws.tpl
new file mode 100644
index 0000000..e69de29
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/bt_total.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/bt_total.tpl
new file mode 100644
index 0000000..e4036af
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/bt_total.tpl
@@ -0,0 +1,52 @@
+
-
-
-
-
-
-
- - Feedback -
-
-
-
-
-
-
+
+
+
+
+Beschlüsse des Bundestages in absoluten Zahlen
++
+
+
+
+
+
+ +
+ pro Stimmen
+
+
+
+${pro}
+
+
+
+
+
+
+ +
+ contra Stimmen
+
+
+
+ ${con}
+
+
+
+
+
+
+ +
+ Enthaltungen
+
+
+
+ ${ent}
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/overall_votes.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/overall_votes.tpl
new file mode 100644
index 0000000..999fb5c
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/overall_votes.tpl
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+ Total: ${total_total}
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_bt.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_bt.tpl
new file mode 100644
index 0000000..c2fe421
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_bt.tpl
@@ -0,0 +1,11 @@
+
+ Abstimmungsquote seit Accounterstellung
+
+
+
+
+ Teilgenommen: ${voted},
+ nicht Teilgenommen: ${not_voted}
+ ${vote_perc}%
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_community.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_community.tpl
new file mode 100644
index 0000000..718e9a1
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_community.tpl
@@ -0,0 +1,12 @@
+
+ ${basic_stats_bt}
+
+
+
++ ${analysis_help_bt_basic} +
+ ${analysis_math_bt_basic} +
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_user.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_user.tpl
new file mode 100644
index 0000000..e0258c8
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/tab_basic_user.tpl
@@ -0,0 +1,27 @@
+
+
+ Entscheidungsverhalten der uVote Community
+ ${basic_stats_community} +
+
++ ${analysis_help_community} +
+ ${analysis_math_community} +
+
+
+ ${basic_stats}
+
+
+
++ ${analysis_help_basic_stats} +
+ ${analysis_math_basic_stats} +
+
+
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/temp_votes.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/temp_votes.tpl
new file mode 100644
index 0000000..704c8d7
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/temp_votes.tpl
@@ -0,0 +1,18 @@
+
+
+
+ ${user_temp_votes}
+ +
${user_overall_votes}
+
+
++ ${analysis_help_basic_votes} +
+ ${analysis_math_basic_votes} +
+
+
+
+Aktueller Status
+
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/user_total.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/user_total.tpl
new file mode 100644
index 0000000..3aff14f
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/user_total.tpl
@@ -0,0 +1,52 @@
+
+ Teilnahme an aktuellen Abstimmungen
+
+
+
+
+ ${vote_percent}%
+
+ Teilgenommen: ${voted}, nicht Teilgenommen: ${not_voted}
+
+
+
+
+
+
+Deine Stimmverteilung
++
+
+
+
+
+
+ +
+ pro Stimmen
+
+
+
+${total_pro}
+
+
+
+
+
+
+ +
+ contra Stimmen
+
+
+
+ ${total_con}
+
+
+
+
+
+
+ +
+ Enthaltungen
+
+
+
+ ${total_ent}
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_basic/uvote_total.tpl b/uvote/page/user_main_analysis/tpl/tab_basic/uvote_total.tpl
new file mode 100644
index 0000000..542eebb
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_basic/uvote_total.tpl
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+ Total: ${total_total}
+
+
+
+
+
+Absolute Stimmen der Community
++
+
+
+
+
+
+ +
+ pro Stimmen
+
+
+
+${pro}
+
+
+
+
+
+
+ +
+ contra Stimmen
+
+
+
+ ${con}
+
+
+
+
+
+
+ +
+ Enthaltungen
+
+
+
+ ${ent}
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/bars_community.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_community.tpl
new file mode 100644
index 0000000..2216664
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_community.tpl
@@ -0,0 +1,17 @@
+
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user.tpl
new file mode 100644
index 0000000..5a0eb08
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user.tpl
@@ -0,0 +1,19 @@
+
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user_bt.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user_bt.tpl
new file mode 100644
index 0000000..e02454f
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user_bt.tpl
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+ Total: ${total_total}
+
+
+
+
+
+
+
+
+ ${match_percentage}%
+
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user_frame.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user_frame.tpl
new file mode 100644
index 0000000..967faeb
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/bars_user_frame.tpl
@@ -0,0 +1 @@
+${result}
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_bt.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_bt.tpl
new file mode 100644
index 0000000..2c05530
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_bt.tpl
@@ -0,0 +1,12 @@
+
+
${class_MATCH} Übereinstimmungen
+
${class_MISSMATCH} Differenzen
+ =
+
${match_percentage}% Übereinstimmungsrate
+
+
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_community.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_community.tpl
new file mode 100644
index 0000000..803d1e2
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_community.tpl
@@ -0,0 +1,13 @@
+
+
+ Übereinstimmung Bundestag und Fraktionen
+ ${bilance_bt} +
+
++ ${analysis_help_choices_bt} +
+ ${analysis_math_choices_bt} +
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_user.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_user.tpl
new file mode 100644
index 0000000..da2c155
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_user.tpl
@@ -0,0 +1,16 @@
+
+
+ ${bilance_community} +
+ Übereinstimmung community und Fraktionen
++ ${bilance_community} +
+
++ ${analysis_help_community_to_fr} +
+ ${analysis_math_community_to_fr} +
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_user_bt.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_user_bt.tpl
new file mode 100644
index 0000000..548f7b8
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance/tab_bilance_user_bt.tpl
@@ -0,0 +1,12 @@
+
+
+ auf ? clicken für Details +
+
+ ${bilance_user} +
+ Absolute Übereinstimmungsrate
++ auf ? clicken für Details +
+
+ ${bilance_user} +
+
++ ${analysis_help_user_to_party_overall} +
+ ${analysis_math_user_to_party_overall} +
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance_choice/bars_user.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/bars_user.tpl
new file mode 100644
index 0000000..568857a
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/bars_user.tpl
@@ -0,0 +1,17 @@
+
+
+ Bundestag gesamt
+ ${bilance_user_bt}
+
+
+
++ ${analysis_help_bt} +
+ ${analysis_math_bt} +
+
+
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_bt.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_bt.tpl
new file mode 100644
index 0000000..5dff4a2
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_bt.tpl
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_party.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_party.tpl
new file mode 100644
index 0000000..0b37f1c
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_party.tpl
@@ -0,0 +1,37 @@
+
+ Übereinstimmung mit dem Bundestag
+
+ ${choices_user_ID_per_bt_pro}
+ ${choices_user_ID_per_bt_con}
+ ${choices_user_ID_per_bt_ent}
+
+
+
++ ${analysis_help_bt_by_vote} +
+ ${analysis_math_bt_by_vote} +
+
+
+
+
+ Übereinstimmung der pro Stimmen
+ ${choices_user_ID_per_party_pro} +
+
++ ${analysis_help_uservera_to_party_pro} +
+ ${analysis_math_uservera_to_party_pro} +
+
+
+
+
+
+ Übereinstimmung der contra Stimmen
+ ${choices_user_ID_per_party_con} +
+
++ ${analysis_help_uservera_to_party_con} +
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_analysis/tpl/tab_bilance_choice/urvotebt_by_choice.tpl b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/urvotebt_by_choice.tpl
new file mode 100644
index 0000000..37d3598
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/tab_bilance_choice/urvotebt_by_choice.tpl
@@ -0,0 +1,17 @@
+
+
+
+
+ Übereinstimmung der Enthaltungen
+ ${choices_user_ID_per_party_ent} +
+
++ ${analysis_help_uservera_to_party_ent} +
+
+
diff --git a/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl b/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl
new file mode 100644
index 0000000..a3bf9f5
--- /dev/null
+++ b/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl
@@ -0,0 +1,291 @@
+
+
+
+
+
+
+
+
+
+
+ + ${urVote_title} +
+
+
+
+ ${urvote_body_text}
+
+
+ ${urvote_info_info_1}
+
+ ${urvote_info_info_2}
+
+ ${urvote_info_info_3}
+
+
+
+Deine Statistik
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ "Dein" Bundestag
++ +
+
+ +
+ Der Bundestag
++ +
+
+ +
+ die uvote community
++ +
+
+
+
+ + ${analysis_help_party_donut} +
+ ${analysis_math_party_donut} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + ${analysis_help_overtime_party} +
+ ${analysis_math_overtime_party} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + ${analysis_help_overtime_bt} +
+ ${analysis_math_overtime_bt} +
+
+
+community Statistik
+
+
+
+
+
+
+
+
+
+
+
+Bundestag Statistik
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_uVote/tpl/votecountchoice.tpl b/uvote/page/user_main_analysis/tpl/votecountchoice.tpl
similarity index 100%
rename from uvote/page/user_main_uVote/tpl/votecountchoice.tpl
rename to uvote/page/user_main_analysis/tpl/votecountchoice.tpl
diff --git a/uvote/page/user_main_uVote/tpl/votecountchoicebt.tpl b/uvote/page/user_main_analysis/tpl/votecountchoicebt.tpl
similarity index 100%
rename from uvote/page/user_main_uVote/tpl/votecountchoicebt.tpl
rename to uvote/page/user_main_analysis/tpl/votecountchoicebt.tpl
diff --git a/uvote/page/user_main_analysis/user_main_analysis.php b/uvote/page/user_main_analysis/user_main_analysis.php
new file mode 100644
index 0000000..cd44cc2
--- /dev/null
+++ b/uvote/page/user_main_analysis/user_main_analysis.php
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+ + Impressum +
+
+
+
+ ${impressum_header}
+ ${impressum_1}
+ ${impressum_2}
+ ${impressum_3}
+ ${impressum_4}
+ ${impressum_5}
+
+ uvote community
+
+
diff --git a/uvote/page/user_main_poll/tpl/buttons/sub_button.tpl b/uvote/page/user_main_poll/tpl/buttons/sub_button.tpl
new file mode 100644
index 0000000..4b10ee9
--- /dev/null
+++ b/uvote/page/user_main_poll/tpl/buttons/sub_button.tpl
@@ -0,0 +1,8 @@
+${vote_yes_perc}%
+ ${vote_no_perc}%
+ ${vote_ent_perc}%
+
+ ${title}
+ + + +
\ No newline at end of file
diff --git a/uvote/page/default_bulletin/tpl/comment.tpl b/uvote/page/user_main_poll/tpl/comment.tpl
similarity index 100%
rename from uvote/page/default_bulletin/tpl/comment.tpl
rename to uvote/page/user_main_poll/tpl/comment.tpl
diff --git a/uvote/page/user_main_poll/tpl/full_vote.tpl b/uvote/page/user_main_poll/tpl/full_vote.tpl
index 47f533b..63a50d7 100644
--- a/uvote/page/user_main_poll/tpl/full_vote.tpl
+++ b/uvote/page/user_main_poll/tpl/full_vote.tpl
@@ -1,9 +1,116 @@
-+ + + +
-
+${choice}
\ No newline at end of file diff --git a/uvote/page/user_main_votelist/tpl/vote_uv.tpl b/uvote/page/user_main_votelist/tpl/vote_uv.tpl new file mode 100644 index 0000000..1fdff47 --- /dev/null +++ b/uvote/page/user_main_votelist/tpl/vote_uv.tpl @@ -0,0 +1 @@ +${perc}% diff --git a/uvote/page/user_main_votelist/user_main_votelist.php b/uvote/page/user_main_votelist/user_main_votelist.php new file mode 100644 index 0000000..a8f502c --- /dev/null +++ b/uvote/page/user_main_votelist/user_main_votelist.php @@ -0,0 +1,29 @@ +user_count(); + $vars['user_temp_votes'] = votes::get_user_temp_votes(); + $vars['filterlist'] = $this->get_list_tags(); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register')); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote')); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/user_main_votelist.tpl'), $vars); + } + +} \ No newline at end of file diff --git a/uvote/sai/autoload.inc b/uvote/sai/autoload.inc new file mode 100644 index 0000000..e928ede --- /dev/null +++ b/uvote/sai/autoload.inc @@ -0,0 +1,4 @@ + - - - -
-
-
-Submit +
+
+
+Der Bundestag hat "${choice_full}"
abgestimmt.
+${disclaimer} \ No newline at end of file diff --git a/uvote/page/user_main_poll/tpl/table_parties.tpl b/uvote/page/user_main_poll/tpl/table_parties.tpl new file mode 100644 index 0000000..1fc807c --- /dev/null +++ b/uvote/page/user_main_poll/tpl/table_parties.tpl @@ -0,0 +1,12 @@ + +
\ No newline at end of file diff --git a/uvote/page/user_main_poll/tpl/vote_buttons.tpl b/uvote/page/user_main_poll/tpl/vote_buttons.tpl new file mode 100644 index 0000000..fa5772d --- /dev/null +++ b/uvote/page/user_main_poll/tpl/vote_buttons.tpl @@ -0,0 +1,24 @@ +
\ No newline at end of file diff --git a/uvote/page/user_main_poll_sub/tpl/full_vote.tpl b/uvote/page/user_main_poll_sub/tpl/full_vote.tpl new file mode 100644 index 0000000..3c01c6e --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/full_vote.tpl @@ -0,0 +1,96 @@ +
+Der Bundestag hat "${choice_full}"
abgestimmt.
+${disclaimer} \ No newline at end of file diff --git a/uvote/page/user_main_poll_sub/tpl/table_parties.tpl b/uvote/page/user_main_poll_sub/tpl/table_parties.tpl new file mode 100644 index 0000000..1fc807c --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/table_parties.tpl @@ -0,0 +1,12 @@ + +
\ No newline at end of file diff --git a/uvote/page/user_main_poll_sub/tpl/vote_buttons.tpl b/uvote/page/user_main_poll_sub/tpl/vote_buttons.tpl new file mode 100644 index 0000000..8c9b4dd --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/vote_buttons.tpl @@ -0,0 +1,24 @@ +
-
-
-
- ${class_MATCH}
- ${class_MISSMATCH}
- ${match_percentage}%
-
\ No newline at end of file
diff --git a/uvote/page/user_main_uVote/tpl/uVote.tpl b/uvote/page/user_main_uVote/tpl/uVote.tpl
deleted file mode 100644
index efcd26a..0000000
--- a/uvote/page/user_main_uVote/tpl/uVote.tpl
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- ${class_MATCH}
- ${class_MISSMATCH}
- ${match_percentage}%
-
\ 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
deleted file mode 100644
index 931deb1..0000000
--- a/uvote/page/user_main_uVote/user_main_uVote.php
+++ /dev/null
@@ -1,43 +0,0 @@
-html();
- return $var;
- }
-
-
- public function html(){
- $vars = array();
- $vars['list_active'] = $this->get_list_active();
-
- $vars['uvote_to_bt'] = $this->uvote_to_parties();
-
- $vars['user_count'] = $this->user_count();
- $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
- return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/uVote.tpl'),$vars);
- }
-
-}
\ No newline at end of file
diff --git a/uvote/page/user_main_urVote/tpl/all_polls.tpl b/uvote/page/user_main_urVote/tpl/all_polls.tpl
deleted file mode 100644
index c433c31..0000000
--- a/uvote/page/user_main_urVote/tpl/all_polls.tpl
+++ /dev/null
@@ -1,14 +0,0 @@
-
diff --git a/uvote/page/user_main_urVote/tpl/bt_to_user_overall.tpl b/uvote/page/user_main_urVote/tpl/bt_to_user_overall.tpl deleted file mode 100644 index cd2c1f8..0000000 --- a/uvote/page/user_main_urVote/tpl/bt_to_user_overall.tpl +++ /dev/null @@ -1,8 +0,0 @@ -
-
-
-
- ${class_MATCH}
- ${class_MISSMATCH}
- ${match_percentage}
-
\ No newline at end of file
diff --git a/uvote/page/user_main_urVote/tpl/overall_all_polls.tpl b/uvote/page/user_main_urVote/tpl/overall_all_polls.tpl
deleted file mode 100644
index c31d252..0000000
--- a/uvote/page/user_main_urVote/tpl/overall_all_polls.tpl
+++ /dev/null
@@ -1,11 +0,0 @@
-
"; - foreach ($part['result'] as $p){ - $result .= $p['title']."
"; - } - $result .= "";
- new INFO($result);
- return $result;
- }
- private function votes_all(){
- $votes = votes::get_all_votes();
- $result = '';
- foreach($votes as $vote){
- switch($vote['choice']){
- case 1:
- $vote['choice'] = 'PRO';
- $vote['badge_color'] = 'badge-success';
- break;
- case 2:
- $vote['choice'] = 'CON';
- $vote['badge_color'] = 'badge-important';
- break;
- case 3:
- $vote['choice'] = 'ENT';
- $vote['badge_color'] = 'badge-info';
- break;
- }
- //$vote['count'];
- //$vote['choice'];
- $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/votecountchoice.tpl'),$vote);
- }
- 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';
- $vote['badge_color'] = 'badge-success';
- break;
- case 2:
- $vote['bt_choice'] = 'CON';
- $vote['badge_color'] = 'badge-important';
- break;
- case 3:
- $vote['bt_choice'] = 'ENT';
- $vote['badge_color'] = 'badge-info';
- break;
- case 0:
- $vote['bt_choice'] = 'OFFEN';
- }
- //$vote['count'];
- //$vote['choice'];
- $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/votecountchoicebt.tpl'),$vote);
- }
- return $result;
- }
- public function html(){
- $vars = array();
-// $vars['poll_compare'] = $this->count_all_polls();
- $vars['votes_all'] = $this->votes_all();
- $vars['votes_all_bt'] = $this->votes_all_bt();
- $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=files&cat=frontend_logos&id=';
- $vars['user_temp_votes'] = $this->user_temp_votes();
- $vars['user_overall_votes'] = $this->user_overall_votes();
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
- $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/urVote.tpl'),$vars);
- }
-
-}
\ No newline at end of file
diff --git a/uvote/page/user_main_votelist/css/user_main_votelist.css b/uvote/page/user_main_votelist/css/user_main_votelist.css
new file mode 100644
index 0000000..e69de29
diff --git a/uvote/page/user_main_votelist/js/user_main_votelist.js b/uvote/page/user_main_votelist/js/user_main_votelist.js
new file mode 100644
index 0000000..a63c38d
--- /dev/null
+++ b/uvote/page/user_main_votelist/js/user_main_votelist.js
@@ -0,0 +1,24 @@
+function init_user_main_votelist(){
+ $('.acc_toggle').click(function(){
+ $(this).find('i').toggleClass('glyphicon-circle-arrow-down').toggleClass('glyphicon-circle-arrow-up');
+});
+ $('.filter_btn').click(function () {
+ var filter = $(this).attr("value");
+ load_list(filter);
+});
+$('#btn_text_search').click(function () {
+ var text = $('#list_text_search').val();
+ load_list_text_search(text);
+});
+}
+
+function load_list(filter){
+ $('#list_frame').load('./api.php?call=load_list&filter=' + filter + '&time=1', function(){
+
+ });
+}
+function load_list_text_search(text){
+ $('#list_frame').load('./api.php?call=load_list_text_search&text=%' + text + '%', function(){
+
+ });
+}
\ No newline at end of file
diff --git a/uvote/page/user_main_votelist/tpl/filter.tpl b/uvote/page/user_main_votelist/tpl/filter.tpl
new file mode 100644
index 0000000..f4997da
--- /dev/null
+++ b/uvote/page/user_main_votelist/tpl/filter.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/uvote/page/user_main_votelist/tpl/tag.tpl b/uvote/page/user_main_votelist/tpl/tag.tpl
new file mode 100644
index 0000000..c93e897
--- /dev/null
+++ b/uvote/page/user_main_votelist/tpl/tag.tpl
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/uvote/page/user_main_votelist/tpl/user_main_votelist.tpl b/uvote/page/user_main_votelist/tpl/user_main_votelist.tpl
new file mode 100644
index 0000000..3a5bbf8
--- /dev/null
+++ b/uvote/page/user_main_votelist/tpl/user_main_votelist.tpl
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + Info +
+
+
+
+
+ ${title}
+ ${openvote_help_text} + ${title} abstimmen. +
+
+
+
+
+
+
+
+ + Änderungsanträge +
+
+
+
+
+
+
+
+
+ ${sub_buttons}
+
+
+
+
+
+
+
+
+
+ + Statistik +
+
+
+
+
+
+
+
+
+
+
+ + Endergebnis +
+
+ ${bars_user}
+ ${bars_bt} +
+ + ${bars_bt} +
+
+
+
+
+
+
+
+ + Ergebnis nach Fraktionen +
+
+ ${choice_party}
+
+
+
+
+
+
diff --git a/uvote/page/user_main_poll/tpl/icons_table_parties.tpl b/uvote/page/user_main_poll/tpl/icons_table_parties.tpl
new file mode 100644
index 0000000..fa6b9e8
--- /dev/null
+++ b/uvote/page/user_main_poll/tpl/icons_table_parties.tpl
@@ -0,0 +1 @@
+
+
+
+
+
+
+
+
+
+ + Abstimmen +
+
+
+
+ ${vote_buttons}
+ ${voice_weight}
+
+
Quelle: ${iframe_link}
-
-
+
+
+
+
-${urvote_party_table_desc}
diff --git a/uvote/page/user_main_poll/tpl/table_bt.tpl b/uvote/page/user_main_poll/tpl/table_bt.tpl new file mode 100644 index 0000000..f6b7b01 --- /dev/null +++ b/uvote/page/user_main_poll/tpl/table_bt.tpl @@ -0,0 +1,7 @@ +${choice_show} +Stimmverteilung Bundestag +
+
+
diff --git a/uvote/page/user_main_poll/tpl/table_bt_choice.tpl b/uvote/page/user_main_poll/tpl/table_bt_choice.tpl
new file mode 100644
index 0000000..02671bf
--- /dev/null
+++ b/uvote/page/user_main_poll/tpl/table_bt_choice.tpl
@@ -0,0 +1,3 @@
+${bt_pro}%
+ ${bt_con}%
+ ${bt_ent}%
+${disclaimer} \ No newline at end of file diff --git a/uvote/page/user_main_poll/tpl/table_parties.tpl b/uvote/page/user_main_poll/tpl/table_parties.tpl new file mode 100644 index 0000000..1fc807c --- /dev/null +++ b/uvote/page/user_main_poll/tpl/table_parties.tpl @@ -0,0 +1,12 @@ + +
+
diff --git a/uvote/page/user_main_poll/tpl/vote_bt.tpl b/uvote/page/user_main_poll/tpl/vote_bt.tpl
new file mode 100644
index 0000000..a5f5edc
--- /dev/null
+++ b/uvote/page/user_main_poll/tpl/vote_bt.tpl
@@ -0,0 +1,11 @@
+
+
+ ${party_yes}%
+
+
+ ${party_no}%
+
+
+ ${party_ent}%
+
+
+
+
+
+
+
+ ${party_yes}%
+ ${party_no}%
+ ${party_ent}%
+ \ No newline at end of file diff --git a/uvote/page/user_main_poll/tpl/vote_buttons.tpl b/uvote/page/user_main_poll/tpl/vote_buttons.tpl new file mode 100644 index 0000000..fa5772d --- /dev/null +++ b/uvote/page/user_main_poll/tpl/vote_buttons.tpl @@ -0,0 +1,24 @@ +
+
diff --git a/uvote/page/user_main_poll/tpl/vote_buttons_fresh.tpl b/uvote/page/user_main_poll/tpl/vote_buttons_fresh.tpl
new file mode 100644
index 0000000..75e0c54
--- /dev/null
+++ b/uvote/page/user_main_poll/tpl/vote_buttons_fresh.tpl
@@ -0,0 +1,18 @@
+
+
+ Ändere deine Stimme hier ab
+ + + +
+
+
+
+Abgestimmt mit:
+
+
\ No newline at end of file
diff --git a/uvote/page/default_bulletin/tpl/voteweight.tpl b/uvote/page/user_main_poll/tpl/voteweight.tpl
similarity index 100%
rename from uvote/page/default_bulletin/tpl/voteweight.tpl
rename to uvote/page/user_main_poll/tpl/voteweight.tpl
diff --git a/uvote/page/user_main_poll/user_main_poll.php b/uvote/page/user_main_poll/user_main_poll.php
index b1e80e5..e4377d9 100644
--- a/uvote/page/user_main_poll/user_main_poll.php
+++ b/uvote/page/user_main_poll/user_main_poll.php
@@ -4,9 +4,111 @@ class user_main_poll extends SYSTEM\PAGE\Page {
public function __construct($poll_ID){
$this->poll_ID = $poll_ID;
}
+
+ private function choice_party (){
+ $result = '';
+ $party_votes = \SQL\UVOTE_DATA_PARTY_PER_POLL::QA(array($this->poll_ID));
+ foreach($party_votes as $pv){
+ $vote = array( 'party' => $pv['party'],
+ 'choice' => switchers::get_party_per_poll($pv['choice']),
+ 'choice_class' => switchers::tablerow_class($pv['choice']),
+ 'party_yes' => $pv['votes_pro'] > 0 ? round($pv['votes_pro']/$pv['total']*100,0) : ($pv['choice'] == 1 ? '100' : '0'),
+ 'party_no' => $pv['votes_contra'] > 0 ? round($pv['votes_contra']/$pv['total']*100,0) : ($pv['choice'] == 2 ? '100' : '0'),
+ 'party_off' => $pv['total'] > 0 ? round(($pv['total'] - $pv['nr_attending'])/$pv['total']*100,0) : '0',
+ 'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending']);
+ if($vote['party_yes'] == '0' && $vote['party_no'] == '0' && $vote['party_ent'] == '0'){
+ $vote['party_ent'] = 100;}
+ $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_bt.tpl'),$vote);
+ }
+ return $result;
+ }
+ private function bars_user(){
+ $bars = votes::get_barsperusers($this->poll_ID,false);
+ $bars['vote_yes_perc'] = round($bars['yes_perc']*100,0);
+ $bars['vote_no_perc'] = round($bars['no_perc']*100,0);
+ $bars['vote_ent_perc'] = round($bars['ent_perc']*100,0);
+ $bars['title'] = 'Gemessen auf uVote';
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/bars_user.tpl'),$bars);
+ }
+
+
+
+ private function bars_bt(){
+ $vars = votes::get_bar_bt_per_poll($this->poll_ID);
+ $info = votes::get_voteinfo($this->poll_ID);
+ if (!$vars['bt_total']){
+
+ $var['disclaimer'] = 'Keine differenzierten Ergebnisse für den Bundestag verfügbar';
+ $var['choice'] = switchers::tablerow_class($info['bt_choice']);
+ $var['choice_full'] = switchers::tablerow_class($info['bt_choice']);
+ if ($var['choice_full'] == 'open'){
+ $var['choice_full'] = 'noch nicht';
+ }
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $var);
+ }
+
+ $vars['disclaimer'] = '';
+ $vars['choice'] = switchers::tablerow_class($info['bt_choice']);
+ $vars['choice_full'] = switchers::tablerow_class($info['bt_choice']);
+ if ($vars['choice_full'] == 'open'){
+ $vars['choice_full'] = 'noch nicht';
+ }
+ $vars['choice_show'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $vars);
+ $vars['bt_ent'] = round(($vars['bt_attending'] - $vars['bt_pro'] - $vars['bt_con'])/$vars['bt_total']*100,0);
+ $vars['bt_pro'] = round($vars['bt_pro']/$vars['bt_total']*100,0);
+ $vars['bt_con'] = round($vars['bt_con']/$vars['bt_total']*100,0);
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt.tpl'), $vars);
+ }
+
+ private function voice_weight(){
+ $vars = votes::get_count_user_votes_per_poll($this->poll_ID);
+ $vars['voteweight'] = $vars['count'] ? round(1/$vars['count']*100) : 'no votes';
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/voteweight.tpl'), $vars);
+ }
+
+ private function vote_buttons($poll_expired,$user_poll){
+ if($poll_expired){
+ if(!$user_poll){
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons_fresh.tpl', array('poll_ID'=>$this->poll_ID)));
+ }
+ $classes = array('','','');
+ switch($user_poll){
+ case 1: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'disabled','no'=>'','ent'=>'','choice'=>'_pro'); break;
+ case 2: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'disabled','ent'=>'','choice'=>'_con'); break;
+ case 3: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'disabled','choice'=>'_ent'); break;
+ default: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'','choice'=>'');
+ }
+
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons.tpl'), $classes);
+
+ } else {
+ return 'ye soon to come infos';
+ }
+ }
+ private function get_voteinfo(){
+ $var = votes::get_voteinfo($this->poll_ID);
+ return $var['iframe_link'];
+ }
+ public static function js(){
+ return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_poll/js/user_main_poll.js'));}
+
public function html(){
- $vote = votes::get_voteinfo($this->poll_ID); //votes::getVoteOfGroup($poll_ID);
- $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/full_vote.tpl'), $vote);
+ $poll_expired = \SQL\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID, 1));
+ $user_vote = votes::getUserPollData($this->poll_ID);
+ $vars = array();
+ $vars = array_merge($vars, votes::get_voteinfo($this->poll_ID));
+ $vars['sub_buttons'] = votes::get_sublinks($this->poll_ID);
+ $vars['choice_party'] = $this->choice_party();
+ $vars['bars_user'] = $this->bars_user();
+ $vars['bars_bt'] = $this->bars_bt();
+ $vars['voice_weight'] = $this->voice_weight();
+ $vars['vote_buttons'] = $this->vote_buttons($poll_expired, $user_vote);
+ $vars['poll_ID'] = $this->poll_ID; //put it here - so its filled in!
+ $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
+ $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
+ $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
+ //$vars['vote'] = $this->get_voteinfo(); //votes::getVoteOfGroup($poll_ID);
+ $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/full_vote.tpl'), $vars);
return $result;
}
diff --git a/uvote/page/user_main_poll_sub/js/user_main_poll_sub.js b/uvote/page/user_main_poll_sub/js/user_main_poll_sub.js
new file mode 100644
index 0000000..68d92f7
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/js/user_main_poll_sub.js
@@ -0,0 +1,28 @@
+function init_user_main_poll_sub(){
+ $('#btnvote_yes').click(function () {
+ vote_click($(this).attr('poll_ID'),1);
+ });
+ $('#btnvote_no').click(function () {
+ vote_click($(this).attr('poll_ID'),2);
+ });
+ $('#btnvote_off').click(function () {
+ vote_click($(this).attr('poll_ID'),3);
+ });
+ $('#user_main').resize(function(){
+ $('#pollframe').height($('#user_main').height());
+ });
+
+}
+function vote_click (poll_ID, vote) {
+ $.getJSON('./api.php?call=vote&action=vote_sub&poll_ID=' + poll_ID + '&vote=' + vote, function(data) {
+ var items = [];
+ if(data.status == true){
+ alert("success");
+ $('#user_main').load('./?action=open_bulletin&poll_ID=' + poll_ID, function(){
+ open_vote(poll_ID);
+ });
+ } else {
+ alert(data.result.message);
+ }
+ });
+}
\ No newline at end of file
diff --git a/uvote/page/user_main_poll_sub/tpl/bars_user.tpl b/uvote/page/user_main_poll_sub/tpl/bars_user.tpl
new file mode 100644
index 0000000..0839b29
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/bars_user.tpl
@@ -0,0 +1,6 @@
+
+
+ Stimme hier ab
+ + + +
+
+
+Noch nich Abgestimmt...
+uvote community
+
+
diff --git a/uvote/page/user_main_poll_sub/tpl/comment.tpl b/uvote/page/user_main_poll_sub/tpl/comment.tpl
new file mode 100644
index 0000000..e0450f9
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/comment.tpl
@@ -0,0 +1,17 @@
+
+
+${vote_yes_perc}%
+ ${vote_no_perc}%
+ ${vote_ent_perc}%
+ \ No newline at end of file diff --git a/uvote/page/user_main_poll_sub/tpl/full_vote.tpl b/uvote/page/user_main_poll_sub/tpl/full_vote.tpl new file mode 100644 index 0000000..3c01c6e --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/full_vote.tpl @@ -0,0 +1,96 @@ +
+
+
diff --git a/uvote/page/user_main_poll_sub/tpl/icons_table_parties.tpl b/uvote/page/user_main_poll_sub/tpl/icons_table_parties.tpl
new file mode 100644
index 0000000..fa6b9e8
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/icons_table_parties.tpl
@@ -0,0 +1 @@
+
+
+
+
+
+
+
+
+
+
+
+ + Info +
+
+
+
+
+ ${voice_weight} +
+ ${title}
+ ${openvote_help_text} + ${title} abstimmen. ++ ${voice_weight} +
+
+
+
+
+
+
+
+ + Statistik +
+
+
+
+
+
+
+
+
+
+
+ + Endergebnis +
+
+ ${bars_user}
+ ${bars_bt} +
+ + ${bars_bt} +
+
+
+
+
+
+
+
+ + Ergebnis nach Fraktionen +
+
+ ${choice_party}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + Abstimmen +
+
+
+
+ ${vote_buttons}
+
+
+ Quelle: ${iframe_link}
+
+
+
+
+
+ ${urvote_party_table_desc}
diff --git a/uvote/page/user_main_poll_sub/tpl/table_bt.tpl b/uvote/page/user_main_poll_sub/tpl/table_bt.tpl new file mode 100644 index 0000000..f6b7b01 --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/table_bt.tpl @@ -0,0 +1,7 @@ +${choice_show} +Stimmverteilung Bundestag +
+
+
diff --git a/uvote/page/user_main_poll_sub/tpl/table_bt_choice.tpl b/uvote/page/user_main_poll_sub/tpl/table_bt_choice.tpl
new file mode 100644
index 0000000..02671bf
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/table_bt_choice.tpl
@@ -0,0 +1,3 @@
+${bt_pro}%
+ ${bt_con}%
+ ${bt_ent}%
+${disclaimer} \ No newline at end of file diff --git a/uvote/page/user_main_poll_sub/tpl/table_parties.tpl b/uvote/page/user_main_poll_sub/tpl/table_parties.tpl new file mode 100644 index 0000000..1fc807c --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/table_parties.tpl @@ -0,0 +1,12 @@ + +
+
diff --git a/uvote/page/user_main_poll_sub/tpl/vote_bt.tpl b/uvote/page/user_main_poll_sub/tpl/vote_bt.tpl
new file mode 100644
index 0000000..a5f5edc
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/vote_bt.tpl
@@ -0,0 +1,11 @@
+
+
+ ${party_yes}%
+
+
+ ${party_no}%
+
+
+ ${party_ent}%
+
+
+
+
+
+
+
+ ${party_yes}%
+ ${party_no}%
+ ${party_ent}%
+ \ No newline at end of file diff --git a/uvote/page/user_main_poll_sub/tpl/vote_buttons.tpl b/uvote/page/user_main_poll_sub/tpl/vote_buttons.tpl new file mode 100644 index 0000000..8c9b4dd --- /dev/null +++ b/uvote/page/user_main_poll_sub/tpl/vote_buttons.tpl @@ -0,0 +1,24 @@ +
+
diff --git a/uvote/page/user_main_poll_sub/tpl/vote_buttons_fresh.tpl b/uvote/page/user_main_poll_sub/tpl/vote_buttons_fresh.tpl
new file mode 100644
index 0000000..75e0c54
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/vote_buttons_fresh.tpl
@@ -0,0 +1,18 @@
+
+
+ Ändere deine Stimme hier ab
+ + + +
+
+
+
+Abgestimmt mit:
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_poll_sub/tpl/voteweight.tpl b/uvote/page/user_main_poll_sub/tpl/voteweight.tpl
new file mode 100644
index 0000000..fc5d06f
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/tpl/voteweight.tpl
@@ -0,0 +1,4 @@
+
+
+ Stimme hier ab
+ + + +
+
+
+Noch nich Abgestimmt...
+
+ Dein aktuelles Stimmgewicht bei dieser Abstimmung:
+ ${voteweight}%
+
\ No newline at end of file
diff --git a/uvote/page/user_main_poll_sub/user_main_poll_sub.php b/uvote/page/user_main_poll_sub/user_main_poll_sub.php
new file mode 100644
index 0000000..fdff3af
--- /dev/null
+++ b/uvote/page/user_main_poll_sub/user_main_poll_sub.php
@@ -0,0 +1,111 @@
+poll_ID = $poll_ID;
+ }
+
+ private function choice_party (){
+ $result = '';
+ $party_votes = \SQL\UVOTE_DATA_PARTY_PER_POLL::QA(array($this->poll_ID));
+ foreach($party_votes as $pv){
+ $vote = array( 'party' => $pv['party'],
+ 'choice' => switchers::get_party_per_poll($pv['choice']),
+ 'choice_class' => switchers::tablerow_class($pv['choice']),
+ 'party_yes' => $pv['votes_pro'] > 0 ? round($pv['votes_pro']/$pv['total']*100,0) : ($pv['choice'] == 1 ? '100' : '0'),
+ 'party_no' => $pv['votes_contra'] > 0 ? round($pv['votes_contra']/$pv['total']*100,0) : ($pv['choice'] == 2 ? '100' : '0'),
+ 'party_off' => $pv['total'] > 0 ? round(($pv['total'] - $pv['nr_attending'])/$pv['total']*100,0) : '0',
+ 'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending']);
+ if($vote['party_yes'] == '0' && $vote['party_no'] == '0' && $vote['party_ent'] == '0'){
+ $vote['party_ent'] = 100;}
+ $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_bt.tpl'),$vote);
+ }
+ return $result;
+ }
+ private function bars_user(){
+ $bars = votes::get_barsperusers($this->poll_ID,false);
+ $bars['vote_yes_perc'] = round($bars['yes_perc']*100,0);
+ $bars['vote_no_perc'] = round($bars['no_perc']*100,0);
+ $bars['vote_ent_perc'] = round($bars['ent_perc']*100,0);
+ $bars['title'] = 'Gemessen auf uVote';
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/bars_user.tpl'),$bars);
+ }
+
+
+
+ private function bars_bt(){
+ $vars = votes::get_bar_bt_per_poll($this->poll_ID);
+ $info = votes::get_voteinfo($this->poll_ID);
+ if (!$vars['bt_total']){
+
+ $var['disclaimer'] = 'Keine differenzierten Ergebnisse für den Bundestag verfügbar';
+ $var['choice'] = switchers::tablerow_class($info['bt_choice']);
+ $var['choice_full'] = switchers::tablerow_class($info['bt_choice']);
+ if ($var['choice_full'] == ''){
+ $var['choice_full'] = 'noch nicht';
+ }
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $var);
+ }
+
+ $vars['disclaimer'] = '';
+ $vars['choice'] = switchers::tablerow_class($info['bt_choice']);
+ $vars['choice_full'] = switchers::tablerow_class($info['bt_choice']);
+ if ($vars['choice_full'] == 'open'){
+ $vars['choice_full'] = 'noch nicht';
+ }
+ $vars['choice_show'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $vars);
+ $vars['bt_ent'] = round(($vars['bt_attending'] - $vars['bt_pro'] - $vars['bt_con'])/$vars['bt_total']*100,0);
+ $vars['bt_pro'] = round($vars['bt_pro']/$vars['bt_total']*100,0);
+ $vars['bt_con'] = round($vars['bt_con']/$vars['bt_total']*100,0);
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt.tpl'), $vars);
+ }
+
+ private function voice_weight(){
+ $vars = votes::get_count_user_votes_per_poll($this->poll_ID);
+ $vars['voteweight'] = $vars['count'] ? round(1/$vars['count']*100) : 'no votes';
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/voteweight.tpl'), $vars);
+ }
+
+ private function vote_buttons($poll_expired,$user_poll){
+
+ if(!$user_poll){
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons_fresh.tpl', array('poll_ID'=>$this->poll_ID)));
+ }
+ $classes = array('','','');
+ switch($user_poll){
+ case 1: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'disabled','no'=>'','ent'=>'','choice'=>'_pro'); break;
+ case 2: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'disabled','ent'=>'','choice'=>'_con'); break;
+ case 3: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'disabled','choice'=>'_ent'); break;
+ default: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'','choice'=>'');
+ }
+
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons.tpl'), $classes);
+
+ }
+ private function get_voteinfo(){
+ $var = votes::get_voteinfo($this->poll_ID);
+ return $var['iframe_link'];
+ }
+ public static function js(){
+ return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_poll_sub/js/user_main_poll_sub.js'));}
+
+ public function html(){
+ $poll_expired = \SQL\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID, 2));
+ $user_vote = votes::getUserPollDataSub($this->poll_ID);
+ $vars = array();
+ $vars = array_merge($vars,votes::get_voteinfo_sub($this->poll_ID));
+ $vars['choice_party'] = $this->choice_party();
+ $vars['bars_user'] = $this->bars_user();
+ $vars['bars_bt'] = $this->bars_bt();
+ $vars['voice_weight'] = $this->voice_weight();
+ $vars['vote_buttons'] = $this->vote_buttons($poll_expired, $user_vote);
+ $vars['poll_ID'] = $this->poll_ID; //put it here - so its filled in!
+ $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
+ $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
+ $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
+ //$vars['vote'] = $this->get_voteinfo(); //votes::getVoteOfGroup($poll_ID);
+ $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll_sub/tpl/full_vote.tpl'), $vars);
+ return $result;
+ }
+
+}
\ No newline at end of file
diff --git a/uvote/page/user_main_start/js/user_main_start.js b/uvote/page/user_main_start/js/user_main_start.js
new file mode 100644
index 0000000..aa641d5
--- /dev/null
+++ b/uvote/page/user_main_start/js/user_main_start.js
@@ -0,0 +1,3 @@
+function init_user_main_start(){
+
+}
diff --git a/uvote/page/user_main_start/tpl/user_main_start.tpl b/uvote/page/user_main_start/tpl/user_main_start.tpl
new file mode 100644
index 0000000..1cad198
--- /dev/null
+++ b/uvote/page/user_main_start/tpl/user_main_start.tpl
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+ + Willkommen auf uvote.eu! +
+
+
+
+ ${welcome_text_loggedin}
+
+
+
+
+ ${user_temp_votes}
+
+
+
+
+
+ ${user_count} +
+ + ${user_count} +
+
+ Nutzer auf uVote +
+ + Nutzer auf uVote +
+
\ No newline at end of file
diff --git a/uvote/page/user_main_start/user_main_start.php b/uvote/page/user_main_start/user_main_start.php
new file mode 100644
index 0000000..99f95a8
--- /dev/null
+++ b/uvote/page/user_main_start/user_main_start.php
@@ -0,0 +1,28 @@
+user_count();
+ $vars['user_temp_votes'] = votes::get_user_temp_votes();
+ $vars['news'] = $this->newsfeed();
+ $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
+ $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_start/tpl/user_main_start.tpl'), $vars);
+ }
+
+}
\ No newline at end of file
diff --git a/uvote/page/user_main_uVote/tpl/bt_to_uvote_overall.tpl b/uvote/page/user_main_uVote/tpl/bt_to_uvote_overall.tpl
deleted file mode 100644
index 34cff78..0000000
--- a/uvote/page/user_main_uVote/tpl/bt_to_uvote_overall.tpl
+++ /dev/null
@@ -1,8 +0,0 @@
-
+
+
+
+
+
+ + News +
+
+ ${news}
+
+
-
-
- ${welcome_text}
-
- ${user_count} Nutzer auf uVote
-
-
-
-
- ${list_active}
-
-
diff --git a/uvote/page/user_main_uVote/tpl/uvoteparties.tpl b/uvote/page/user_main_uVote/tpl/uvoteparties.tpl
deleted file mode 100644
index 8c30031..0000000
--- a/uvote/page/user_main_uVote/tpl/uvoteparties.tpl
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-Aktueller Status
-
- Teilnahme an aktuellen Abstimmungen
-
-
-
- ${vote_perc}%
-
-
- Teilgenommen: ${voted}, nicht Teilgenommen: ${not_voted}
-
-diff --git a/uvote/page/user_main_urVote/tpl/bt_to_user_overall.tpl b/uvote/page/user_main_urVote/tpl/bt_to_user_overall.tpl deleted file mode 100644 index cd2c1f8..0000000 --- a/uvote/page/user_main_urVote/tpl/bt_to_user_overall.tpl +++ /dev/null @@ -1,8 +0,0 @@ -
- Abstimmungsquote seit Accounterstellung
-
\ No newline at end of file
diff --git a/uvote/page/user_main_urVote/tpl/urVote.tpl b/uvote/page/user_main_urVote/tpl/urVote.tpl
deleted file mode 100644
index 93bda58..0000000
--- a/uvote/page/user_main_urVote/tpl/urVote.tpl
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
- ${vote_perc}%
-
-
- Teilgenommen: ${voted},
- nicht Teilgenommen: ${not_voted}
-
-
-
-
-
\ No newline at end of file
diff --git a/uvote/page/user_main_urVote/tpl/urvoteparties.tpl b/uvote/page/user_main_urVote/tpl/urvoteparties.tpl
deleted file mode 100644
index cc85ac8..0000000
--- a/uvote/page/user_main_urVote/tpl/urvoteparties.tpl
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
- - ${urVote_title} -
-
- ${urvote_body_text}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${user_temp_votes}
- -
${user_overall_votes}
-
-
-
-
-
-
-
insgesamt Dafür, Dagegen oder -
Enthaltung gestimmt hat. -
- Entscheidungsverhalten der uVote Community
- - ${votes_all} - - Wie oft die uVote Community -insgesamt Dafür, Dagegen oder -
Enthaltung gestimmt hat. -
-
Dafür, Dagegen oder -
Enthaltung gestimmt hat. -
- Entscheidungsverhalten des Bundestags
- - ${votes_all_bt} - - Wie oft der Bundestag -Dafür, Dagegen oder -
Enthaltung gestimmt hat. -
-
-
-
-
- ${class_MATCH}
- ${class_MISSMATCH}
-
- ${match_percentage}%
-
-
-
-
-
\ No newline at end of file
diff --git a/uvote/page/user_main_urVote/tpl/votecountchoice.tpl b/uvote/page/user_main_urVote/tpl/votecountchoice.tpl
deleted file mode 100644
index 1b6f8ea..0000000
--- a/uvote/page/user_main_urVote/tpl/votecountchoice.tpl
+++ /dev/null
@@ -1,5 +0,0 @@
-
-${choice}
-${count}
-
-
diff --git a/uvote/page/user_main_urVote/tpl/votecountchoicebt.tpl b/uvote/page/user_main_urVote/tpl/votecountchoicebt.tpl
deleted file mode 100644
index 3e74993..0000000
--- a/uvote/page/user_main_urVote/tpl/votecountchoicebt.tpl
+++ /dev/null
@@ -1,4 +0,0 @@
-
-${bt_choice}
-${count}
-
diff --git a/uvote/page/user_main_urVote/user_main_urVote.php b/uvote/page/user_main_urVote/user_main_urVote.php
deleted file mode 100644
index b38c1ca..0000000
--- a/uvote/page/user_main_urVote/user_main_urVote.php
+++ /dev/null
@@ -1,144 +0,0 @@
-id, \SYSTEM\SECURITY\Security::getUser()->creationDate);
- $v = $vars['voted'] > 1 ? $vars['voted'] : 1;
- $nv = $vars['not_voted'];
- return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/overall_all_polls.tpl'),
- array( 'vote_perc'=> round($v/($nv+$v)*100, 2),
- 'no_vote_perc'=> round($nv/($nv+$v)*100, 2),
- 'voted'=> $v,
- 'not_voted'=> $nv));
- }
-
- private function user_temp_votes (){
- $vars = votes::get_user_temp_votes(\SYSTEM\SECURITY\Security::getUser()->id);
- $v = $vars['voted'];
- $nv = $vars['not_voted'];
- print_r($vars, true);
- return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/all_polls.tpl'),
- array( 'vote_perc'=> round($v/(($nv+$v)*100+1), 2),
- 'no_vote_perc'=> round($nv/(($nv+$v)*100+1), 2),
- 'voted'=> $v,
- 'not_voted'=> $nv));
- }
-
- private function user_to_bt(){
- //$vars = votes::get_user_per_party_overall($user_ID);
- $result = '';
- $con = new \SYSTEM\DB\Connection();
- $res = $con->prepare( 'bt_to_user',
- 'SELECT sum(case when uvote_data.choice = uvote_votes.bt_choice then 1 else 0 end) class_MATCH,
- sum(case when uvote_data.choice != uvote_votes.bt_choice then 1 else 0 end) class_MISSMATCH
- FROM uvote_data LEFT JOIN uvote_votes
- ON uvote_data.poll_ID = uvote_votes.ID
- 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']+1)*100,2);
-
- $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/bt_to_user_overall.tpl'), $row);
- }
- return $result;
- $row['votes_cast'] = round(($row['class_MATCH']+$row['class_MISSMATCH']),2);
-}
-
-
-
- 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();
- $res = $con->prepare( 'test',
- 'SELECT party, sum(case when uvote_data.choice = uvote_votes_per_party.choice then 1 else 0 end) class_MATCH,
- sum(case when uvote_data.choice != uvote_votes_per_party.choice then 1 else 0 end) class_MISSMATCH
- FROM uvote_data INNER JOIN uvote_votes_per_party
- ON uvote_data.poll_ID = uvote_votes_per_party.poll_ID
- WHERE user_ID = ? GROUP BY party;',
- array(\SYSTEM\SECURITY\Security::getUser()->id));
- $i = 0;
- while($row = $res->next()){
-
- $res2 = votes::vote_accord_with_party($row['party']);
- $row['according_laws'] = $this->build_according_law_html($res2, $row['party']);
- $row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2);
- $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/urvoteparties.tpl'), $row);;
- }
- return $result;
-}
- public function build_according_law_html($part, $party){
- $part = json_decode($part, true);
- $result = "Bei folgenden Gesetzen hast du genauso abgestimmt wie die '".$party."':
"; - foreach ($part['result'] as $p){ - $result .= $p['title']."
"; - } - $result .= "
+
+
+
+
+
+
+ + Abstimmen + +
+
+ ${votelist_disclaimer}
+
+
+
+
+
+
+${filterlist}
+
+
+
diff --git a/uvote/page/user_main_votelist/tpl/vote.tpl b/uvote/page/user_main_votelist/tpl/vote.tpl
new file mode 100644
index 0000000..d470473
--- /dev/null
+++ b/uvote/page/user_main_votelist/tpl/vote.tpl
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uvote/page/user_main_votelist/tpl/vote_bt.tpl b/uvote/page/user_main_votelist/tpl/vote_bt.tpl
new file mode 100644
index 0000000..db443f1
--- /dev/null
+++ b/uvote/page/user_main_votelist/tpl/vote_bt.tpl
@@ -0,0 +1,2 @@
+
+
+
+
+
+
+
+
+ + + + +
+
+
+
+ ${votelist}
+
+ \ No newline at end of file diff --git a/uvote/page/user_main_votelist/tpl/vote_uv.tpl b/uvote/page/user_main_votelist/tpl/vote_uv.tpl new file mode 100644 index 0000000..1fdff47 --- /dev/null +++ b/uvote/page/user_main_votelist/tpl/vote_uv.tpl @@ -0,0 +1 @@ +${perc}% diff --git a/uvote/page/user_main_votelist/user_main_votelist.php b/uvote/page/user_main_votelist/user_main_votelist.php new file mode 100644 index 0000000..a8f502c --- /dev/null +++ b/uvote/page/user_main_votelist/user_main_votelist.php @@ -0,0 +1,29 @@ +user_count(); + $vars['user_temp_votes'] = votes::get_user_temp_votes(); + $vars['filterlist'] = $this->get_list_tags(); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register')); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote')); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/user_main_votelist.tpl'), $vars); + } + +} \ No newline at end of file diff --git a/uvote/sai/autoload.inc b/uvote/sai/autoload.inc new file mode 100644 index 0000000..e928ede --- /dev/null +++ b/uvote/sai/autoload.inc @@ -0,0 +1,4 @@ + - - - -
-
-
poll start
- - 00:00 -poll end
- - 00:00 --Submit +
+
- \ No newline at end of file diff --git a/uvote/sai/saimod_uvote_vote_edit/new.tpl b/uvote/sai/saimod_uvote_vote_edit/new.tpl new file mode 100644 index 0000000..80e4490 --- /dev/null +++ b/uvote/sai/saimod_uvote_vote_edit/new.tpl @@ -0,0 +1,16 @@ +
+Edit Votes ';}
+ }
+ public static function sai_mod__SAI_saimod_uvote_vote_edit_action_edit_partydata($data_json){
+ $datastd = \json_decode($data_json);
+ $data = (array)$datastd;
+ new \SYSTEM\LOG\WARNING(print_r($data, TRUE));
+ return \SQL\UVOTE_DATA_EDIT_PARTYDATA::QA(array($data['poll_ID'],
+ $data['party'],
+ $data['votes_pro'],
+ $data['votes_contra'],
+ $data['nr_attending'],
+ $data['total'],
+ $data['choice'],
+ $data['votes_pro'],
+ $data['votes_contra'],
+ $data['nr_attending'],
+ $data['total'],
+ $data['choice']));
+ }
+ public static function html_li_menu(){return 'Edit Votes ';}
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
- public static function sai_mod_saimod_uvote_vote_edit_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array(
- \SYSTEM\WEBPATH(new PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.js')
- ));}
- public static function sai_mod_saimod_uvote_vote_edit_flag_css(){return \SYSTEM\LOG\JsonResult::toString(array()
+ public static function js(){return array(
+ \SYSTEM\WEBPATH(new \PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.js')
);}
+ public static function css(){return array()
+ ;}
}
\ No newline at end of file
diff --git a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl
index d37ceab..7d78a7a 100644
--- a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl
+++ b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl
@@ -1,4 +1,3 @@
-${new_vote}
${list}
\ No newline at end of file
diff --git a/uvote/sai/saimod_uvote_vote_edit/vote.tpl b/uvote/sai/saimod_uvote_vote_edit/vote.tpl
index 906565b..aa83cc9 100644
--- a/uvote/sai/saimod_uvote_vote_edit/vote.tpl
+++ b/uvote/sai/saimod_uvote_vote_edit/vote.tpl
@@ -1,48 +1,32 @@
-
-
-
-
-
-
+
-
+
+
-
- cdu
- 123
- 123
- 123
- csu123 - 123 - 123 - 123
- spd123 - 123 - 123 - 123
- grüne123 - 123 - 123 - 123
- linke123 - 123 - 123 - 123
-
-
+
+
-
-
-
-
+
+
-- \ No newline at end of file diff --git a/uvote/sai/saimod_uvote_vote_edit/new.tpl b/uvote/sai/saimod_uvote_vote_edit/new.tpl new file mode 100644 index 0000000..80e4490 --- /dev/null +++ b/uvote/sai/saimod_uvote_vote_edit/new.tpl @@ -0,0 +1,16 @@ +
+
+
+
+
+
++
+
poll start
+ - 00:00 +poll end
+ - 00:00 +tags
+ ++
+Submit
+
\ No newline at end of file
diff --git a/uvote/sai/saimod_uvote_vote_edit/parties.tpl b/uvote/sai/saimod_uvote_vote_edit/parties.tpl
new file mode 100644
index 0000000..3dbfbaa
--- /dev/null
+++ b/uvote/sai/saimod_uvote_vote_edit/parties.tpl
@@ -0,0 +1 @@
+${partylist}
\ No newline at end of file
diff --git a/uvote/sai/saimod_uvote_vote_edit/party.tpl b/uvote/sai/saimod_uvote_vote_edit/party.tpl
new file mode 100644
index 0000000..8501250
--- /dev/null
+++ b/uvote/sai/saimod_uvote_vote_edit/party.tpl
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/uvote/sai/saimod_uvote_vote_edit/partynew.tpl b/uvote/sai/saimod_uvote_vote_edit/partynew.tpl
new file mode 100644
index 0000000..ee4fdf6
--- /dev/null
+++ b/uvote/sai/saimod_uvote_vote_edit/partynew.tpl
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js
index 069cefd..3ff417f 100644
--- a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js
+++ b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js
@@ -1,44 +1,42 @@
function init_saimod_uvote_vote_edit(){
+$('.bt_data_submit').click(function() {
+ var poll_ID = $(this).attr('poll_ID');
+ var title = $('#' + poll_ID + '_vote_title').val();
+ var time_end = $('#' + poll_ID + '_time_end').val();
+ var iframe_link = $('#' + poll_ID + '_iframe_link').val();
+ var bt_choice = $('#' + poll_ID + '_bt_choice').val();
+ var tags = JSON.stringify($('#' + poll_ID + '_tags').val().split(',').map(function(s) { return s.trim() }));
+ var data = {poll_ID: poll_ID, title: title, time_end: time_end, iframe_link: iframe_link, bt_choice: bt_choice};
+ $.getJSON('./sai.php?sai_mod=.SAI.saimod_uvote_vote_edit&action=edit_vote&data=' + JSON.stringify(data) + '&tags=' + tags, function(data) {
+ var items = [];
+ if(data.status == true){
+ alert("success");
+ } else {
+ alert(data.result.message);
+ }
+ });
+ });
- $('.btn_editvote').click(function() {
- alert ('');
- var poll_ID = $('#input_poll_title').attr('poll_ID');
- var title = $('#input_poll_title').val();
- var iframe_link = $('#input_poll_link').val();
- vote_data_edit(poll_ID, title, iframe_link);
-
-
-
-// var data = new Array();
-// alert("bla")
-// $.ajax({
-// url: SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_uvote_vote_edit&action='+ vote,
-// contentType : "application/json; charset=utf-8",
-// vote : JSON.stringify({
-// sai_mod: 'saimod_uvote_vote_edit',
-// action: 'new_vote',
-// json: data,
-// }),
-// dataType : 'json',
-// type : 'POST' ,
-// success: function(vote) {
-// alert("success");
-// }});
-// alert("js läuft");
- })};
+ $('.bt_partydata_submit').click(function() {
+ var poll_ID = $(this).attr('poll_ID');
+ var party = $('#input_party').val();
+ var votes_pro = $('#input_pro').val();
+ var votes_contra = $('#input_con').val();
+ var nr_attending = $('#input_att').val();
+ var total = $('#input_total').val();
+ var choice = $('#input_choice').val();
+ var data = {poll_ID: poll_ID, party: party, votes_pro: votes_pro, votes_contra: votes_contra, nr_attending: nr_attending, total: total, choice: choice};
+ $.getJSON('./sai.php?sai_mod=.SAI.saimod_uvote_vote_edit&action=edit_partydata&data=' + JSON.stringify(data), function(data) {
+ var items = [];
+ if(data.status == true){
+ alert("success");
+ } else {
+ alert(data.result.message);
+ }
+ });
+ });
+};
-function vote_data_edit (poll_ID, title, iframe_link) {
- alert('vote_data_edit');
-
- $.getJSON('./api.php?call=vote&action=new_vote&poll_ID=' + poll_ID + '&title=' + title + '&iframe_link=' + iframe_link, function(data) {
- var items = [];
- if(data.status == true){
- alert("success");
- } else {
- alert(data.result.message);
- }
- });
-}
diff --git a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php
index 4ad6d78..bbc7627 100644
--- a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php
+++ b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php
@@ -1,4 +1,5 @@
affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no data added")) : \SYSTEM\LOG\JsonResult::ok();
new \SYSTEM\LOG\INFO($vote);
}
-
- public static function sai_mod_saimod_uvote_vote_edit_action_insertPartyChoice ($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){
- $vars = votes::insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice);
- }
public static function sai_mod_saimod_uvote_new_vote(){
+ $ID = array();
+ $ID['ID'] = '';
+ return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/new.tpl'), $ID);
+ }
+ public static function party_stats($poll_ID){
$result = '';
- $vote = array();
- $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/vote.tpl'), $vote);
-
+ $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/partynew.tpl'));
+ $parties = \SQL\UVOTE_DATA_PARTY_PER_POLL::QA(array($poll_ID));
+ foreach($parties as $poll){
+ $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/party.tpl'), $poll);
+ }
+ return $result;
}
-
- public static function sai_mod_saimod_uvote_vote_edit(){
+ public static function sai_mod__SAI_saimod_uvote_vote_edit(){
/*$vars = array();
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.tpl', $vars);*/
$result = '';
-// $result.=self::sai_mod_saimod_uvote_new_vote();
- $votes = votes::getAllVotesOfGroup(1);
+ $result.=self::sai_mod_saimod_uvote_new_vote();
+ $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'] = self::tablerow_class(votes::getUserPollData($vote['ID']));
- $vote['bt_vote_class'] = self::tablerow_class($vote['bt_choice']);
+ $time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']);
$vote['time_left'] = round($time_remain/($time_span+1)*100,0);
$vote['time_done'] = 100-$vote['time_left'];
- $vote['new_vote'] = self::sai_mod_saimod_uvote_new_vote();
- $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/vote.tpl'), $vote);
+ $vote['parties'] = self::party_stats($vote['ID']);
+ $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/main.tpl'), $vote);
}
- return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl'), array('list' => $result));
+ return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl'), array('list' => $result));
}
- private static function tablerow_class($choice){
- switch($choice){
- case 1:
- return 'pro';
- case 2:
- return 'contra';
- case 3:
- return 'ent';
- default:
- return '';
- }
- }
+ public static function sai_mod__SAI_saimod_uvote_vote_edit_action_edit_vote($data_json, $tags_json){
+ $tags = \json_decode($tags_json);
+ $data_stdClass = \json_decode($data_json);
+ $data = (array)$data_stdClass;
+ if(!$data['poll_ID']){
+ new \SYSTEM\LOG\WARNING(print_r($data, TRUE));
+ \SYSTEM\PAGE\text::save($data['title'], $data['title'], 'deDE', $tags, 'blanc');
+ return \SQL\UVOTE_DATA_NEW_POLL::QA(array($data['title'], $data['time_end'], $data['iframe_link']));
+ }
+ return \SQL\UVOTE_DATA_EDIT_POLL::QA(array($data['poll_ID'], $data['title'], $data['time_end'], $data['iframe_link'], $data['bt_choice']));
- public static function html_li_menu(){return '
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Nr.${ID}
-
Edit
-
- csu123 - 123 - 123 - 123
- spd123 - 123 - 123 - 123
- grüne123 - 123 - 123 - 123
- linke123 - 123 - 123 - 123
-
+
+
+
uv
- 123
- 123
- 123
-