Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ulf Gebhardt 2015-10-24 22:12:13 +02:00
commit 626f33be06
183 changed files with 3467 additions and 1934 deletions

View File

@ -4,7 +4,8 @@ class api_uvote extends \SYSTEM\API\api_system {
//votes
public static function call_vote_action_vote($poll_ID, $vote) {
return votes::write_vote($poll_ID, $vote);}
public static function call_vote_action_vote_sub($poll_ID, $vote) {
return votes::write_vote_sub($poll_ID, $vote);}
public static function call_vote_action_data($location, $birthyear, $gender, $children) {
return votes::write_data($location, $birthyear, $gender, $children);}
@ -23,16 +24,50 @@ class api_uvote extends \SYSTEM\API\api_system {
return votes::vote_accord_with_party($party);}
//graphs
public static function call_graph_bt_to_uvote_overall_by_time($timespan = 84600){
public static function call_graph_bt_to_uvote_overall_by_time($timespan = 592200){
return graphs::graph_bt_to_uvote_overall_by_time($timespan);}
public static function call_graph_bt_to_user_overall_by_time($timespan = 84600){
public static function call_graph_bt_to_user_overall_by_time($timespan = 592200){
return graphs::graph_bt_to_user_overall_by_time($timespan);}
public static function call_graph_party_to_user_overall_by_time_party_cdu($party = 'cdu', $timespan = 592200){
return graphs::graph_party_to_user_overall_by_time($party, $timespan);}
public static function call_graph_party_to_user_overall_by_time_party_csu($party = 'csu', $timespan = 592200){
return graphs::graph_party_to_user_overall_by_time($party, $timespan);}
public static function call_graph_party_to_user_overall_by_time_party_spd($party = 'spd', $timespan = 592200){
return graphs::graph_party_to_user_overall_by_time($party, $timespan);}
public static function call_graph_party_to_user_overall_by_time_party_gruene($party = 'gruene', $timespan = 592200){
return graphs::graph_party_to_user_overall_by_time($party, $timespan);}
public static function call_graph_party_to_user_overall_by_time_party_linke($party = 'linke', $timespan = 592200){
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();}
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);}
public static function call_vote_action_commentrate($c_ID, $val) {
return comments::write_commentrate($c_ID, $val);}
public static function call_load_tab($set, $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);
}
}
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);
}
}

132
uvote/api/votes/bars.php Normal file
View File

@ -0,0 +1,132 @@
<?php
class bars{
public static function get_user_choice_overall($user_ID){
$vars = \SQL\UVOTE_DATA_USER_CHOICE_OVERALL::Q1(array($user_ID));
$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());
$vars['total_total'] = $vars['pro'] + $vars['con'] + $vars['ent'];
$vars['total_pro_percentage'] = round($vars['pro']/$vars['total_total']*100+1);
$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/tab_basic/uvote_total.tpl'),$vars);
}
public static function get_bt_choice_overall(){
$vars = \SQL\UVOTE_DATA_CHOICE_BT_OVERALL::Q1(array());
$vars['total_total'] = $vars['pro'] + $vars['con'] + $vars['ent'];
$vars['total_pro_percentage'] = round($vars['pro']/$vars['total_total']*100+1);
$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/tab_basic/bt_total.tpl'),$vars);
}
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/tab_bilance/bars_community.tpl'), $bar);
}
return $result;
}
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/tab_bilance/bars_community.tpl'), $bar);
}
return $result;
}
public static function bilance_user(){
$result = '';
$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/tab_bilance/bars_user.tpl'), $row);
}
return $result;
}
public static function build_according_law_html($part, $party){
$part = json_decode($part, true);
$result = "<div class='row' style='overflow-x: scroll; overflow-y: hide; max-width: 600px; max-height: 600px;'><font color='black'><h6><i>Bei folgenden Gesetzen hast du genauso abgestimmt wie die ".$party.":</i></h6><hr>";
foreach ($part['result'] as $p){
$result .= $p['title']."<hr>";
}
$result .= "</font><hr><button id='close_popup' type='button' class='btn btn-primary'>schließen</button></div>";
return $result;
}
public static function bilance_choice_user_party($choice){
$bar = switchers::bar_class($choice);
$result = '';
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'user_to_party_by_choice',
'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 = ? AND uvote_votes_per_party.choice = ? GROUP BY party;',
array(\SYSTEM\SECURITY\Security::getUser()->id, $choice));
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/tab_bilance_choice/bars_user.tpl'), $row);;
}
if(empty($result)){
return 'Keine relevanten Daten verfügbar';
}
return $result;
}
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',
'SELECT user_ID, 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 INNER JOIN uvote_votes
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));
while($row = $res->next()){
if(empty($row['class_MATCH'])){
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/tab_bilance_choice/urvotebt_by_choice.tpl'), $row);;
}
if(empty($result)){
return 'Keine relevanten Daten verfügbar<br><br>';
}
return $result;
}
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;
}
}

View File

