diff --git a/uvote/api/api_uvote.php b/uvote/api/api_uvote.php index abf29ff..00b0307 100644 --- a/uvote/api/api_uvote.php +++ b/uvote/api/api_uvote.php @@ -41,7 +41,9 @@ class api_uvote extends \SYSTEM\API\api_system { return graphs::graph_party_to_user_overall_by_time($party, $timespan);} public static function call_donut_party_to_user_overall(){ - return graphs::donut_party_to_user_overall();} + return graphs::donut_party_to_user_overall();} + public static function call_donut_party_to_community_overall(){ + return graphs::donut_party_to_community_overall();} //comments public static function call_vote_action_comment($poll_ID, $c_choice, $c_txt, $c_src) { return comments::write_comment($poll_ID, $c_choice, $c_txt, $c_src);} @@ -60,7 +62,12 @@ class api_uvote extends \SYSTEM\API\api_system { return stats_bilance_choice::basic_bilance_choice($cat); } } - + public static function call_load_list($filter, $time){ + return lists::generate_votelist($filter); + } + public static function call_load_list_text_search($text){ + return lists::text_search($text); + } } \ No newline at end of file diff --git a/uvote/api/votes/graphs.php b/uvote/api/votes/graphs.php index 0bd3b2b..02622c7 100644 --- a/uvote/api/votes/graphs.php +++ b/uvote/api/votes/graphs.php @@ -55,5 +55,14 @@ class graphs { } return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; } + public static function donut_party_to_community_overall ($returnasjson = true){ + $result = array(); + $res = \SQL\UVOTE_DATA_COMMUNITY_TO_PARTIES_OVERALL::QQ(array()); + while ($row = $res->next()){ + $result[] = array( 0 => $row['party'], + 'class_match' => $row['class_MATCH']); + } + return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; + } } diff --git a/uvote/api/votes/lists.php b/uvote/api/votes/lists.php index 3e09aa7..6c336c2 100644 --- a/uvote/api/votes/lists.php +++ b/uvote/api/votes/lists.php @@ -1,12 +1,20 @@ 0 ? 'Abstimmen' : 'Ansehen'; @@ -14,6 +22,43 @@ class lists{ $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5'; $user_vote = votes::getUserPollData($vote['ID']); $vote['vote_class'] = switchers::tablerow_class($user_vote); + $vote['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id='; + if($time_remain > 0){ + $vote['statusmarker'] = 'aktuell'; + $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/vote.tpl'), $vote); + } else { + $vote['statusmarker'] = 'vergangen'; + $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/vote.tpl'), $vote); + } + } + return $result[0].$result[1]; + } + public static function get_all_tags_of_vote($poll_ID){ + $result = ''; + $vars = \SQL\UVOTE_DATA_USER_TAGS_OF_VOTE::QA(array($poll_ID)); + foreach ($vars as $tag){ + $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/tag.tpl'),$tag); + } + return $result; + } + + public static function text_search($text){ + $result = array('',''); + $votes = \SQL\UVOTE_DATA_TEXT_SEARCH::QA(array($text)); + foreach($votes as $vote){ + $time_remain = strtotime($vote['time_end'])- microtime(true); + $time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']); + $vote_count = votes::get_count_user_votes_per_poll($vote['ID']); + $vote['votecount'] = $vote_count['count']; + $vote['tags'] = self::get_all_tags_of_vote($vote['ID']); + $vote['time_left'] = round($time_remain/($time_span+1)*100,0); + $vote['time_done'] = 100-$vote['time_left']; + $vote['full_vote_btn'] = $time_remain > 0 ? 'Abstimmen' : 'Ansehen'; + $vote['uv'] = $vote['bt'] = ''; + $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5'; + $user_vote = votes::getUserPollData($vote['ID']); + $vote['vote_class'] = switchers::tablerow_class($user_vote); + $vote['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id='; if($time_remain > 0){ $vote['statusmarker'] = 'aktuell'; $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/vote.tpl'), $vote); diff --git a/uvote/files/frontend_logos/logo.png b/uvote/files/frontend_logos/logo.png index 06604da..3130c90 100644 Binary files a/uvote/files/frontend_logos/logo.png and b/uvote/files/frontend_logos/logo.png differ diff --git a/uvote/files/frontend_logos/logo4.png b/uvote/files/frontend_logos/logo4.png new file mode 100644 index 0000000..6c9f6c8 Binary files /dev/null and b/uvote/files/frontend_logos/logo4.png differ diff --git a/uvote/files/frontend_logos/logo_new.psd b/uvote/files/frontend_logos/logo_new.psd new file mode 100644 index 0000000..cc4ac1b Binary files /dev/null and b/uvote/files/frontend_logos/logo_new.psd differ diff --git a/uvote/files/frontend_logos/logo_new_new.psd b/uvote/files/frontend_logos/logo_new_new.psd new file mode 100644 index 0000000..a4d8299 Binary files /dev/null and b/uvote/files/frontend_logos/logo_new_new.psd differ diff --git a/uvote/page/default_page/css/page.css b/uvote/page/default_page/css/page.css index 0a201ee..3879dd1 100644 --- a/uvote/page/default_page/css/page.css +++ b/uvote/page/default_page/css/page.css @@ -22,7 +22,6 @@ body { #site-content { padding: 0; margin: 0; - margin-left: 35px; } #user_main { diff --git a/uvote/page/default_page/css/vote.css b/uvote/page/default_page/css/vote.css index e0cdecf..aecc633 100644 --- a/uvote/page/default_page/css/vote.css +++ b/uvote/page/default_page/css/vote.css @@ -1,8 +1,4 @@ -#vote_main { - padding: 5px; - margin: 5px; - width: 100%; -} + #vote_sub1 { float: left; diff --git a/uvote/page/default_page/tpl/menu.tpl b/uvote/page/default_page/tpl/menu.tpl index e79f1e9..1389721 100644 --- a/uvote/page/default_page/tpl/menu.tpl +++ b/uvote/page/default_page/tpl/menu.tpl @@ -4,7 +4,7 @@
  •  Abstimmen
  •  Auswerten
  • -
  •  Impressum
  • +
  •  Impressum
  • ${loginform}
  • diff --git a/uvote/page/default_page/tpl/page.tpl b/uvote/page/default_page/tpl/page.tpl index a696c3d..2dda823 100644 --- a/uvote/page/default_page/tpl/page.tpl +++ b/uvote/page/default_page/tpl/page.tpl @@ -11,21 +11,14 @@ ${js} -
    -
    -
    -
    +
    +
    -
    -

    -
    - ${menu} -
    -
    +
    ${menu}
    +
    -
    diff --git a/uvote/page/default_register/tpl/register.tpl b/uvote/page/default_register/tpl/register.tpl index 177b15a..7a43234 100644 --- a/uvote/page/default_register/tpl/register.tpl +++ b/uvote/page/default_register/tpl/register.tpl @@ -71,7 +71,7 @@
    - + ${locale}
    diff --git a/uvote/page/user_main_analysis/js/user_main_analysis.js b/uvote/page/user_main_analysis/js/user_main_analysis.js index f1f0191..226a3cd 100644 --- a/uvote/page/user_main_analysis/js/user_main_analysis.js +++ b/uvote/page/user_main_analysis/js/user_main_analysis.js @@ -78,6 +78,12 @@ $('#a_acc_12').click(function () { $('#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), @@ -89,8 +95,7 @@ $('#a_acc_5').click(function () { function load_tab(set, cat, body){ $(body).load('./api.php?call=load_tab&set=' + set + '&cat=' + cat, function(){ - if(set == 'bilance' && cat == 'user'){ - load_visualisation_user_to_parties_overall('donut_user_to_party_overall', 84600);} + }); } @@ -230,7 +235,70 @@ function load_visualisation_user_to_parties_overall(id, timespan){ colors: ['#000736', '#0022FF', '#33FF00', '#D2067A', '#F20101'], pieHole: '0.4', chartArea:{}, - width: "500", + 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); }); 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 index ea7c834..da2c155 100644 --- 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 @@ -14,17 +14,3 @@ ${analysis_math_user_to_party_overall}
    -
    -
    -
    -

    Relative Übereinstimmung

    -
    -
    -
    -
    -

    - ${analysis_help_party_donut} -

    - ${analysis_math_party_donut} -
    -
    \ No newline at end of file diff --git a/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl b/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl index 4d65398..a3bf9f5 100644 --- a/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl +++ b/uvote/page/user_main_analysis/tpl/user_main_analysis.tpl @@ -37,6 +37,47 @@
    +
    +
    + +
    +
    +
    +

    "Dein" Bundestag

    +
    +
    +
    +
    +

    Der Bundestag

    +
    +
    +
    +
    +

    die uvote community

    +
    +
    +
    +
    +
    +
    +

    + ${analysis_help_party_donut} +

    + ${analysis_math_party_donut} +
    +
    +
    +
    +
    @@ -52,6 +93,8 @@
    + +
    @@ -187,7 +230,7 @@

    -    community Daten +    community Daten

    diff --git a/uvote/page/user_main_votelist/js/user_main_votelist.js b/uvote/page/user_main_votelist/js/user_main_votelist.js index 5077765..a63c38d 100644 --- a/uvote/page/user_main_votelist/js/user_main_votelist.js +++ b/uvote/page/user_main_votelist/js/user_main_votelist.js @@ -1,2 +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 index 1d9cd57..3a5bbf8 100644 --- a/uvote/page/user_main_votelist/tpl/user_main_votelist.tpl +++ b/uvote/page/user_main_votelist/tpl/user_main_votelist.tpl @@ -1,14 +1,52 @@ -
    +

    -  Hier gehts zur Abstimmung +  Abstimmen

    - - ${votelist} + ${votelist_disclaimer}
    +
    +
    + +
    +
    + +
    ${filterlist}
    +
    +
    +
    +
    +
    + +
    +

    +   + + +

    +
    + +
    +
    +
    + ${votelist} +
    +
    +
    +
    + diff --git a/uvote/page/user_main_votelist/tpl/vote.tpl b/uvote/page/user_main_votelist/tpl/vote.tpl index e1185aa..d470473 100644 --- a/uvote/page/user_main_votelist/tpl/vote.tpl +++ b/uvote/page/user_main_votelist/tpl/vote.tpl @@ -1,21 +1,34 @@ -
    - -
    - -
    -
    - ${title} -
    -
    - -
    -
    -   Abstimmen +
    +
    +
    + +
    + +
    + ${title} +
    +
    + +
    + ${votecount} Stimme/n +
    + +
    +
    +
    +
    + ${tags} +
    -
    + + + + \ No newline at end of file diff --git a/uvote/page/user_main_votelist/user_main_votelist.php b/uvote/page/user_main_votelist/user_main_votelist.php index 8ae82b8..a8f502c 100644 --- a/uvote/page/user_main_votelist/user_main_votelist.php +++ b/uvote/page/user_main_votelist/user_main_votelist.php @@ -4,14 +4,23 @@ class user_main_votelist extends SYSTEM\PAGE\Page { $vars = votes::get_user_count(); return $vars['count']; } - + public static function get_list_tags(){ + $result = ''; + $vars = \SQL\UVOTE_DATA_USER_TAGS::QA(array()); + foreach($vars as $tag){ + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_votelist/tpl/filter.tpl'), $tag); + } + return $result; + } + public static function js(){ + return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_votelist/js/user_main_votelist.js'));} public function html(){ $vars = array(); - $vars['votelist'] = lists::generate_votelist(); + $vars['votelist'] = lists::generate_votelist(''); $vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id='; $vars['user_count'] = $this->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); diff --git a/uvote/sql/qq/UVOTE_DATA_COMMUNITY_TO_PARTIES_OVERALL.php b/uvote/sql/qq/UVOTE_DATA_COMMUNITY_TO_PARTIES_OVERALL.php new file mode 100644 index 0000000..83b0b47 --- /dev/null +++ b/uvote/sql/qq/UVOTE_DATA_COMMUNITY_TO_PARTIES_OVERALL.php @@ -0,0 +1,13 @@ +