new api for analysis

reloadable complete for analysis
This commit is contained in:
Naeltard 2015-10-20 12:57:33 +02:00
parent bd3a7434d2
commit 14d3de26a7
33 changed files with 601 additions and 524 deletions

View File

@ -49,7 +49,15 @@ class api_uvote extends \SYSTEM\API\api_system {
return comments::write_commentrate($c_ID, $val);}
public static function call_load_tab($set, $cat){
return stats_basic::basic($cat);
if($set == 'basic'){
return stats_basic::basic_basic($cat);
}
if($set == 'bilance'){
return stats_bilance::basic_bilance($cat);
}
if($set == 'bilance_choice'){
return stats_bilance_choice::basic_bilance_choice($cat);
}
}
}

View File

@ -1,12 +1,13 @@
<?php
class bars{
public static function get_user_choice_overall($user_ID){
$vars = \SQL\UVOTE_DATA_USER_CHOICE_OVERALL::Q1(array($user_ID));
$vars['user_total_total'] = $vars['user_total_pro'] + $vars['user_total_con'] + $vars['user_total_ent'];
$vars['user_total_pro_percentage'] = $vars['user_total_total'] > 0 ? round($vars['user_total_pro']/$vars['user_total_total']*100) : 0;
$vars['user_total_con_percentage'] = $vars['user_total_total'] > 0 ? round($vars['user_total_con']/$vars['user_total_total']*100) : 0;
$vars['user_total_ent_percentage'] = $vars['user_total_total'] > 0 ? round($vars['user_total_ent']/$vars['user_total_total']*100) : 0;
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/user_total.tpl'),$vars);
$vars['total_total'] = $vars['total_pro'] + $vars['total_con'] + $vars['total_ent'];
$vars['total_pro_percentage'] = $vars['total_total'] > 0 ? round($vars['total_pro']/$vars['total_total']*100) : 0;
$vars['total_con_percentage'] = $vars['total_total'] > 0 ? round($vars['total_con']/$vars['total_total']*100) : 0;
$vars['total_ent_percentage'] = $vars['total_total'] > 0 ? round($vars['total_ent']/$vars['total_total']*100) : 0;
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/user_total.tpl'),$vars);
}
public static function get_uvote_choice_overall(){
$vars = \SQL\UVOTE_DATA_CHOICE_OVERALL::Q1(array());
@ -15,7 +16,7 @@ class bars{
$vars['total_con_percentage'] = round($vars['con']/$vars['total_total']*100+1);
$vars['total_ent_percentage'] = round($vars['ent']/$vars['total_total']*100+1);
new SYSTEM\LOG\INFO($vars['total_ent_percentage']);
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/uvote_total.tpl'),$vars);
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/uvote_total.tpl'),$vars);
}
public static function get_bt_choice_overall(){
$vars = \SQL\UVOTE_DATA_CHOICE_BT_OVERALL::Q1(array());
@ -24,46 +25,36 @@ class bars{
$vars['total_con_percentage'] = round($vars['con']/$vars['total_total']*100+1);
$vars['total_ent_percentage'] = round($vars['ent']/$vars['total_total']*100+1);
new SYSTEM\LOG\INFO($vars['total_ent_percentage']);
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/bt_total.tpl'),$vars);
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/bt_total.tpl'),$vars);
}
public static function get_uvote_choice_overall_to_bt(){
public static function bilance_community(){
$result = '';
$vars = \SQL\UVOTE_DATA_UVOTE_TO_PARTY_OVERALL::QA(array());
foreach($vars as $bar){
$bar['match_percentage'] = round($bar['class_MATCH']/($bar['class_MATCH']+$bar['class_MISSMATCH'])*100,2);
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvoteparties.tpl'), $bar);
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/bars_community.tpl'), $bar);
}
return $result;
}
public static function get_bt_choice_overall_to_bt(){
public static function bilance_bt(){
$result = '';
$vars = \SQL\UVOTE_DATA_BT_TO_PARTY_OVERALL::QA(array());
foreach($vars as $bar){
$bar['match_percentage'] = round($bar['class_MATCH']/($bar['class_MATCH']+$bar['class_MISSMATCH'])*100,2);
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvoteparties.tpl'), $bar);
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/bars_community.tpl'), $bar);
}
return $result;
}
public static function user_per_party_overall(){
//$vars = votes::get_user_per_party_overall(array(\SYSTEM\SECURITY\Security::getUser()->id));
public static function bilance_user(){
$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'] = self::build_according_law_html($res2, $row['party']);
$res = \SQL\UVOTE_DATA_USER_BILANCE::QA(array(\SYSTEM\SECURITY\Security::getUser()->id));
foreach($res as $row){
//$res2 = votes::vote_accord_with_party($row['party']);
//$row['according_laws'] = self::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_analysis/tpl/urvoteparties.tpl'), $row);
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/bars_user.tpl'), $row);
}
return $result;
return $result;
}
public static function build_according_law_html($part, $party){
$part = json_decode($part, true);
@ -74,7 +65,7 @@ class bars{
$result .= "</font><hr><button id='close_popup' type='button' class='btn btn-primary'>schließen</button></div>";
return $result;
}
public static function user_per_party_by_choicetype($choice){
public static function bilance_choice_user_party($choice){
$bar = switchers::bar_class($choice);
$result = '';
$con = new \SYSTEM\DB\Connection();
@ -85,35 +76,19 @@ class bars{
ON uvote_data.poll_ID = uvote_votes_per_party.poll_ID
WHERE user_ID = ? AND uvote_votes_per_party.choice = ? GROUP BY party;',
array(\SYSTEM\SECURITY\Security::getUser()->id, $choice));
$i = 0;
while($row = $res->next()){
$row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2);
$row['bar'] = $bar;
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvoteparties_by_choice.tpl'), $row);;
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance_choice/bars_user.tpl'), $row);;
}
if(empty($result)){
return 'Keine relevanten Daten verfügbar';
}
return $result;
}
public static function user_per_bt_by_choicetype($choice){
switch($choice){
case 1:
$bar = 'progress-bar-success';
$icon_type = 'pro';
break;
case 2:
$bar = 'progress-bar-danger';
$icon_type = 'con';
break;
case 3:
$bar = 'progress-bar-info';
$icon_type = 'ent';
break;
case 0:
$bar = 'progress-bar';
}
public static function bilance_choice_user_bt($choice){
$bar = switchers::bar_class($choice);
$icon_type = switchers::tablerow_class($choice);
$result = '';
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'user_to_party_by_choice_bt',
@ -123,16 +98,14 @@ class bars{
ON uvote_data.poll_ID = uvote_votes.ID
WHERE user_ID = ? AND uvote_votes.bt_choice = ? GROUP by user_ID;',
array(\SYSTEM\SECURITY\Security::getUser()->id, $choice));
$i = 0;
while($row = $res->next()){
if(empty($row['class_MATCH'])){
return 'Keine relevanten Daten verfügbar <br>';
return 'Keine relevanten Daten verfügbar <br><br>';
}
$row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2);
$row['bar'] = $bar;
$row['icon_type'] = $icon_type;
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvotebt_by_choice.tpl'), $row);;
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance_choice/urvotebt_by_choice.tpl'), $row);;
}
if(empty($result)){
return 'Keine relevanten Daten verfügbar<br><br>';
@ -140,28 +113,20 @@ class bars{
return $result;
}
public static 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'] = ($row['class_MATCH']+$row['class_MISSMATCH']) > 0 ? round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2) : 0;
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/bt_to_user_overall.tpl'), $row);
}
public static function bilance_user_bt(){
$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'] = ($row['class_MATCH']+$row['class_MISSMATCH']) > 0 ? round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2) : 0;
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/bars_user_bt.tpl'), $row);
}
return $result;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
}

View File

@ -1,6 +1,6 @@
<?php
class stats_basic {
public static function basic($cat){
public static function basic_basic($cat){
if($cat == 'user'){
return self::user_basic();
}
@ -10,7 +10,7 @@ class stats_basic {
if($cat == 'bt'){
return self::bt_basic();
}
else {return 'error';}
else {return 'error';}
}
public static function user_basic(){
$vars['basic_stats'] = bars::get_user_choice_overall(\SYSTEM\SECURITY\Security::getUser()->id);

View File

@ -0,0 +1,46 @@
<?php
class stats_bilance {
public static function basic_bilance($cat){
if($cat == 'user'){return self::user_bilance();}
if($cat == 'user_bt'){return self::user_bt_bilance();}
if($cat == 'community'){ return self::community_bilance();}
if($cat == 'bt'){return self::bt_bilance();}
else {return 'error';}
}
public static function user_bilance(){
$vars = array();
$vars['bilance_user'] = bars::bilance_user();
$vars['analysis_help_user_to_party_overall'] = \SYSTEM\PAGE\text::get('analysis_help_user_to_party_overall');
$vars['analysis_math_user_to_party_overall'] = \SYSTEM\PAGE\text::get('analysis_math_user_to_party_overall');
$vars['analysis_help_party_donut'] = \SYSTEM\PAGE\text::get('analysis_help_party_donut');
$vars['analysis_math_party_donut'] = \SYSTEM\PAGE\text::get('analysis_math_party_donut');
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/tab_bilance_user.tpl'),$vars);
}
public static function user_bt_bilance(){
$vars = array();
$vars['bilance_user_bt'] = bars::bilance_user_bt();
$vars['analysis_help_bt'] = \SYSTEM\PAGE\text::get('analysis_help_bt');
$vars['analysis_math_bt'] = \SYSTEM\PAGE\text::get('analysis_math_bt');
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/tab_bilance_user_bt.tpl'),$vars);
}
public static function community_bilance(){
$vars = array();
$vars['analysis_help_community_to_fr'] = \SYSTEM\PAGE\text::get('analysis_help_community_to_fr');
$vars['analysis_math_community_to_fr'] = \SYSTEM\PAGE\text::get('analysis_math_community_to_fr');
$vars['bilance_community'] = bars::bilance_community();
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/tab_bilance_community.tpl'),$vars);
}
public static function bt_bilance(){
$vars = array();
$vars['analysis_help_choices_bt'] = \SYSTEM\PAGE\text::get('analysis_help_choices_bt');
$vars['analysis_math_choices_bt'] = \SYSTEM\PAGE\text::get('analysis_math_choices_bt');
$vars['bilance_bt'] = bars::bilance_bt();
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance/tab_bilance_bt.tpl'),$vars);
}
}

View File

@ -0,0 +1,34 @@
<?php
class stats_bilance_choice {
public static function basic_bilance_choice($cat){
if($cat == 'user_party'){
return self::user_party_bilance_choice();
}
if($cat == 'user_bt'){
return self::user_bt_bilance_choice();
}
}
public static function user_party_bilance_choice(){
$vars['choices_user_ID_per_party_pro'] = bars::bilance_choice_user_party('1');
$vars['choices_user_ID_per_party_con'] = bars::bilance_choice_user_party('2');
$vars['choices_user_ID_per_party_ent'] = bars::bilance_choice_user_party('3');
$vars['analysis_help_uservera_to_party_pro'] = \SYSTEM\PAGE\text::get('analysis_help_uservera_to_party_pro');
$vars['analysis_math_uservera_to_party_pro'] = \SYSTEM\PAGE\text::get('analysis_math_uservera_to_party_pro');
$vars['analysis_help_uservera_to_party_con'] = \SYSTEM\PAGE\text::get('analysis_help_uservera_to_party_con');
$vars['analysis_math_uservera_to_party_con'] = \SYSTEM\PAGE\text::get('analysis_math_uservera_to_party_con');
$vars['analysis_help_uservera_to_party_ent'] = \SYSTEM\PAGE\text::get('analysis_help_uservera_to_party_ent');
$vars['analysis_math_uservera_to_party_ent'] = \SYSTEM\PAGE\text::get('analysis_math_uservera_to_party_ent');
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_party.tpl'),$vars);
}
public static function user_bt_bilance_choice(){
$vars['choices_user_ID_per_bt_pro'] = bars::bilance_choice_user_bt('1');
$vars['choices_user_ID_per_bt_con'] = bars::bilance_choice_user_bt('2');
$vars['choices_user_ID_per_bt_ent'] = bars::bilance_choice_user_bt('3');
$vars['analysis_help_bt_by_vote'] = \SYSTEM\PAGE\text::get('analysis_help_bt_by_vote');
$vars['$analysis_math_bt_by_vote'] = \SYSTEM\PAGE\text::get('$analysis_math_bt_by_vote');
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_bilance_choice/tab_bilance_choice_user_bt.tpl'),$vars);
}
}

View File

@ -74,6 +74,24 @@ class switchers{
return 'progress-bar';
}
}
public static function bar_ico_class($choice){
switch($choice){
case 1:
$bar = 'progress-bar-success';
$icon_type = 'pro';
break;
case 2:
$bar = 'progress-bar-danger';
$icon_type = 'con';
break;
case 3:
$bar = 'progress-bar-info';
$icon_type = 'ent';
break;
case 0:
$bar = 'progress-bar';
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.

View File

@ -79,7 +79,7 @@ class votes {
$vars = \SQL\UVOTE_DATA_TEMP_VOTES::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->id));
$v = $vars['voted'];
$nv = $vars['not_voted'];
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/all_polls.tpl'),
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/temp_votes.tpl'),
array( 'vote_percent'=> $v > 0 ? round($v/($nv+$v)*100, 2) : 0,
'no_vote_percent'=> $nv > 0 ? round($nv/($nv+$v)*100, 2) : 0,
'voted'=> $v,
@ -89,7 +89,7 @@ class votes {
$vars = \SQL\UVOTE_DATA_OVERALL_VOTES::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->creationDate));
$v = $vars['voted'];
$nv = $vars['not_voted'];
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/overall_all_polls.tpl'),
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/overall_votes.tpl'),
array( 'vote_perc'=> $v > 0 ? round($v/($nv+$v)*100, 2) : 0,
'no_vote_perc'=> $v > 0 ? round($nv/($nv+$v)*100, 2) : 0,
'voted'=> $v,
@ -121,7 +121,8 @@ class votes {
$user = \SYSTEM\SECURITY\Security::getUser()->id;
$data = \SQL\UVOTE_ACCORD_WITH_FRACTION::QA(array($party,$user));
//$data_escaped = array_walk_recursive($data, 'mysql_real_escape_string');
return \SYSTEM\LOG\JsonResult::toString($data);
//return \SYSTEM\LOG\JsonResult::toString($data);
return json.encode($data);
}
public static function get_users_choice_per_poll($poll_ID){
return \SQL\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));}
@ -139,8 +140,6 @@ class votes {
return $res;
}
public static function get_barsperparty($poll_ID){
return \SQL\UVOTE_DATA_PARTY_PER_POLL::QA(array($poll_ID));}
public static function get_party_choice($poll_ID, $party){
$res = \SQL\UVOTE_DATA_PARTY_CHOICE_PER_POLL::Q1(array($poll_ID, $party));

View File

@ -2,14 +2,13 @@ function init_user_main_analysis(){
$('.acc_toggle').click(function(){
$(this).find('i').toggleClass('glyphicon-circle-arrow-down').toggleClass('glyphicon-circle-arrow-up');
});
load_visualisation_urvote('graph_user_to_party_overall_bt', 84600);
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);
load_visualisation_user_to_parties_overall('donut_user_to_party_overall', 84600);
/* -------- 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';
@ -28,11 +27,70 @@ $('#a_acc_10').click(function () {
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_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(e){
e.preventDefault();
$(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);}
});
}
@ -90,7 +148,10 @@ function load_visualisation_urvote(id, timespan){
var options = {title: 'Übereinstimmung mit dem Bundestag',
aggregationTarget: 'category',
selectionMode: 'multiple',
legend: 'none',
legend: 'none',
animation:{
duration: 1000,
easing: 'out',},
chartArea:{},
// vAxis:{logScale: false},
vAxis: {viewWindow: {min: 0, max: 100}},

View File

@ -1,6 +1,5 @@
<div class="row">
<div class="col-md-8">
<h4></h4>
<div class="col-md-8">
${basic_stats_bt}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">

View File

@ -1,28 +1,27 @@
<div class="row">
<div class="col-md-8">
${basic_stats}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left:#d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_basic_stats}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_basic_stats}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<div>${user_temp_votes}</div>
<br>
<div>${user_overall_votes}</div>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_basic_votes}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_basic votes}
</div>
</div>
<div class="row">
<div class="col-md-8">
${basic_stats}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_basic_stats}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_basic_stats}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<div>${user_temp_votes}</div>
<br>
<div>${user_overall_votes}</div>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_basic_votes}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_basic votes}
</div>
</div>

View File

@ -12,7 +12,7 @@
<div class="col-md-10">
<font size="1">pro Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: ${user_total_pro_percentage}%">${user_total_pro}</div>
<div class="progress-bar progress-bar-success" style="width: ${total_pro_percentage}%">${total_pro}</div>
</div>
</div>
</div>
@ -24,7 +24,7 @@
<div class="col-md-10">
<font size="1">contra Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-danger" style="width: ${user_total_con_percentage}%">${user_total_con}</div>
<div class="progress-bar progress-bar-danger" style="width: ${total_con_percentage}%">${total_con}</div>
</div>
</div>
</div>
@ -36,7 +36,7 @@
<div class="col-md-10">
<font size="1">Enthaltungen</font>
<div class="progress">
<div class="progress-bar progress-bar-info" style="width: ${user_total_ent_percentage}%">${user_total_ent}</div>
<div class="progress-bar progress-bar-info" style="width: ${total_ent_percentage}%">${total_ent}</div>
</div>
</div>
</div>
@ -46,7 +46,7 @@
</div>
<div class="col-md-10">
<div class="progress">
<div class="progress-bar progress-bar" style="width: 100%">Total: ${user_total_total}</div>
<div class="progress-bar progress-bar" style="width: 100%">Total: ${total_total}</div>
</div>
</div>
</div>

View File

@ -6,21 +6,12 @@
<div class="progress">
<div class="progress-bar" style="width: ${match_percentage}%;"><a style="text-decoration: none; color: white;" class="urvoteparties_uvote_popover" data-content="${according_laws}">${match_percentage}%</a></div>
</div>
</div>
<!--<td><span class="badge badge-success">${class_MATCH}</span></td>
<td><span class="badge badge-important">${class_MISSMATCH}</span></td>
<td><span class="badge">
<a class="urvoteparties_uvote_popover" data-content="${according_laws}">${match_percentage}%</a>
</span>
</td>
</tr>-->
<div class="col-md-1 urvoteparties_uvote_popover" data-content="${according_laws}">
</div>
<div class="col-md-1 urvoteparties_uvote_popover" data-content="${according_laws}">
<span class="glyphicon glyphicon-question-sign"></span>
</div>
</div>
</div>
<script>
$(function (){ $(".urvoteparties_uvote_popover").popover({html: true});
});
$(function (){ $(".urvoteparties_uvote_popover").popover({html: true});});
</script>

View File

@ -6,17 +6,10 @@
<div class="progress">
<div class="progress-bar" style="width: ${match_percentage}%;"><a style="text-decoration: none; color: white;" class="urvoteparties_uvote_popover" data-content="${according_laws}">${match_percentage}%</a></div>
</div>
</div>
<!--<td><span class="badge badge-success">${class_MATCH}</span></td>
<td><span class="badge badge-important">${class_MISSMATCH}</span></td>
<td><span class="badge">
<a class="urvoteparties_uvote_popover" data-content="${according_laws}">${match_percentage}%</a>
</span>
</td>
</tr>-->
<div class="col-md-1 urvoteparties_uvote_popover" data-content="${according_laws}">
<span class="glyphicon glyphicon-question-sign"></span>
</div>
</div>
<div class="col-md-1 urvoteparties_uvote_popover" data-content="${according_laws}">
<span class="glyphicon glyphicon-question-sign"></span>
</div>
</div>
<script>

View File

@ -0,0 +1 @@
${result}

View File

@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-8">
<h4>Übereinstimmung Bundestag und Fraktionen</h4>
${bilance_bt}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_choices_bt}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_choices_bt}
</div>
</div>

View File

@ -0,0 +1,13 @@
<div class="row">
<div class="col-md-8">
<h4>Übereinstimmung community und Fraktionen</h4>
<br>
${bilance_community}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_community_to_fr}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_community_to_fr}
</div>
</div>

View File

@ -0,0 +1,30 @@
<div class="row">
<div class="col-md-8">
<h4>Absolute Übereinstimmungsrate</h4>
<hr>
<font size="1">auf ? clicken für Details</font>
<br>
<br>
${bilance_user}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_user_to_party_overall}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_user_to_party_overall}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<h4>Relative Übereinstimmung</h4>
<hr>
<div id="donut_user_to_party_overall" class="row" style="padding: 0; margin: 0;"></div>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_party_donut}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_party_donut}
</div>
</div>

View File

@ -0,0 +1,12 @@
<div class="row" style="padding-bottom: 20px; padding-top: 20px;">
<div class="col-md-8">
Bundestag gesamt
${bilance_user_bt}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_bt}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_bt}
</div>
</div>

View File

@ -0,0 +1,15 @@
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
Übereinstimmung mit dem Bundestag
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
${choices_user_ID_per_bt_pro}
${choices_user_ID_per_bt_con}
${choices_user_ID_per_bt_ent}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_bt_by_vote}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_bt_by_vote}
</div>
</div>

View File

@ -0,0 +1,37 @@
<div class="row">
<div class="col-md-8">
<img class="img-responsive" src="${frontend_logos}icon_urn_pro.png"/>
<h5>Übereinstimmung der pro Stimmen</h5>
${choices_user_ID_per_party_pro}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_uservera_to_party_pro}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_uservera_to_party_pro}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<img class="img-responsive" src="${frontend_logos}icon_urn_con.png"/>
<h5>Übereinstimmung der contra Stimmen</h5>
${choices_user_ID_per_party_con}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_uservera_to_party_con}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<img class="img-responsive" src="${frontend_logos}icon_urn_ent.png"/>
<h5>Übereinstimmung der Enthaltungen</h5>
${choices_user_ID_per_party_ent}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_uservera_to_party_ent}
</div>
</div>

View File

@ -19,361 +19,230 @@
</div>
</div>
</div>
<div class="row">
<h3>Deine Statistik</h3>
</div>
<div class="panel-group row" id="acc_2" style="">
<div class="panel panel-default panel-success">
<div class="panel-heading" style="padding: 0" >
<a id="a_acc_2" class="acc_toggle" data-toggle="collapse" data-parent="#acc_2" href="#acc_2_body">
<div class="row">
<h3>Deine Statistik</h3>
</div>
<div class="panel-group row" id="acc_2" style="">
<div class="panel panel-default panel-success">
<div class="panel-heading" style="padding: 0" >
<a id="a_acc_2" class="acc_toggle" data-toggle="collapse" data-parent="#acc_2" href="#acc_2_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;&nbsp;Deine Daten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
<h4 class="panel-title">
<span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;&nbsp;Deine Daten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_2_body" class="row panel-body panel-collapse collapse">
</div>
</a>
</div>
<div id="acc_2_body" class="row panel-body panel-collapse collapse"></div>
</div>
<div class="panel-group row" id="acc_3" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_3" href="#acc_3_body">
</div>
<div class="panel-group row" id="acc_3" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_3" class="acc_toggle" data-toggle="collapse" data-parent="#acc_3" href="#acc_3_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;Bilanz: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
<h4 class="panel-title">
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;Bilanz: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_3_body" class="row panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-8">
<h4>Absolute Übereinstimmungsrate</h4>
</a>
</div>
<div id="acc_3_body" class="row panel-body panel-collapse collapse"></div>
</div>
</div>
<div class="panel-group row" id="acc_4" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_4" class="acc_toggle" data-toggle="collapse" data-parent="#acc_4" href="#acc_4_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th"></span>&nbsp;&nbsp;&nbsp;Bilanz: Fraktionen nach Stimmverhalten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_4_body" class="row panel-collapse collapse panel-body" style="padding-top: 20px;"></div>
</div>
</div>
<div class="row panel-group" id="acc_5" style="padding-top: 10px;">
<div class="panel panel-default panel-danger">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_5" class="acc_toggle" data-toggle="collapse" data-parent="#acc_5" href="#acc_5_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-random"></span>&nbsp;&nbsp;&nbsp;Entwicklung: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_5_body" class="panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-9">
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_cdu.png"/>
</div>
<div id="graph_user_to_party_overall_cdu" class="row"></div>
<hr>
<font size="1">auf ? clicken für Details</font>
<br>
<br>
${choices_user_ID}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_user_to_party_overall}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_user_to_party_overall}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<h4>Relative Übereinstimmung</h4>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_csu.png"/>
</div>
<div id="graph_user_to_party_overall_csu" class="row"></div>
<hr>
<div id="donut_user_to_party_overall" class="row" style="padding: 0; margin: 0;"></div>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_party_donut}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_party_donut}
</div>
</div>
</div>
</div>
</div>
<div class="panel-group row" id="acc_4" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_4" href="#acc_4_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th"></span>&nbsp;&nbsp;&nbsp;Bilanz: Fraktionen nach Stimmverhalten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_4_body" class="row panel-collapse collapse panel-body" style="padding-top: 20px;">
<div class="row">
<div class="col-md-8">
<img class="img-responsive" src="${frontend_logos}icon_urn_pro.png"/>
<h5>Übereinstimmung der pro Stimmen</h5>
${choices_user_ID_per_party_pro}
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_spd.png"/>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_uservera_to_party_pro}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_uservera_to_party_pro}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<img class="img-responsive" src="${frontend_logos}icon_urn_con.png"/>
<h5>Übereinstimmung der contra Stimmen</h5>
${choices_user_ID_per_party_con}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_uservera_to_party_con}
</div>
</div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
<img class="img-responsive" src="${frontend_logos}icon_urn_ent.png"/>
<h5>Übereinstimmung der Enthaltungen</h5>
${choices_user_ID_per_party_ent}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_uservera_to_party_ent}
</div>
</div>
</div>
</div>
</div>
<div class="row panel-group" id="acc_5" style="padding-top: 10px;">
<div class="panel panel-default panel-danger">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_5" href="#acc_5_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-random"></span>&nbsp;&nbsp;&nbsp;Entwicklung: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_5_body" class="panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-9">
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_cdu.png"/>
</div>
<div id="graph_user_to_party_overall_cdu" class="row"></div>
<hr>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_csu.png"/>
</div>
<div id="graph_user_to_party_overall_csu" class="row"></div>
<hr>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_spd.png"/>
</div>
<div id="graph_user_to_party_overall_spd" class="row"></div>
<hr>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_gruene.png"/>
</div>
<div id="graph_user_to_party_overall_gruene" class="row"></div>
<hr>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_linke.png"/>
</div>
<div id="graph_user_to_party_overall_linke" class="row"></div>
</div>
<div class="col-md-3" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_overtime_party}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_overtime_party}
</div>
</div>
</div>
</div>
</div>
<div class="panel-group row" id="acc_6" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_6" href="#acc_6_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;Bilanz: Bundestag
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_6_body" class="row panel-body panel-collapse collapse">
<div class="row" style="padding-bottom: 20px; padding-top: 20px;">
<div class="col-md-8">
Bundestag gesamt
${choices_bt_to_user}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_bt}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_bt}
</div>
</div>
<div id="graph_user_to_party_overall_spd" class="row"></div>
<hr>
<div class="row" style="padding-top: 20px;">
<div class="col-md-8">
Übereinstimmung mit dem Bundestag
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
${choices_user_ID_per_bt_pro}
${choices_user_ID_per_bt_con}
${choices_user_ID_per_bt_ent}
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_bt_by_vote}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_bt_by_vote}
</div>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_gruene.png"/>
</div>
</div>
</div>
</div>
<div class="row panel-group" id="acc_7" style="padding-top: 10px;">
<div class="panel panel-default panel-danger">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_7" href="#acc_7_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-random"></span>&nbsp;&nbsp;&nbsp;Entwicklung: Bundestag
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
<div id="graph_user_to_party_overall_gruene" class="row"></div>
<hr>
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_linke.png"/>
</div>
<div id="graph_user_to_party_overall_linke" class="row"></div>
</div>
</a>
</div>
<div id="acc_7_body" class="panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-9">
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
</div>
<div id="graph_user_to_party_overall_bt" class="row"></div>
</div>
<div class="col-md-3" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_overtime_bt}
${analysis_help_overtime_party}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_overtime_bt}
${analysis_math_overtime_party}
</div>
</div>
</div>
</div>
</div>
<div class="panel-group row" id="acc_6" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_6" class="acc_toggle" data-toggle="collapse" data-parent="#acc_6" href="#acc_6_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;Bilanz: Bundestag
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_6_body" class="row panel-body panel-collapse collapse"></div>
</div>
</div>
<div class="panel-group row" id="acc_12" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_12" class="acc_toggle" data-toggle="collapse" data-parent="#acc_12" href="#acc_12_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-th"></span>&nbsp;&nbsp;&nbsp;Bilanz: Bundestag nach Stimmverhalten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_12_body" class="row panel-body panel-collapse collapse"></div>
</div>
</div>
<div class="row panel-group" id="acc_7" style="padding-top: 10px;">
<div class="panel panel-default panel-danger">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_7" class="acc_toggle" data-toggle="collapse" data-parent="#acc_7" href="#acc_7_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-random"></span>&nbsp;&nbsp;&nbsp;Entwicklung: Bundestag
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_7_body" class="panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-9">
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
</div>
<div id="graph_user_to_party_overall_bt" class="row"></div>
</div>
<div class="col-md-3" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_overtime_bt}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_overtime_bt}
</div>
<hr>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<h3>community Statistik</h3>
</div>
<div class="row panel-group" id="acc_8" style="padding-top: 10px;">
<div class="panel panel-default panel-success">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_8" class="acc_toggle" data-toggle="collapse" data-parent="#acc_8" href="#acc_8_body">
</div>
<div class="row">
<h3>community Statistik</h3>
</div>
<div class="row panel-group" id="acc_8" style="padding-top: 10px;">
<div class="panel panel-default panel-success">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_8" class="acc_toggle" data-toggle="collapse" data-parent="#acc_8" href="#acc_8_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title" style="">
<span class="glyphicon glyphicon-globe"></span>&nbsp;&nbsp;&nbsp;community Daten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_8_body" class="panel-body panel-collapse collapse">
</div>
<span class="glyphicon glyphicon-globe"></span>&nbsp;&nbsp;&nbsp;community Daten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_8_body" class="panel-body panel-collapse collapse"></div>
</div>
<div class="row panel-group" id="acc_9" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_9" href="#acc_9_body">
</div>
<div class="row panel-group" id="acc_9" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_9" class="acc_toggle" data-toggle="collapse" data-parent="#acc_9" href="#acc_9_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title" style="">
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;community-Bilanz: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_9_body" class="panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-8">
<h4>Übereinstimmung community und Fraktionen</h4>
<br>
${votes_all_to_bt}
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;community-Bilanz: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_community_to_fr}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_community_to_fr}
</div>
</div>
</div>
</a>
</div>
<div id="acc_9_body" class="panel-body panel-collapse collapse"></div>
</div>
<div class="row">
<h3>Bundestag Statistik</h3>
</div>
<div class="row panel-group" id="acc_10" style="padding-top: 10px;">
<div class="panel panel-default panel-success">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_10" class="acc_toggle" data-toggle="collapse" data-parent="#acc_10" href="#acc_10_body">
</div>
<div class="row">
<h3>Bundestag Statistik</h3>
</div>
<div class="row panel-group" id="acc_10" style="padding-top: 10px;">
<div class="panel panel-default panel-success">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_10" class="acc_toggle" data-toggle="collapse" data-parent="#acc_10" href="#acc_10_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title" style="">
<span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;&nbsp;Bundestag Daten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_10_body" class="panel-body panel-collapse collapse">
</div>
<span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;&nbsp;Bundestag Daten
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_10_body" class="panel-body panel-collapse collapse"></div>
</div>
<div class="row panel-group" id="acc_11" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a class="acc_toggle" data-toggle="collapse" data-parent="#acc_11" href="#acc_11_body">
</div>
<div class="row panel-group" id="acc_11" style="padding-top: 10px;">
<div class="panel panel-default panel-warning">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_11" class="acc_toggle" data-toggle="collapse" data-parent="#acc_11" href="#acc_11_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title" style="">
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;Bundestag-Bilanz: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_11_body" class="panel-body panel-collapse collapse">
<div class="row">
<div class="col-md-8">
<h4>Übereinstimmung Bundestag und Fraktionen</h4>
${choices_bt}
<span class="glyphicon glyphicon-th-large"></span>&nbsp;&nbsp;&nbsp;Bundestag-Bilanz: Fraktionen
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
<div class="col-md-4" style="font-size: 10pt; border-left: #d9edf7 solid 2px">
<h4><span class="glyphicon glyphicon-info-sign"></span></h4>
${analysis_help_choices_bt}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_choices_bt}
</div>
</div>
</div>
</a>
</div>
<div id="acc_11_body" class="panel-body panel-collapse collapse">
</div>
</div>
<!--<div id="graph_bt_user_overall" class="row"></div>
<script type="text/javascript" language="JavaScript">load_visualisation_urvote('graph_bt_user_overall',84600);</script>-->
</div>

View File

@ -3,27 +3,12 @@ class user_main_analysis extends SYSTEM\PAGE\Page {
public static function js(){
return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_analysis/js/user_main_analysis.js'));}
public function html(){
$vars = array();
//third panel
$vars['choices_user_ID'] = bars::user_per_party_overall();
//fourth panel
$vars['choices_user_ID_per_party_pro'] = bars::user_per_party_by_choicetype('1');
$vars['choices_user_ID_per_party_con'] = bars::user_per_party_by_choicetype('2');
$vars['choices_user_ID_per_party_ent'] = bars::user_per_party_by_choicetype('3');
//fifth panel
$vars['choices_bt_to_user'] = bars::user_to_bt();
$vars['choices_user_ID_per_bt_pro'] = bars::user_per_bt_by_choicetype('1');
$vars['choices_user_ID_per_bt_con'] = bars::user_per_bt_by_choicetype('2');
$vars['choices_user_ID_per_bt_ent'] = bars::user_per_bt_by_choicetype('3');
$vars['votes_all_to_bt'] = bars::get_uvote_choice_overall_to_bt();
$vars['choices_bt'] = bars::get_bt_choice_overall_to_bt();
$vars = array();
$vars['frontend_logos'] = './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'));
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('help'));
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('math'));
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/user_main_analysis.tpl'),$vars);
}

View File

@ -9,17 +9,13 @@
</h4>
</div>
<div class="panel-body row" id="poll_3_body">
<div class="col-md-12">
<h4 style="word-break: break-all;">${title}</h4>
${openvote_help_text}
${title} abstimmen.
<hr>
${voice_weight}
</div>
<div class="col-md-12">
<h4 style="word-break: break-all;">${title}</h4>
${openvote_help_text}
${title} abstimmen.
<hr>
${voice_weight}
</div>
</div>
</div>
</div>

View File

@ -7,7 +7,7 @@ class user_main_poll extends SYSTEM\PAGE\Page {
private function choice_party (){
$result = '';
$party_votes = votes::get_barsperparty($this->poll_ID);
$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']),
@ -31,18 +31,7 @@ class user_main_poll extends SYSTEM\PAGE\Page {
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/bars_user.tpl'),$bars);
}
private function bars_party(){
$result = "";
$partyvotes = votes::get_barsperparty($this->poll_ID);
foreach($partyvotes as $vote){
$vote['party_yes'] = $vote['votes_pro'] > 0 ? round($vote['votes_pro']/$vote['total']*100,0) : $vote['votes_pro'];
$vote['party_no'] = $vote['votes_contra'] > 0 ? round($vote['votes_contra']/$vote['total']*100,0) : $vote['votes_contra'];
$vote['party_ent'] = $vote['nr_attending'] > 0 ? round(($vote['nr_attending'] - $vote['votes_pro'] - $vote['votes_contra'])/$vote['total']*100,0) : $vote['nr_attending'];
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_parties.tpl'), $vote);
}
return $result;
}
private function bars_bt(){
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
@ -102,20 +91,13 @@ class user_main_poll extends SYSTEM\PAGE\Page {
}
public static function js(){
return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_poll/js/user_main_poll.js'));}
private function css(){
return \SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_bulletin\css\bars_user.css')).
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_bulletin\css\bulletin.css')).
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_bulletin\css\comment.css'));
}
public function html(){
$poll_expired = \SQL\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID));
$user_vote = votes::getUserPollData($this->poll_ID);
$vars = array();
$vars = array_merge($vars,votes::get_voteinfo($this->poll_ID));
//$vars['comments_pro'] = $this->get_pro_comments();
//$vars['comments_con'] = $this->get_con_comments();
$vars['choice_party'] = $this->choice_party();
$vars['bars_party'] = $this->bars_party();
$vars['bars_user'] = $this->bars_user();
$vars['bars_bt'] = $this->bars_bt();
$vars['voice_weight'] = $this->voice_weight();

View File

@ -0,0 +1,12 @@
<?php
namespace SQL;
class UVOTE_DATA_USER_BILANCE extends \SYSTEM\DB\QP {
public static function get_class(){return \get_class();}
public static function mysql(){return
'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;'
;}}

View File

@ -4,8 +4,8 @@ namespace SQL;
class UVOTE_DATA_USER_CHOICE_OVERALL extends \SYSTEM\DB\QP {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT SUM(IF(choice = "1",1,0)) AS user_total_pro,
SUM(IF(choice = "2",1,0)) AS user_total_con,
SUM(IF(choice = "3",1,0)) AS user_total_ent
'SELECT SUM(IF(choice = "1",1,0)) AS total_pro,
SUM(IF(choice = "2",1,0)) AS total_con,
SUM(IF(choice = "3",1,0)) AS total_ent
FROM `uvote_data` WHERE `user_ID` = ?;'
;}}