@ -16,10 +16,51 @@ class graphs {
public static function graph_bt_to_user_overall_by_time ($timespan = 84600,$returnasjson = true){
$result = array();
$res = \SQL\UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME::QQ(array($timespan, \SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->id));
$matchhandler = 0;
$missmatchhandler = 0;
while ($row = $res->next()){
$match = $row['class_match']+$matchhandler;
$missmatch = $row['class_mismatch']+$missmatchhandler;
$result[] = array( 0 => $row['day'],
'class_match' => $row['class_match'] / ($row['class_match']+$row['class_mismatch']+1),
'class_mismatch' => $row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']+1));
'class_match' => ($match) / ($match+$missmatch)*100);
$matchhandler = $match;
$missmatchhandler = $missmatch;
}
return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result;
}
public static function graph_party_to_user_overall_by_time ($party, $timespan, $returnasjson = true){
$result = array();
$res = \SQL\UVOTE_DATA_GRAPH_PARTY_TO_USER_OVERALL_BY_TIME::QQ(array($timespan, \SYSTEM\SECURITY\Security::getUser()->id, $party, \SYSTEM\SECURITY\Security::getUser()->id));
$total = \SQL\UVOTE_DATA_GRAPH_PARTY_TO_USER_OVERALL_BY_TIME_OVERMATCH::Q1(array($party, \SYSTEM\SECURITY\Security::getUser()->id));
$matchhandler = 0;
$missmatchhandler = 0;
while ($row = $res->next()){
$match = $row['class_match']+$matchhandler;
$missmatch = $row['class_mismatch']+$missmatchhandler;
$result[] = array( 0 => $row['day'],
'class_match' => ($match) / ($match+$missmatch)*100);
$matchhandler = $match;
$missmatchhandler = $missmatch;
}
return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result;
}
public static function donut_party_to_user_overall ($returnasjson = true){
$result = array();
$res = \SQL\UVOTE_DATA_USER_TO_PARTIES_OVERALL::QQ(array(\SYSTEM\SECURITY\Security::getUser()->id));
while ($row = $res->next()){
$result[] = array( 0 => $row['party'],
'class_match' => $row['class_MATCH']);
}
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;
}

78
uvote/api/votes/lists.php Normal file
View File

@ -0,0 +1,78 @@
<?php
class lists{
public static function generate_votelist($filter){
$result = array('','');
if(!$filter){
$votes = votes::getAllVotesOfGroup(1);
}
else{
$votes = \SQL\UVOTE_GENERATE_VOTELIST_FILTERED::QA(array(1, $filter));
}
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);
} 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);
} 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];
}
}
/*
* 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

@ -0,0 +1,41 @@
<?php
class stats_basic {
public static function basic_basic($cat){
if($cat == 'user'){
return self::user_basic();
}
if($cat == 'community'){
return self::community_basic();
}
if($cat == 'bt'){
return self::bt_basic();
}
else {return 'error';}
}
public static function user_basic(){
$vars['basic_stats'] = bars::get_user_choice_overall(\SYSTEM\SECURITY\Security::getUser()->id);
$vars['user_temp_votes'] = votes::get_user_temp_votes();
$vars['user_overall_votes'] = votes::get_user_overall_votes();
$vars['analysis_help_basic_stats'] = \SYSTEM\PAGE\text::get('analysis_help_basic_stats');
$vars['analysis_math_basic_stats'] = \SYSTEM\PAGE\text::get('analysis_math_basic_stats');
$vars['analysis_help_basic_votes'] = \SYSTEM\PAGE\text::get('analysis_help_basic_votes');
$vars['analysis_math_basic_votes'] = \SYSTEM\PAGE\text::get('analysis_math_basic_votes');
$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_basic/tab_basic_user.tpl'),$vars);
}
public static function community_basic(){
$vars['basic_stats_community'] = bars::get_uvote_choice_overall();
$vars['analysis_help_community'] = \SYSTEM\PAGE\text::get('analysis_help_community');
$vars['analysis_math_community'] = \SYSTEM\PAGE\text::get('analysis_math_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_basic/tab_basic_community.tpl'),$vars);
}
public static function bt_basic(){
$vars['basic_stats_bt'] = bars::get_bt_choice_overall();
$vars['analysis_help_bt_basic'] = \SYSTEM\PAGE\text::get('analysis_help_bt_basic');
$vars['analysis_math_bt_basic'] = \SYSTEM\PAGE\text::get('analysis_math_bt_basic');
$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_basic/tab_basic_bt.tpl'),$vars);
}
}

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

@ -0,0 +1,101 @@
<?php
class switchers{
public static function get_party_per_poll($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'con';
case 3:
return 'ent';
default:
return 'none';
}
}
public static function tablerow_class($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'con';
case 3:
return 'ent';
default:
return 'open';
}
}
public static function tablerow_class_full($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'contra';
case 3:
return 'enthaltung';
default:
return '';
}
}
public static function badge_class($choice){
switch($choice){
case 1:
return 'badge-success';
case 2:
return 'badge-danger';
case 3:
return 'badge-info';
default:
return '';
}
}
public static function panel_class($choice){
switch($choice){
case 1:
return 'panel-success';
case 2:
return 'panel-danger';
case 3:
return 'panel-info';
default:
return 'panel-default';
}
}
public static function bar_class($choice){
switch($choice){
case 1:
return 'progress-bar-success';
case 2:
return 'progress-bar-danger';
case 3:
return 'progress-bar-info';
case 0:
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.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

View File

@ -11,6 +11,8 @@ class votes {
$res = \SQL\UVOTE_DATA_COUNT_VOTES::QQ();
return $res;}
public static function get_user_choice_per_poll($poll_ID, $user_ID){
return \SQL\UVOTE_DATA_USER_CHOICE_PER_POLL::Q1(array($poll_ID, $user_ID));
}
@ -18,16 +20,26 @@ class votes {
public static function getUserPollData($poll_ID){
if (!\SYSTEM\SECURITY\Security::isLoggedIn()){
return NULL;}
$con = new \SYSTEM\DB\Connection(new \SQL\uVote());
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'selVoteByGrp',
'SELECT * FROM `uvote_data` WHERE `user_ID` = ? AND poll_ID = ?;',
'SELECT * FROM `uvote_data` WHERE `user_ID` = ? AND poll_ID = ? AND uvote_data.group = 1;',
array(\SYSTEM\SECURITY\Security::getUser()->id,$poll_ID));
$result = $res->next();
return $result['choice'];
}
public static function getUserPollDataSub($poll_ID){
if (!\SYSTEM\SECURITY\Security::isLoggedIn()){
return NULL;}
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'selVoteByGrp',
'SELECT * FROM `uvote_data` WHERE `user_ID` = ? AND poll_ID = ? AND uvote_data.group = 2;',
array(\SYSTEM\SECURITY\Security::getUser()->id,$poll_ID));
$result = $res->next();
return $result['choice'];
}
public static function get_barsperusers($poll_ID,$return_as_json = true){
$con = new \SYSTEM\DB\Connection(new \SQL\uVote());
$con = new \SYSTEM\DB\Connection();
//count
$res = $con->prepare( 'selVoteBy_count',
'SELECT COUNT(*) as "count" FROM `uvote_data` WHERE `poll_ID` = ?;',
@ -72,11 +84,25 @@ class votes {
return $res;
}
public static function get_user_temp_votes($user_ID){
return \SQL\UVOTE_DATA_TEMP_VOTES::Q1(array($user_ID, $user_ID, $user_ID));}
public static function get_user_temp_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/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,
'not_voted'=> $nv));}
public static function get_user_overall_votes($user_ID, $creationDate){
return \SQL\UVOTE_DATA_OVERALL_VOTES::Q1(array($user_ID, $user_ID, $user_ID, $creationDate));}
public static function get_user_overall_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/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,
'not_voted'=> $nv));}
public static function get_bar_bt_per_poll($poll_ID){
return \SQL\UVOTE_DATA_BT_PER_POLL::Q1(array($poll_ID));}
@ -104,7 +130,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));}
@ -113,17 +140,33 @@ class votes {
return \SQL\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));}
public static function get_voteinfo($poll_ID){
$con = new \SYSTEM\DB\Connection(new \SQL\uVote());
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'selVoteByID',
'SELECT * FROM `uvote_votes` WHERE `ID` = ?;',
'SELECT * FROM `uvote_votes` WHERE `ID` = ? AND uvote_votes.group = 1;',
array($poll_ID));
$res = $res->next();
// $res['title'] = utf8_encode($res['title']);
return $res;
}
public static function get_sublinks($poll_ID){
$result = '';
$res = \SQL\UVOTE_DATA_POLL_INITIATIVE::QA(array($poll_ID));
foreach ($res as $row){
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/buttons/sub_button.tpl'), $row);
}
// $res['title'] = utf8_encode($res['title']);
return $result;
}
public static function get_voteinfo_sub($poll_ID){
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'selVoteByIDSub',
'SELECT * FROM `uvote_votes` WHERE `ID` = ? AND uvote_votes.group = 2;',
array($poll_ID));
$res = $res->next();
// $res['title'] = utf8_encode($res['title']);
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));
@ -131,19 +174,24 @@ class votes {
}
public static function write_vote($poll_ID, $vote){
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
throw new ERROR("You need to be logged in.");}
$con = new \SYSTEM\DB\Connection(new \SQL\uVote());
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'selVote',
'SELECT * FROM `uvote_votes` WHERE `ID` = ? AND time_end < CURDATE();',
array($poll_ID));
if ($res->next()){
throw new ERROR('Your rights have expired!');}
'SELECT * FROM `uvote_votes` WHERE `ID` = ?;',
array($poll_ID));
$res = $con->prepare( 'insertVote',
'REPLACE uvote_data
VALUES (?, ?, ?, 0, NOW());',
VALUES (?, ?, ?, 1, NOW());',
array($poll_ID, \SYSTEM\SECURITY\Security::getUser()->id, $vote));
return JsonResult::ok();
}
public static function write_vote_sub($poll_ID, $vote){
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'selVote',
'SELECT * FROM `uvote_votes` WHERE `ID` = ?;',
array($poll_ID));
$res = $con->prepare( 'insertVote',
'REPLACE uvote_data
VALUES (?, ?, ?, 2, NOW());',
array($poll_ID, \SYSTEM\SECURITY\Security::getUser()->id, $vote));
return JsonResult::ok();
}
@ -162,7 +210,7 @@ class votes {
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
throw new ERROR("You need to be logged in.");}
$con = new \SYSTEM\DB\Connection(new \SQL\uVote());
$con = new \SYSTEM\DB\Connection();
$res = $con->prepare( 'insertFeedback',
'INSERT INTO uvote_beta_feedback
VALUES (?, ?);',

View File

@ -3,4 +3,5 @@ require_once dirname(__FILE__).'/path/autoload.inc';
require_once dirname(__FILE__).'/page/autoload.inc';
require_once dirname(__FILE__).'/sql/autoload.inc';
require_once dirname(__FILE__).'/files/autoload.inc';
require_once dirname(__FILE__).'/api/autoload.inc';
require_once dirname(__FILE__).'/api/autoload.inc';
require_once dirname(__FILE__).'/sai/autoload.inc';

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -2,13 +2,12 @@
SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_register','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_bulletin','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_comment','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_uVote','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_urVote','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_myVote','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_impressum','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_start','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_votelist','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_analysis','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_options','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_poll','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_list','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_list_active','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_list_ended','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_poll_sub','');

View File

@ -1,4 +0,0 @@
.progress#progress_bars_user {
height: 20px;
width: 350px;
}

View File

@ -1,48 +0,0 @@
#bulletin_main {
float: left;
width: 100%;
}
#bulletin_left {
float: left;
}
#bulletin_sub1 {
margin-top: 30px;
}
#bulletin_sub2 {
float: left;
width: 50%;
padding-top: 30px;
}
#bulletin_sub3 {
float: right;
width: 50%;
padding-top: 30px;
}
#divider {
clear: both;
}
#bulletin_sub4 {
padding-top: 30px;
}
#bulletin_sub5 {
padding-top: 20px;
}
#bulletin_sub5_sub {
float: left;
width: 40%;
}
#bulletin_sub6 {
float: right;
width: 40%;
}
#bulletin_sub7 {
clear: both;
}

View File

@ -1,22 +0,0 @@
#comment_main {
float: left;
width: 90%;
}
#comment_sub1 {
float: left;
font-size: 1;
}
#comment_sub2 {
clear: both;
}
#comment_sub3 {
font-size: 2;
}
#comment_sub4 {
float: right;
font-size: 1;
}

View File

@ -1,241 +0,0 @@
<?php
class default_bulletin extends SYSTEM\PAGE\Page {
private $poll_ID = NULL;
public function __construct($poll_ID) {
$this->poll_ID=$poll_ID;}
public function vote_choice(){
$vars = votes::getUserPollData($this->poll_ID);
return $this->tablerow_class($vars);
}
private static function tablerow_class($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'con';
case 3:
return 'ent';
default:
return 'open';
}
}
private function get_party_per_poll($choice){
switch($choice){
case 1:
return 'PRO';
case 2:
return 'CON';
case 3:
return 'ENT';
default:
return 'NONE';
}
}
private function choice_party (){
$result = '';
$party_votes = votes::get_barsperparty($this->poll_ID);
// $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']);
foreach($party_votes as $pv){
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/vote_bt.tpl'),
array( 'party' => $pv['party'],
'choice' => $this->get_party_per_poll($pv['choice']),
'choice_class' => $this->tablerow_class($pv['choice']),
'party_yes' => $pv['votes_pro'] > 0 ? round($pv['votes_pro']/$pv['total']*100,0) : $pv['votes_pro'],
'party_no' => $pv['votes_contra'] > 0 ? round($pv['votes_contra']/$pv['total']*100,0) : $pv['votes_contra'],
'party_off' => $pv['total'] > 0 ? round(($pv['total'] - $pv['nr_attending'])/$pv['total']*100,0) : $pv['total'],
'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending']));
}
return $result;
}
private function get_pro_comments (){
$result = '';
/*$vars = votes::getUserComments($this->poll_ID, 1);
foreach($vars as $com){
$rating = votes::get_commentrate($com['c_ID'], 1);
$com['count_up'] = $rating['count'];
$rating2 = votes::get_commentrate($com['c_ID'], 2);
$com['count_down'] = $rating2['count'];
// $com['c_txt'] = utf8_encode($com['c_txt']);
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/comment.tpl'), $com);
}*/
return $result;
}
private function get_con_comments (){
$result = '';
/*$vars = votes::getUserComments($this->poll_ID, 2);
foreach($vars as $com){
$rating = votes::get_commentrate($com['c_ID'], 1);
$com['count_up'] = $rating['count'];
$rating2 = votes::get_commentrate($com['c_ID'], 2);
$com['count_down'] = $rating2['count'];
// $com['c_txt'] = utf8_encode($com['c_txt']);
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/comment.tpl'), $com);
}*/
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(),'default_bulletin/tpl/bars_user.tpl'),$bars);
}
private function bars_party(){
$partyvotes = votes::get_barsperparty($this->poll_ID);
$result = "";
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(),'default_bulletin/tpl/table_parties.tpl'), $vote);
}
return $result;
}
private function icons_party(){
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
if (!$vars['bt_total']){
return '';}
$info = array();
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/icons_table_parties.tpl'), $info);
}
private function bars_bt(){
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
if (!$vars['bt_total']){
return 'Keine Ergebnisse für den Bundestag verfügbar';}
$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(),'default_bulletin/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(),'default_bulletin/tpl/voteweight.tpl'), $vars);
}
private function p_fields (){
$result = "";
$list = array (array(1, 'Aussenpolitik'),
array(2, 'Aussenpolitik'),
array(4, 'Aussenpolitik'),
array(8, 'Aussenpolitik'));
foreach($list as $l){
if($p_fields & $l[0]) $result .= $l[1];
}
return $result;
}
private function vote_buttons($poll_expired,$user_poll){
if($poll_expired){
if(!$user_poll){
return '<h5>Stimme hier ab</h5>
<a class="btn btn-success btn-default btnvote_yes"
style="width: 70px"
poll_ID="${poll_ID}"><font
size="3">Pro</font></a>
<a class="btn btn-danger btn-default btnvote_no"
style="width: 70px"
href="#"
poll_ID="${poll_ID}"><font
size="3">Contra</font></a>
<a class="btn btn-info btn-default btnvote_off"
style="width: 70px"
href="#"
poll_ID="${poll_ID}"><font
size="3">Enthaltung</font></a>';}
$classes = array('','','');
switch($user_poll){
case 1: $classes = array('btn-success disabled','btn-danger','btn-info'); break;
case 2: $classes = array('btn-success','btn-danger disabled','btn-info'); break;
case 3: $classes = array('btn-success','btn-danger','btn-info disabled'); break;
default: array('','','');
}
return ' <h5>Ändere deine Stimme hier ab</h5>
<a class="btn '.$classes[0].' btn-default btnvote_yes"
style="width: 70px"
poll_ID="${poll_ID}"><font
size="3">Pro</font></a>
<a class="btn '.$classes[1].' btn-default btnvote_no"
style="width: 70px"
href="#"
poll_ID="${poll_ID}"><font
size="3">Contra</font></a>
<a class="btn '.$classes[2].' btn-default btnvote_off"
style="width: 70px"
href="#"
poll_ID="${poll_ID}"><font
size="3">Enthaltung</font></a>
';
} else {
return 'ye soon to come infos';
}
}
private function js(){
return '<script src="'.SYSTEM\WEBPATH(new PPAGE(),'default_bulletin/js/vote.js').'"></script>';}
private function css(){
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_bulletin\css\bars_user.css').'" rel="stylesheet">'.
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_bulletin\css\bulletin.css').'" rel="stylesheet">'.
'<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_bulletin\css\comment.css').'" rel="stylesheet">';}
public function html(){
$poll_expired = \SQL\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID));
$user_vote = votes::getUserPollData($this->poll_ID);
$vars = array();
$vars['choice_party'] = '';
$vars['voice_weight'] = $vars['bars_user'] = $vars['bars_bt'] = '';
$vars['bars_party'] = '';
$vars['icons_party'] = '';
$vars['vote_class'] = $this->vote_choice();
$vars['comments_pro'] = '';
$vars['comments_con'] = '';
$vars['js'] = $this->js();
$vars['css'] = $this->css();
$vars['vote_buttons'] = $this->vote_buttons($poll_expired,$user_vote);
// $vars['p_fields'] = $this->p_fields();
if($user_vote){
$vars['comments_pro'] = $this->get_pro_comments();
$vars['comments_con'] = $this->get_con_comments();
$vars['icons_party'] = $this->icons_party();
$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();
}
$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 = array_merge($vars,votes::get_voteinfo($this->poll_ID));
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/bulletin.tpl'),$vars);
}
}

View File

@ -1,7 +0,0 @@
<h5>${bulletin_bars_title}</h5>
${urvote_bars_user}
<div class="progress" id="progress_bars_user">
<div class="bar bar-success" style="width: ${vote_yes_perc}%;">${vote_yes_perc}%</div>
<div class="bar bar-danger" style="width: ${vote_no_perc}%;">${vote_no_perc}%</div>
<div class="bar bar-info" style="width: ${vote_ent_perc}%;">${vote_ent_perc}%</div>
</div>

View File

@ -1,58 +0,0 @@
<div id="bulletin_main">
<h4>${title}</h4>
${vote_buttons}
<div id="bulletin_left">
<img src="${frontend_logos}icon_urn_${vote_class}.png"/>
</div>
<div id="bulletin_sub1">
${openvote_help_text}
${title}
${openvote_help_text1}
</div>
<div>
${voice_weight}
</div>
<div id="bulletin_sub2">
${bars_user}<br>
${bars_bt}
</div>
<div id="bulletin_sub3">
${icons_party}
${choice_party}
</div>
<div id="divider"></div>
<br>
<div id="bulletin_sub4">
<h4>Kommentare</h4>
<div id="bulletin_sub5">
<div id="bulletin_sub5_sub">
<h5>Pro</h5>
${comments_pro}
</div>
<div id="bulletin_sub6">
<h5>Contra</h5>
${comments_con}
</div>
</div>
<div id="bulletin_sub7"></div>
<div>
<font size="2">Kommentar</font><br>
<textarea id="c_txt_pro"></textarea><br>
<font size="2">Quelle</font><br>
<input type="text" id="c_src_pro" placeholder="optional"/><br>
<select id="side_select" name="side_select">
<option>Seite</option>
<option value="1">Argument Pro</option>
<option value="2">Argument Con</option>
</select><br>
<div class="btn btn-primary submit_pro" id="submit_pro" poll_ID="${poll_ID}">${submit}</div>
</div>
</div>
<!--<div class="btn" id="test">
test
</div>
-->
</div><!-- /.modal -->

View File

@ -1,8 +0,0 @@
<h5>${urvote_party_table_desc}</h5>
<div style="width: 500px;">
<div style="float: left"><img src="${frontend_logos}icon_urn.png" width="30"/></div>
<div style="float: left"></div>
<div style="margin-left: 50px; float: left"><img src="${frontend_logos}icon_urn_pro.png" width="30"/></div>
<div style="margin-left: 15px; float: left"><img src="${frontend_logos}icon_urn_con.png" width="30"/></div>
<div style="margin-left: 15px; float: left"><img src="${frontend_logos}icon_urn_ent.png" width="30"/></div>
</div>

View File

@ -1,6 +0,0 @@
Ergebnis Bundestag
<div class="progress" style="height: 20px; width: 350px;">
<div class="bar bar-success" style="width: ${bt_pro}%;">${bt_pro}%</div>
<div class="bar bar-danger" style="width: ${bt_con}%;">${bt_con}%</div>
<div class="bar bar-info" style="width: ${bt_ent}%;"><p>${bt_ent}%</p></div>
</div>

View File

@ -1,6 +0,0 @@
<div style="width: 50px; height: 20px; float: right; margin-right: 10px;">
<div class="badge badge-success" style="">${party_yes}%</div>
<div class="badge badge-danger" style="">${party_no}%</div>
<div class="badge badge-info" style="">${party_ent}%</div>
</div>

View File

@ -1,8 +0,0 @@
<div style="width: 500px; float: left">
<div style="float: left"><img src="${frontend_logos}icon_${party}.png" width="30"></div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge ${choice_class}">${choice}</div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge badge-success">${party_yes}%</div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge badge-important">${party_no}%</div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge badge-info">${party_ent}%</div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge ">${party_off}%</div>
</div>

View File

@ -1,12 +1,24 @@
body {
padding-top: 60px;
padding-bottom: 40px;
}
#btn_logout:hover{
cursor: pointer;
}
.row {
padding: 0 !important;
margin: 0 !important;
margin-top: 10px !important;
margin-bottom: 10px !important;
}
/*.list {
border: 2px solid #ccc;
}*/
.popover{
max-width: 600px;
width: 600px;
}
.pro{
background: #5eb95e;
}

View File

@ -1,18 +1,4 @@
#help-block {
float: right;
padding: 0;
}
#controls {
float: right;
margin-right: 10px;
}
#controls2 {
float: right;
margin-right: 20px;
}
.btn btn-primary#login_submit {
float: right;
height: 32px;

View File

@ -2,6 +2,10 @@ body {
padding-top: 60px;
}
.panel-heading :hover{
cursor: pointer;
}
.main_container {
}
@ -18,7 +22,6 @@ body {
#site-content {
padding: 0;
margin: 0;
margin-left: 35px;
}
#user_main {

View File

@ -1,10 +1,4 @@
#vote_main {
margin-bottom: 5px;
width: 100%;
min-height: 125px;
border: solid lightgray 1px;
background: beige;
}
#vote_sub1 {
float: left;

View File

@ -25,111 +25,8 @@ class default_page extends SYSTEM\PAGE\Page {
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/loginform.css'))
;
}
private function get_party_per_poll($choice){
switch($choice){
case 1:
return 'PRO';
case 2:
return 'CON';
case 3:
return 'ENT';
default:
return 'NONE';
}
}
private static function tablerow_class($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'con';
case 3:
return 'ent';
default:
return 'open';
}
}
private static function badge_class($choice){
switch($choice){
case 1:
return 'badge-success';
case 2:
return 'badge-important';
case 3:
return 'badge-info';
default:
return '';
}
}
public static function panel_class($choice){
switch($choice){
case 1:
return 'panel-success';
case 2:
return 'panel-danger';
case 3:
return 'panel-info';
default:
return 'panel-default';
}
}
public function generate_votelist(){
$result = array('','');
$votes = votes::getAllVotesOfGroup(1);
foreach($votes as $vote){
$time_remain = strtotime($vote['time_end'])- microtime(true);
$time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']);
$vote_count = votes::get_count_user_votes_per_poll($vote['ID']);
$vote['title'] = utf8_encode($vote['title']);
$vote['time_left'] = round($time_remain/($time_span+1)*100,0);
$vote['time_done'] = 100-$vote['time_left'];
$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'] = $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'] = self::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 getloggedinform(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinform.tpl'),array());}
@ -142,12 +39,18 @@ class default_page extends SYSTEM\PAGE\Page {
public function exchange_loginform(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinformtop.tpl'),array());}
public function get_menu(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/menu.tpl'),array());}
public function exchange_menu(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/menu_loggedout.tpl'),array());}
public function html($_escaped_fragment_ = NULL){
$vars = array();
if(!$_escaped_fragment_){
$vars['js'] = $this->js();}
$vars['css'] = $this->css();
$vars['menu'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->get_menu() : $this->exchange_menu();
$vars['registerform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->getloggedinform() : $this->exchange_registerform();
$vars['loginform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->exchange_loginform() : $this->getloginform() ;
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';

View File

@ -2,7 +2,15 @@ $(document).ready(function() {
new SYSTEM('./api.php',1,'start');
register_login();
register_logout();
navstate();
});
function navstate(){
$(".nav a").on("click", function(){
$(".nav").find(".active").removeClass("active");
$(this).parent().addClass("active");
});
}
function register_login(){
$("#form_login input").not("[type=submit]").jqBootstrapValidation({
@ -38,7 +46,7 @@ function register_logout(){
function load_openvoteinfo (poll_ID){
var openvoteinfo;
$.get('./index.php?action=openinfo&poll_ID=' + poll_ID, function (data) {
$.get('./api.php?page=openinfo&poll_ID=' + poll_ID, function (data) {
openvoteinfo = data;
bodyelem = $("");
bodyelem.animate();
@ -61,20 +69,6 @@ function get_barsperparty (poll_ID) {
});
}
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");
$('#user_main').load('./?action=open_bulletin&poll_ID=' + poll_ID, function(){
open_vote(poll_ID);
});
} else {
alert(data.result.message);
}
});
}
function submit_commentrate (c_ID, val) {
alert('success');
$.getJSON('./api.php?call=vote&action=commentrate&c_ID=' + c_ID + '&val=' + val, function(data) {
@ -136,7 +130,7 @@ function send_feedback (feedback) {
var val = JSON.stringify(feedback);
console.log("feedback called");
$.ajax({
url: 'http://mojotrollz.eu/web/uVote/api.php',
url: './api.php',
// contentType : "application/json; charset=utf-8",
data : {
'call': 'vote',
@ -155,24 +149,7 @@ function send_feedback (feedback) {
});
}
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();
}
});
}
function loadAjaxContent(url) {
var dataTmp;
@ -216,60 +193,3 @@ function loadApiPic(id) {
});
}
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)];}}));});
console.log(data);
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)];}}));});
console.log(data);
var options = {title: id, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{}, vAxis:{logScale: false}, interpolateNulls: false, width: "300", height: "250"};
new google.visualization.LineChart(document.getElementById(id)).draw(data, options);
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,3 +1,2 @@
<form class="navbar-form navbar-right" id="form_logout">
<button id="btn_logout" type="submit" class="btn btn-primary">Logout</button>
</form>
<a id="btn_logout">&nbsp;&nbsp;Logout</a>

View File

@ -1,37 +1,8 @@
<!--<form class="navbar-form pull-right" id="form_login">
<input class="span2" type="text" id="login_email" placeholder="E-Mail">
<input class="span2" type="password" id="login_password" placeholder="Passwort">
<button type="submit" class="btn">Login</button>
</form> -->
<form class="navbar-form navbar-right" id="form_login">
<!--<div class="control-group">
<div id="help-block"></div>
<input type="hidden" />
<div id="controls">
<input type="text"
size="20"
style=""
id="bt_login_user"
placeholder="${user_name_login}"
minlength="3" data-validation-minlength-message="${register_user_name_too_short}"
maxlength="16" data-validation-maxlength-message="${register_user_name_too_long}"
required data-validation-required-message="${register_user_name_required}"/>
</div>
<div id="controls2" style="float: right;margin-right: 20px;">
<input type="password"
size="20"
style=""
id="bt_login_password"
placeholder="${user_password_login}"
minlength="5" data-validation-minlength-message="${register_password_too_short}"
maxlength="16" data-validation-maxlength-message="${register_user_password_too_long}"
required data-validation-required-message="${register_user_password_required}"/>
</div>
</div>
-->
<form class="" id="form_login">
<div class="form-group">
<div id="help-block"></div>
<input type="text"
<div class="row">
<input type="text"
size="20"
style=""
id="bt_login_user"
@ -39,7 +10,8 @@
minlength="3" data-validation-minlength-message="${register_user_name_too_short}"
maxlength="16" data-validation-maxlength-message="${register_user_name_too_long}"
required data-validation-required-message="${register_user_name_required}"/>
<input type="password"
<input type="password"
size="20"
style=""
id="bt_login_password"
@ -47,6 +19,9 @@
minlength="5" data-validation-minlength-message="${register_password_too_short}"
maxlength="16" data-validation-maxlength-message="${register_user_password_too_long}"
required data-validation-required-message="${register_user_password_required}"/>
</div>
<button class="btn btn-primary" type="submit" id="login_submit">${login}</button>
</form>
<button class="btn btn-primary" type="submit" id="login_submit"><span class="glyphicon glyphicon-log-in"></span>&nbsp;&nbsp;${login}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,10 @@
<div class="row" style="margin-bottom: 30px;">
<ul class="nav nav-pills" id="tabs_user_main" style=" text-align: center;">
<li class="active"><a href="#!start"><span class="glyphicon glyphicon-home"></span>&nbsp;Start</a></li>
<li><a href="#!list"><span class="glyphicon glyphicon-edit"></span>&nbsp;Abstimmen</a></li>
<li><a href="#!analysis"><span class="glyphicon glyphicon-stats"></span>&nbsp;Auswerten</a></li>
<!--<li><a href="#!start(user_main(my))"><span class="glyphicon glyphicon-cog"></span>&nbsp;Mithelfen</a></li>-->
</ul>
</div>

View File

@ -0,0 +1,7 @@
<div class="row" style="margin-bottom: 30px;">
<ul class="nav nav-pills" id="tabs_user_main" style=" text-align: center;">
<li class="active"><a href="#!start(user_main(start))"><span class="glyphicon glyphicon-home"></span>&nbsp;Start</a></li>
<li><a href="#!start(user_main(news))"><span class="glyphicon glyphicon-bullhorn"></span>&nbsp;News</a></li>
<li><a href="#!start(user_main(imp))"><span class="glyphicon glyphicon-tags"></span>&nbsp;&nbsp;Impressum</a></li>
</ul>
</div>

View File

@ -5,40 +5,30 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<meta name="author" content="">
<link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
${css}
${js}
</head>
<body>
<div class="main_container">
<div class="modal fade" id="impressum">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Impressum</h4>
</div>
<div class="modal-body">
<div style="background: white;">
${impressum_header}
${impressum_1}
${impressum_2}
${impressum_3}
${impressum_4}
${impressum_5}
<body style="background: url(${frontend_logos}tapete.gif); background-attachment: fixed;">
<div class="container" id="site-content">
<div class="row" style="margin-top: 15px;">
<div class="row">
<div class="col-md-6">
<a href="https://twitter.com/uvote_de" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @uvote_de</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<div class="col-md-6" style="text-align: right">
<a href="#!start(user_main(imp))">&nbsp;&nbsp;Impressum</a>
${loginform}
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<div class="col-md-12">
<img class="img-responsive" src="${frontend_logos}logo.png" style="width: 100%"/>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="row" id="site-content">
<div class="row" id="user_main"></div>
</div>
<div class="row" style="margin-bottom: 15px;">${menu}</div>
<div class="row" id="user_main"></div>
</div>
</div>
</body>
</html>

View File

@ -1,67 +0,0 @@
<div id="vote_main">
<div id="vote_sub1">
<h5>${title}</h5>
<img src="${frontend_logos}icon_urn_${vote_class}.png">
<a class="btn btn-primary btn-small btn_vote" poll_ID="${ID}">${full_vote_btn}</a>
<a class="btn btn-primary btn-small btn_fade" poll_ID="${ID}">${fade}</a>
</div>
<div id="vote_data_panel${ID}" poll_ID="${ID}" style="display: none; float: left;">
<div class="${bt_vote_class}" id="bt_vote_class_">
<img src="${frontend_logos}icon_bt.png" width="80">
${bt}
</div>
<div class="${uv_vote_class}" id="uv_vote_class_">
<img src="${frontend_logos}icon_urn.png" width="20">
<span style="">
<font size="2">uVote</font>
</span>
${uv}
<span class="badge" style="">
${uv_count}
</span>
</div>
</div>
<div id="vote_sub2">
<div id="vote_sub3" class="poll_time" time="${time_end}">
<div id="time_done" style="height: ${time_done}%;">
<div id="vote_sub_3_1">
</div>
</div>
<div id="time_left" style="height: ${time_left}%;">
<div id="vote_sub_3_2">
</div>
</div>
</div>
</div>
</div>
<!--
<div class="panel ${panel_class}">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapse_${ID}">${title}</a></h4>
bis einschließlich ${time_end}; ${time_left}% verblieben
</div>
<div id="collapse_${ID}" class="panel-collapse collapse">
<div class="panel-body">
<img src="${frontend_logos}icon_urn_${vote_class}.png">
<a class="btn btn-primary btn-small btn_vote" poll_ID="${ID}">${full_vote_btn}</a>
<div id="vote_data_panel${ID}" poll_ID="${ID}" style="float: right;">
<div class="${bt_vote_class}" id="bt_vote_class_">
<img src="${frontend_logos}icon_bt.png" width="80">
${bt}
</div>
<div class="${uv_vote_class}" id="uv_vote_class_">
<img src="${frontend_logos}icon_urn.png" width="20">
<span style="">
<font size="2">uVote</font>
</span>
${uv}
<span class="badge" style="">
${uv_count}
</span>
</div>
</div>
</div>
</div>
</div>-->

View File

@ -4,7 +4,8 @@ class default_register extends SYSTEM\PAGE\Page {
private function css(){
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_register/css/register.css').'" rel="stylesheet">';}
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=';

View File

@ -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();
}
});
}

View File

@ -1,66 +1,19 @@
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel panel-info">
<div class="panel-heading">
<h4 class="panel-title">
Welcome
<i class="glyphicon glyphicon-bookmark"></i>&nbsp;&nbsp;Willkommen auf uvote.eu!
</h4>
</div>
<div class="panel-body">
<img src="${frontend_logos}logo2.png" width="450"/>
<img src="${frontend_logos}cover.png" width="450"/>
</br></br>
${welcome_text}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_gallery">Gallery</a>
</h4>
</div>
<div id="collapse_gallery" class="panel-collapse collapse">
<div class="panel-body">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<!--<div class="carousel-inner">
<div class="item active">
<img src="..." alt="...">
<div class="carousel-caption">
...
</div>
</div>
...
</div>-->
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<div id="graph_bt_uv_overall"></div>
<script type="text/javascript" language="JavaScript">load_visualisation('graph_bt_uv_overall',84600);</script>
<div class="panel-body row">
<div id="loggedout_text" class="col-md-6" style="border-right: #d9edf7 solid 2px;">
${welcome_text}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_register">Registrieren</a>
</h4>
</div>
<div id="collapse_register" class="panel-collapse collapse">
<div class="panel-body">
<div class="col-md-6">
<form class="textbox" id="register_user_form">
<div class="control-group" id="register_username_control_group">
<h4><i class=""></i>Accounterstellung</h4>
<table id="userRegisterTable" class="table table-striped">
<tbody>
<tr>
@ -68,7 +21,6 @@
<td>
<div class="control-group controls">
<input type="text"
size="30"
id="register_username"
placeholder="${ari_name}"
minlength="3" data-validation-minlength-message="${register_user_name_too_short}"
@ -83,7 +35,6 @@
<td>
<div class="control-group controls">
<input type="email"
size="30"
id="register_email"
placeholder="${ari_mail}"
data-validation-email-message="${mail_format_wrong}"
@ -99,7 +50,6 @@
<div class="control-group" id="change_user_password">
<div class="control-group controls" id="change_user_password_sub">
<input type="password"
size="30"
id="user_register_password1"
name="user_register_password1"
placeholder="${ari_pass}"
@ -110,7 +60,6 @@
</div>
<div class="control-group controls" style="clear: both">
<input type="password"
size="30"
id="user_register_password2"
name="user_register_password2"
placeholder="${ari_pass}"
@ -122,7 +71,7 @@
</div>
</td>
</tr>
<tr>
<tr style="display: none;">
<th>${locale}</th>
<td>
<div id="change_user_locale">
@ -135,10 +84,27 @@
</tr>
</tbody>
</table>
<button class="btn btn-primary" type="submit"><i class="icon-ok icon-white"></i> ${register}</button>
<button class="btn btn-primary" type="submit"><i class="glyphicon glyphicon-play-circle"></i> ${register}</button>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
</div>
<script>
$("#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();
}
});
</script>

View File

@ -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();}
}

View File

@ -1,7 +0,0 @@
#tabbable_list_menu {
padding-right: 50px;
}
#tab-content_list_menu {
padding-top: 10px;
}

View File

@ -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'))
})
}

View File

@ -1,10 +0,0 @@
<div class="tabbable" id="tabbable_list_menu">
<ul class="nav nav-tabs" id="tabs_user_list">
<li class="active"><a href="#!start(user_list(active))" action="user_list_active">aktive Abstimmungen</a></li>
<li class=""><a href="#!start(user_list(ended))" action="user_list_ended">abgelaufene Abstimmungen</a></li>
</ul>
<div class="tab-content" id="tab-content_list_menu">
<div class="tab-pane active" id="tab_list"></div>
</div>
</div>

View File

@ -1,21 +0,0 @@
<?php
class user_list extends SYSTEM\PAGE\Page {
public static function css(){
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_list/css/list_menu.css'));}
public static function js(){
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_list/js/user_list.js'));}
public function html(){
$vars = array();
$uv = new user_list_active();
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
$vars['active'] = $uv->html();
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list/list_menu.tpl'),$vars);
}
}

View File

@ -1,2 +0,0 @@
${votelist}

View File

@ -1,106 +0,0 @@
<?php
class user_list_active extends SYSTEM\PAGE\Page {
private function get_party_per_poll($choice){
switch($choice){
case 1:
return 'PRO';
case 2:
return 'CON';
case 3:
return 'ENT';
default:
return 'NONE';
}
}
private static function tablerow_class($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'con';
case 3:
return 'ent';
default:
return 'open';
}
}
private static function badge_class($choice){
switch($choice){
case 1:
return 'badge-success';
case 2:
return 'badge-important';
case 3:
return 'badge-info';
default:
return '';
}
}
public function generate_votelist(){
$result = array('','');
$votes = votes::getAllVotesOfGroup(1);
foreach($votes as $vote){
$time_remain = strtotime($vote['time_end'])- microtime(true);
$time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']);
$vote_count = votes::get_count_user_votes_per_poll($vote['ID']);
// $vote['title'] = utf8_encode($vote['title']);
$vote['time_left'] = round($time_remain/($time_span+1)*100,0);
$vote['time_done'] = 100-$vote['time_left'];
$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'] = $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);
}
}

View File

@ -1,2 +0,0 @@
Ended List:
${votelist}

View File

@ -1,105 +0,0 @@
<?php
class user_list_ended extends SYSTEM\PAGE\Page {
private function get_party_per_poll($choice){
switch($choice){
case 1:
return 'PRO';
case 2:
return 'CON';
case 3:
return 'ENT';
default:
return 'NONE';
}
}
private static function tablerow_class($choice){
switch($choice){
case 1:
return 'pro';
case 2:
return 'con';
case 3:
return 'ent';
default:
return 'open';
}
}
private static function badge_class($choice){
switch($choice){
case 1:
return 'badge-success';
case 2:
return 'badge-important';
case 3:
return 'badge-info';
default:
return '';
}
}
public function generate_votelist(){
$result = array('','');
$votes = votes::getAllExpVotesOfGroup(1);
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['title'] = utf8_encode($vote['title']);
$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'] = $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);
}
}

View File

@ -1,3 +0,0 @@
.tabbable#tabbable_main_menu {
padding-right: 50px;
}

View File

@ -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();
}

View File

@ -1,45 +0,0 @@
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav" id="tabs_user_main">
<li class="active"><a href="#!start(user_main(u))">Abstimmen</a></li>
<li><a href="#!start(user_main(ur))">Auswerten</a></li>
<li><a href="#!start(user_main(my))">Mithelfen</a></li>
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><font size="2">Impressum</font></a></li>
</ul>
${loginform}
</div>
<!--<div class="navbar-inner">-->
<!-- <ul class="nav navbar-nav">
<li><a class="brand" href="" id="menu_uvote">uVote</a></li>
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><font size="2">impressum</font></a></li>
</ul> -->
<!--</div> -->
</div>
</nav>
<div class="tabbable" id="tabbable_main_menu">
<div class="tab-content">
<div class="tab-pane active" id="tab_main"></div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_feedback">Feedback</a>
</h4>
</div>
<div id="collapse_feedback" class="panel-collapse collapse in">
<div class="panel-body">
<form>
<br /><img src="${frontend_logos}logo2.png" width="180"/>
<h4>uVote BETA Feedback</h4>
<textarea id="feedback_text">Sag uns was dich stört!</textarea>
<br />
<input type="submit" id="feedback_submit" />
</form>
</div>
</div>
</div>
</div>

View File

@ -1,22 +0,0 @@
<?php
class user_main extends SYSTEM\PAGE\Page {
public static function css(){
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_main/css/main_menu.css'));}
public static function js(){
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_main/js/user_main.js'));}
public function exchange_loginformmain(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinformtop.tpl'),array());}
public function getloginformmain(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loginform.tpl'),array());}
public function html(){
$vars = array();
$vars['loginform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->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);
}
}

View File

@ -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);
});
}

View File

@ -0,0 +1,52 @@
<div class="row">
<div class="col-md-12">
<h4>Beschlüsse des Bundestages in absoluten Zahlen</h4>
<hr>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_pro.png"/>
</div>
<div class="col-md-10">
<font size="1">pro Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: ${total_pro_percentage}%">${pro}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_con.png"/>
</div>
<div class="col-md-10">
<font size="1">contra Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-danger" style="width: ${total_con_percentage}%">${con}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_ent.png"/>
</div>
<div class="col-md-10">
<font size="1">Enthaltungen</font>
<div class="progress">
<div class="progress-bar progress-bar-info" style="width: ${total_ent_percentage}%">${ent}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<img src="${frontend_logos}icon_urn.png"/>
</div>
<div class="col-md-10">
<div class="progress">
<div class="progress-bar progress-bar" style="width: 100%">Total: ${total_total}</div>
</div>
</div>
</div>

View File

@ -0,0 +1,11 @@
<div class="row">
<div class="col-md-12">
<font size="2">Abstimmungsquote seit Accounterstellung</font>
<div class="progress">
<div class="progress-bar" style="width: ${vote_perc}%;">${vote_perc}%</div>
</div>
<font size="1">Teilgenommen: ${voted},
nicht Teilgenommen: ${not_voted}</font>
</div>
</div>

View File

@ -0,0 +1,11 @@
<div class="row">
<div class="col-md-8">
${basic_stats_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_basic}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_bt_basic}
</div>
</div>

View File

@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-8">
<h4>Entscheidungsverhalten der uVote Community</h4>
${basic_stats_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}
<h4><span class="glyphicon glyphicon-certificate"></span></h4>
${analysis_math_community}
</div>
</div>

View File

@ -0,0 +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>

View File

@ -0,0 +1,18 @@
<div class="row">
<div class="col-md-12">
<h4>Aktueller Status</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<font size="2">Teilnahme an aktuellen Abstimmungen</font>
<div class="progress">
<div class="progress-bar" style="width: ${vote_percent}%;">${vote_percent}%</div>
</div>
<div style="">
<font size="1">Teilgenommen: ${voted}, nicht Teilgenommen: ${not_voted}</font>
</div>
</div>
</div>

View File

@ -0,0 +1,52 @@
<div class="row">
<div class="col-md-12">
<h4>Deine Stimmverteilung</h4>
<hr>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_pro.png"/>
</div>
<div class="col-md-10">
<font size="1">pro Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: ${total_pro_percentage}%">${total_pro}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_con.png"/>
</div>
<div class="col-md-10">
<font size="1">contra Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-danger" style="width: ${total_con_percentage}%">${total_con}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_ent.png"/>
</div>
<div class="col-md-10">
<font size="1">Enthaltungen</font>
<div class="progress">
<div class="progress-bar progress-bar-info" style="width: ${total_ent_percentage}%">${total_ent}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<img src="${frontend_logos}icon_urn.png"/>
</div>
<div class="col-md-10">
<div class="progress">
<div class="progress-bar progress-bar" style="width: 100%">Total: ${total_total}</div>
</div>
</div>
</div>

View File

@ -0,0 +1,52 @@
<div class="row">
<div class="col-md-12">
<h5>Absolute Stimmen der Community</h5>
<hr>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_pro.png"/>
</div>
<div class="col-md-10">
<font size="1">pro Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: ${total_pro_percentage}%">${pro}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_con.png"/>
</div>
<div class="col-md-10">
<font size="1">contra Stimmen</font>
<div class="progress">
<div class="progress-bar progress-bar-danger" style="width: ${total_con_percentage}%">${con}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<br>
<img src="${frontend_logos}icon_urn_ent.png"/>
</div>
<div class="col-md-10">
<font size="1">Enthaltungen</font>
<div class="progress">
<div class="progress-bar progress-bar-info" style="width: ${total_ent_percentage}%">${ent}</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<img src="${frontend_logos}icon_urn.png"/>
</div>
<div class="col-md-10">
<div class="progress">
<div class="progress-bar progress-bar" style="width: 100%">Total: ${total_total}</div>
</div>
</div>
</div>

View File

@ -0,0 +1,17 @@
<div class="row">
<div class="col-md-2">
<img src="${frontend_logos}icon_${party}.png"/>
</div>
<div class="col-md-9">
<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>
<div class="col-md-1 urvoteparties_uvote_popover" data-content="${according_laws}">
<span class="glyphicon glyphicon-question-sign"></span>
</div>
</div>
<script>
$(function (){ $(".urvoteparties_uvote_popover").popover({html: true});});
</script>

View File

@ -0,0 +1,19 @@
<div class="row">
<div class="col-md-2">
<img src="${frontend_logos}icon_${party}.png"/>
</div>
<div class="col-md-9">
<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>
<div class="col-md-1 urvoteparties_uvote_popover" data-content="${according_laws}">
<span class="glyphicon glyphicon-question-sign"></span>
</div>
</div>
<script>
$(function (){ $(".urvoteparties_uvote_popover").popover({html: true});
});
</script>

View File

@ -0,0 +1,21 @@
<div class="row">
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
</div>
<div class="row">
<div class="progress">
<div class="progress-bar" style="width: ${match_percentage}%">${match_percentage}%</div>
</div>
</div>
<div class="row">
<div style="col-md-12">
<span class="badge badge-success"><img src="${frontend_logos}icon_urn_pro.png"/>${class_MATCH} Übereinstimmungen</span>
<span class="badge badge-error"><img src="${frontend_logos}icon_urn_con.png"/>${class_MISSMATCH} Differenzen</span>
&nbsp;&nbsp;=&nbsp;&nbsp;
<span class="badge"><img width="20" src="${frontend_logos}icon_urn.png"/>&nbsp;&nbsp;${match_percentage}% Übereinstimmungsrate</span>
</div>
</div>

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,16 @@
<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>

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,17 @@
<div class="row">
<div class="col-md-3">
<img src="${frontend_logos}icon_${party}.png"/>
</div>
<div class="col-md-9">
<div class="progress" style="margin: 0;">
<div class="progress-bar ${bar}" style="width: ${match_percentage}%;"><a style="text-decoration: none; color: white;" class="urvoteparties_uvote_popover">${match_percentage}%</a></div>
</div>
<font size='1'>${class_MATCH} Übereinstimmung/en
<br>
<br>
</font>
</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

@ -0,0 +1,17 @@
<div class="row">
<div class="col-md-3">
<img src="${frontend_logos}icon_urn_${icon_type}.png"/>
</div>
<div class="col-md-9">
<div class="progress" style="margin: 0;">
<div class="progress-bar ${bar}" style="width: ${match_percentage}%;"><a style="text-decoration: none; color: white;" class="urvoteparties_uvote_popover">${match_percentage}%</a></div>
</div>
<font size='1'>${class_MATCH} Übereinstimmung/en
<br>
<br>
</font>
</div>
</div>

View File

@ -0,0 +1,291 @@
<div class="panel-group row" id="acc_1">
<div class="panel panel-default panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<i class="glyphicon glyphicon-cd"></i>&nbsp;&nbsp;${urVote_title}
</h4>
</div>
<div class="panel-body" id="acc_1_body">
<div class="col-md-8">
${urvote_body_text}
</div>
<div class="col-md-4" style="border-left: #d9edf7 solid 2px">
${urvote_info_info_1}
<span class="glyphicon glyphicon-info-sign"></span>
${urvote_info_info_2}
<span class="glyphicon glyphicon-certificate"></span>
${urvote_info_info_3}
</div>
</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 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>
</div>
</a>
</div>
<div id="acc_2_body" class="row panel-body panel-collapse collapse"></div>
</div>
</div>
<div class="panel-group row" id="acc_13" style="padding-top: 10px;">
<div class="panel panel-default panel-info">
<div class="panel-heading" style="padding: 0">
<a id="a_acc_13" class="acc_toggle" data-toggle="collapse" data-parent="#acc_13" href="#acc_13_body">
<div style="width: 100%; height: 100%; padding: 10px;">
<h4 class="panel-title">
<span class="glyphicon glyphicon-globe"></span>&nbsp;&nbsp;&nbsp;Gesamtsituation
<i style="float: right" class="glyphicon glyphicon-circle-arrow-down"></i>
</h4>
</div>
</a>
</div>
<div id="acc_13_body" class="row panel-body panel-collapse collapse">
<div class="row" style="padding-top: 20px;">
<div class="col-md-4">
<h4>"Dein" Bundestag</h4>
<hr>
<div id="donut_user_to_party_overall" class="row" style="padding: 0; margin: 0;"></div>
</div>
<div class="col-md-4">
<h4>Der Bundestag</h4>
<hr>
<div id="donut_bt_to_party_overall" class="row" style="padding: 0; margin: 0;"></div>
</div>
<div class="col-md-4">
<h4>die uvote community</h4>
<hr>
<div id="donut_community_to_party_overall" class="row" style="padding: 0; margin: 0;"></div>
</div>
</div>
<div class="row">
<div class="col-md-12" 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_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>
</div>
</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>
<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 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 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-cloud"></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>
<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>
</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 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>
</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 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>
</div>
</div>

View File

@ -0,0 +1,15 @@
<?php
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();
$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'));
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/user_main_analysis.tpl'),$vars);
}
}

View File

@ -0,0 +1,19 @@
<div class="panel-group row" id="acc_1">
<div class="panel panel-default panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<i class="glyphicon glyphicon-asterisk"></i>&nbsp;&nbsp;Impressum
</h4>
</div>
<div class="panel-body" id="acc_1_body">
<div class="col-md-12">
${impressum_header}
${impressum_1}
${impressum_2}
${impressum_3}
${impressum_4}
${impressum_5}
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,10 @@
<?php
class user_main_impressum {
public function html(){
$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=';
$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_impressum/tpl/user_main_impressum.tpl'), $vars);
}
}

View File

@ -1,5 +1,5 @@
<?php
class user_main_myVote extends SYSTEM\PAGE\Page {
class user_main_options extends SYSTEM\PAGE\Page {
public function get_add_data (){
$qqresult = votes::get_add_data();
@ -14,7 +14,7 @@ class user_main_myVote extends SYSTEM\PAGE\Page {
}
private function css(){
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'user_main_myVote/css/myVote.css').'" rel="stylesheet">';}
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'user_main_options/css/myVote.css').'" rel="stylesheet">';}
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);
}
}

View File

@ -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);
}
});
}

View File

@ -0,0 +1,6 @@
<h4>uvote community</h4>
<div class="progress" id="progress_bars_user">
<div class="progress-bar progress-bar-success" style="width: ${vote_yes_perc}%;">${vote_yes_perc}%</div>
<div class="progress-bar progress-bar-danger" style="width: ${vote_no_perc}%;">${vote_no_perc}%</div>
<div class="progress-bar progress-bar-info" style="width: ${vote_ent_perc}%;">${vote_ent_perc}%</div>
</div>

View File

@ -0,0 +1,8 @@
<div class="row" style="padding-top: 10px;">
${title}<br>
<a href="#!start(poll_sub);poll.${ID}" poll_ID="${ID}">
<button class="btn btn-primary" id="poll_init" type="button">
<i class="glyphicon glyphicon-eye-open"></i>&nbsp;&nbsp;Öffnen
</button>
</a>
</div>

View File

@ -1,9 +1,116 @@
<div class="row">
<div class="span6">
<div class="col-md-4" style="padding: 0; margin: 0;">
<div class="row">
<div class="panel-group" id="poll_3">
<div class="panel panel-default panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#poll_3" href="#poll_3_body"><i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;Info</a>
</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.
</div>
</div>
</div>
</div>
</div>
<div class="row" style="padding: 0; margin: 0;">
<div class="panel-group" id="poll_7">
<div class="panel panel-default panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#poll_7" href="#poll_7_body"><i class="glyphicon glyphicon-paperclip"></i>&nbsp;&nbsp;Änderungsanträge</a>
</h4>
</div>
<div class="panel-body panel-collapse collapse" id="poll_7_body" style="padding: 0;">
<div class="row" style="padding: 0; margin: 0;">
<div class="row">
<div class="col-md-12" style="padding-bottom: 10px;">
${sub_buttons}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="padding: 0; margin: 0;">
<div class="panel-group" id="poll_6">
<div class="panel panel-default panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#poll_6" href="#poll_6_body"><i class="glyphicon glyphicon-stats"></i>&nbsp;&nbsp;Statistik</a>
</h4>
</div>
<div class="panel-body panel-collapse collapse" id="poll_6_body" style="padding: 0;">
<div class="row" style="padding: 0; margin: 0;">
<div class="panel-group" id="poll_1" style="padding: 0; margin: 0;">
<div class="panel panel-default panel-warning">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#poll_1" href="#poll_1_body">Endergebnis</a>
</h4>
</div>
<div class="panel-body panel-collapse collapse" id="poll_1_body">
${bars_user}<br>
${bars_bt}
</div>
</div>
</div>
</div>
<div class="row" style="padding: 0; margin: 0;">
<div class="panel-group" id="poll_2" style="padding: 0; margin: 0;">
<div class="panel panel-default panel-warning">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#poll_2" href="#poll_2_body">Ergebnis nach Fraktionen</a>
</h4>
</div>
<div class="panel-body panel-collapse collapse" id="poll_2_body">
${choice_party}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8" style="height: 100%">
<div class="row">
<div class="panel-group" id="poll_4">
<div class="panel panel-default panel-info">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#poll_4" href="#poll_4_body"><i class="glyphicon glyphicon-check"></i>&nbsp;&nbsp;Abstimmen</a>
</h4>
</div>
<div class="panel-body" id="poll_4_body">
<div class="row">
${vote_buttons}
${voice_weight}
</div>
</div>
</div>
</div>
</div>
<div class="row" style="text-align: center;">
Quelle: <a href="${iframe_link}">${iframe_link} </a>
</div>
<div class="span6" id="iframe_">
<iframe src="${iframe_link}" width="730" height="4000"></iframe>
<div class="row" style="text-align: center;">
<iframe id="poll_frame" class="col-md-12" height="700" style="padding: 0; overflow-y: scroll;" src="${iframe_link}"></iframe>
</div>
</div>
</div>

View File

@ -0,0 +1 @@
<h5>${urvote_party_table_desc}</h5>

View File

@ -0,0 +1,7 @@
${choice_show}
Stimmverteilung Bundestag
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: ${bt_pro}%;">${bt_pro}%</div>
<div class="progress-bar progress-bar-danger" style="width: ${bt_con}%;">${bt_con}%</div>
<div class="progress-bar progress-bar-info" style="width: ${bt_ent}%;"><p>${bt_ent}%</p></div>
</div>

View File

@ -0,0 +1,3 @@
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
Der Bundestag hat "${choice_full}" <img class="img-responsive" style="float: right;" src="${frontend_logos}icon_urn_${choice}.png"/> abgestimmt.<br><br>
${disclaimer}

View File

@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-4">
<div class="badge badge-success" style="">${party_yes}%</div>
</div>
<div class="col-md-4">
<div class="badge badge-danger" style="">${party_no}%</div>
</div>
<div class="col-md-4">
<div class="badge badge-info" style="">${party_ent}%</div>
</div>
</div>

View File

@ -0,0 +1,11 @@
<div class="row">
<div class="col-md-4" style=""><img class="img-responsive" src="${frontend_logos}icon_${party}.png"></div>
<div class="col-md-8">
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: ${party_yes}%">${party_yes}%</div>
<div class="progress-bar progress-bar-danger" style="width: ${party_no}%">${party_no}%</div>
<div class="progress-bar progress-bar-info" style="width: ${party_ent}%">${party_ent}%</div>
</div>
</div>
</div>
<hr>

View File

@ -0,0 +1,24 @@
<div class="row">
<div class="col-md-8">
<h5>Ändere deine Stimme hier ab</h5>
<button id="btnvote_yes" class="btn btn-success btn_vote ${yes} btn-default btnvote_yes"
style=""
poll_ID="${poll_ID}"><font
size="3"><span class="glyphicon glyphicon-ok-sign"></span>&nbsp;&nbsp;Pro</font></button>
<button id="btnvote_no" class="btn btn-danger btn_vote ${no} btn-default btnvote_no"
style=""
href="#"
poll_ID="${poll_ID}"><font
size="3"><span class="glyphicon glyphicon-remove-sign"></span>&nbsp;Contra</font></button>
<button id="btnvote_off" class="btn btn-info btn_vote ${ent} btn-default btnvote_off"
style=""
href="#"
poll_ID="${poll_ID}"><font
size="3"><span class="glyphicon glyphicon-ban-circle"></span>&nbsp;Enthaltung</font></button>
</div>
<div class="col-md-4">
<h5>Abgestimmt mit:</h5>
<img class="img-responsive" src="${frontend_logos}icon_urn${choice}.png"/>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More