major leap
This commit is contained in:
parent
0dd0a76eb4
commit
ed7a4312ea
@ -28,6 +28,16 @@ class api_uvote extends \SYSTEM\API\api_system {
|
||||
|
||||
public static function call_graph_bt_to_user_overall_by_time($timespan = 84600){
|
||||
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 = 84600){
|
||||
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 = 84600){
|
||||
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 = 84600){
|
||||
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 = 84600){
|
||||
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 = 84600){
|
||||
return graphs::graph_party_to_user_overall_by_time($party, $timespan);}
|
||||
|
||||
//comments
|
||||
public static function call_vote_action_comment($poll_ID, $c_choice, $c_txt, $c_src) {
|
||||
|
||||
@ -24,4 +24,14 @@ class graphs {
|
||||
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));
|
||||
while ($row = $res->next()){
|
||||
$result[] = array( 0 => $row['day'],
|
||||
'class_match' => $row['class_match'] / ($row['class_match']+$row['class_mismatch']+1));
|
||||
}
|
||||
return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,6 +11,10 @@ class votes {
|
||||
$res = \SQL\UVOTE_DATA_COUNT_VOTES::QQ();
|
||||
return $res;}
|
||||
|
||||
public static function get_user_choice_overall($user_ID){
|
||||
return \SQL\UVOTE_DATA_USER_CHOICE_OVERALL::Q1(array($user_ID));
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
@ -25,7 +29,84 @@ class votes {
|
||||
$result = $res->next();
|
||||
return $result['choice'];
|
||||
}
|
||||
|
||||
public static function get_user_match_per_choice($choice){
|
||||
switch($choice){
|
||||
case 1:
|
||||
$bar = 'progress-bar-success';
|
||||
break;
|
||||
case 2:
|
||||
$bar = 'progress-bar-danger';
|
||||
break;
|
||||
case 3:
|
||||
$bar = 'progress-bar-info';
|
||||
break;
|
||||
case 0:
|
||||
$bar = 'progress-bar';
|
||||
}
|
||||
$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_data.choice = ? GROUP BY party;',
|
||||
array(\SYSTEM\SECURITY\Security::getUser()->id, $choice));
|
||||
$i = 0;
|
||||
while($row = $res->next()){
|
||||
$row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2);
|
||||
$row['bar'] = $bar;
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvoteparties_by_choice.tpl'), $row);;
|
||||
}
|
||||
if(empty($result)){
|
||||
return 'Keine relevanten Daten verfügbar';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
public static function get_user_match_per_choice_bt($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';
|
||||
}
|
||||
$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_data.choice = ? GROUP by user_ID;',
|
||||
array(\SYSTEM\SECURITY\Security::getUser()->id, $choice));
|
||||
$i = 0;
|
||||
|
||||
while($row = $res->next()){
|
||||
if(empty($row['class_MATCH'])){
|
||||
return 'Keine relevanten Daten verfügbar <br>';
|
||||
}
|
||||
$row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2);
|
||||
$row['bar'] = $bar;
|
||||
$row['icon_type'] = $icon_type;
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvotebt_by_choice.tpl'), $row);;
|
||||
}
|
||||
if(empty($result)){
|
||||
return 'Keine relevanten Daten verfügbar';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
public static function get_barsperusers($poll_ID,$return_as_json = true){
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
//count
|
||||
|
||||
@ -39,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=';
|
||||
|
||||
@ -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({
|
||||
@ -268,8 +276,38 @@ function load_visualisation_urvote(id, timespan){
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
console.log(json);
|
||||
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', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{}, vAxis:{logScale: false}, interpolateNulls: false, width: "800", height: "250"};
|
||||
new google.visualization.LineChart(document.getElementById(id)).draw(data, options);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
15
uvote/page/default_page/tpl/menu.tpl
Normal file
15
uvote/page/default_page/tpl/menu.tpl
Normal file
@ -0,0 +1,15 @@
|
||||
<div class="row">
|
||||
<nav class="navbar navbar-default navbar-inverse">
|
||||
<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>
|
||||
</nav>
|
||||
</div>
|
||||
8
uvote/page/default_page/tpl/menu_loggedout.tpl
Normal file
8
uvote/page/default_page/tpl/menu_loggedout.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<nav class="navbar navbar-default navbar-inverse">
|
||||
<div class="container-fluid">
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
|
||||
${loginform}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@ -10,49 +10,34 @@
|
||||
${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">×</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}
|
||||
<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">×</button>
|
||||
<h4 class="modal-title">Impressum</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<div class="container" id="site-content" style="">
|
||||
<nav class="navbar navbar-default navbar-inverse">
|
||||
<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="modal-body">
|
||||
<div style="background: white;">
|
||||
${impressum_header}
|
||||
${impressum_1}
|
||||
${impressum_2}
|
||||
${impressum_3}
|
||||
${impressum_4}
|
||||
${impressum_5}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<div class="container" id="site-content" style="">
|
||||
<div class="row">${menu}</div>
|
||||
<div class="row" id="user_main"></div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="row" id="user_main"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -5,62 +5,21 @@
|
||||
Welcome
|
||||
</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 class="col-md-6">
|
||||
<img class="img-responsive" src="${frontend_logos}logo2.png" width="450"/>
|
||||
</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">
|
||||
${welcome_text}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<form class="textbox" id="register_user_form">
|
||||
<div class="control-group" id="register_username_control_group">
|
||||
<h4>Accounterstellung</h4>
|
||||
<table id="userRegisterTable" class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
@ -138,7 +97,11 @@
|
||||
<button class="btn btn-primary" type="submit"><i class="icon-ok icon-white"></i> ${register}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<img class="img-responsive" src="${frontend_logos}cover.png" width="450"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -18,9 +18,13 @@ class page_uvote extends \SYSTEM\API\api_default {
|
||||
|
||||
|
||||
public static function page_user_main_analysis(){
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return (new default_register ())->html();}
|
||||
return (new user_main_analysis())->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) {
|
||||
@ -30,6 +34,8 @@ class page_uvote extends \SYSTEM\API\api_default {
|
||||
return (new user_main_poll($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();}
|
||||
|
||||
}
|
||||
5
uvote/page/user_main_analysis/js/user_main_analysis.js
Normal file
5
uvote/page/user_main_analysis/js/user_main_analysis.js
Normal file
@ -0,0 +1,5 @@
|
||||
function init_user_main_analysis(){
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,14 +1,19 @@
|
||||
<div style="padding-bot: 20px;">
|
||||
<h5>Aktueller Status</h5>
|
||||
</div>
|
||||
<div style="width: 280px; border-style: solid; border-width: 1px; padding: 5px;">
|
||||
<font size="2">Teilnahme an aktuellen Abstimmungen</font>
|
||||
<div class="progress" style="height: 20px;">
|
||||
<div class="progress-bar" style="width: ${vote_perc}%;">${vote_perc}%</div>
|
||||
<div class="bar bar-info" style="width: 100%;"></div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Aktueller Status</h5>
|
||||
</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_perc}%;">${vote_perc}%</div>
|
||||
<div class="bar bar-info" style="width: 100%;"></div>
|
||||
</div>
|
||||
<div style="">
|
||||
<font size="1">Teilgenommen: ${voted}, nicht Teilgenommen: ${not_voted}</font>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
@ -1,8 +1,20 @@
|
||||
<tr>
|
||||
<td style="border-top: 1px solid black;">
|
||||
<img src="${frontend_logos}icon_bt.png"/>
|
||||
</td>
|
||||
<td><span class="badge badge-success">${class_MATCH}</span></td>
|
||||
<td><span class="badge badge-alert">${class_MISSMATCH}</span></td>
|
||||
<td><span class="badge">${match_percentage}</span></td>
|
||||
</tr>
|
||||
Bundestag gesamt
|
||||
<div class="row">
|
||||
<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>
|
||||
<div class="row">
|
||||
<div style="col-md-12">
|
||||
<span class="badge badge-success">${class_MATCH} matches</span>
|
||||
<span class="badge badge-error">${class_MISSMATCH} missmatches</span>
|
||||
<span class="badge">${match_percentage}%</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<div style="width: 280px; border-style: solid; border-width: 1px; padding: 5px;">
|
||||
<font size="2">Abstimmungsquote seit Accounterstellung</font>
|
||||
<div class="progress" style="height: 20px;">
|
||||
<div class="progress-bar" style="width: ${vote_perc}%;">${vote_perc}%</div>
|
||||
<div class="progress-bar progress-bar-info" style=""></div>
|
||||
<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 style="">
|
||||
<font size="1">Teilgenommen: ${voted},
|
||||
nicht Teilgenommen: ${not_voted}</font>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
17
uvote/page/user_main_analysis/tpl/urvotebt_by_choice.tpl
Normal file
17
uvote/page/user_main_analysis/tpl/urvotebt_by_choice.tpl
Normal 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>
|
||||
|
||||
@ -1,18 +1,22 @@
|
||||
<div id="urvoteparties_{party}">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<img src="${frontend_logos}icon_${party}.png"/>
|
||||
</td>
|
||||
<td><span class="badge badge-success">${class_MATCH}</span></td>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="progress">
|
||||
<div class="progress-bar" style="width: ${match_percentage}%;"><a style="text-decoration: none; color: white;" class="urvoteparties_uvote_popover" data-content="${according_laws}">${match_percentage}%</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<td><span class="badge badge-success">${class_MATCH}</span></td>
|
||||
<td><span class="badge badge-important">${class_MISSMATCH}</span></td>
|
||||
<td><span class="badge">
|
||||
<a class="urvoteparties_uvote_popover" data-content="${according_laws}">${match_percentage}%</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>-->
|
||||
</div>
|
||||
<script>
|
||||
$(function ()
|
||||
{ $(".urvoteparties_uvote_popover").popover({html: true});
|
||||
$(function (){ $(".urvoteparties_uvote_popover").popover({html: true});
|
||||
|
||||
});
|
||||
</script>
|
||||
@ -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>
|
||||
|
||||
@ -1,43 +1,138 @@
|
||||
<div id="statistics_uvote_users" class="row">
|
||||
<div class="panel-group" id="accordion">
|
||||
<div class="panel-group row" id="acc_1">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
${urVote_title}
|
||||
<a data-toggle="collapse" data-parent="#acc_1" href="#acc_1_body">${urVote_title}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${urvote_body_text}
|
||||
<div class="panel-body" id="acc_1_body">
|
||||
<div class="col-md-12">
|
||||
${urvote_body_text}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="padding-top: 30px;">
|
||||
<div class="row-heading">
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_2" style="padding-top: 10px;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_urVote_1">Übereinstimmung von Deiner uVote-Stimme & Politik</a>
|
||||
<a data-toggle="collapse" data-parent="#acc_2" href="#acc_2_body">Deine Daten</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapse_urVote_1" class="row">
|
||||
<div class="col-md-6">
|
||||
<table style="border-collapse: separate;
|
||||
border-spacing: 10px 5px; width: 350px;">
|
||||
<tr>
|
||||
<h5>${urVote_user_party_compare}</h5>
|
||||
${choices_user_ID}
|
||||
</tr>
|
||||
<div id="acc_2_body" class="row panel-body panel-collapse">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
${basic_stats}
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
${choices_bt_to_user}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="right_float" class="col-md-6">
|
||||
<div class="col-md-6">
|
||||
<div>${user_temp_votes}</div>
|
||||
<br>
|
||||
<div>${user_overall_votes}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_4" style="padding-top: 10px;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#acc_4" href="#acc_4_body">Bilanz: Fraktionen</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="acc_4_body" class="row panel-body panel-collapse collapse">
|
||||
<div class="col-md-6">
|
||||
Gesamtübereinstimmung mit den Fraktionen im Bundestag<br>
|
||||
<font size="1">auf %Angabe clicken für Details</font>
|
||||
${choices_user_ID}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
${choices_bt_to_user}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_5" style="padding-top: 10px;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#acc_5" href="#acc_5_body">Bilanz: Fraktionen nach Stimmverhalten</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="acc_5_body" class="row panel-collapse collapse panel-body">
|
||||
<div class="col-md-3">
|
||||
<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-3">
|
||||
<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-3">
|
||||
<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-3">
|
||||
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
|
||||
<h5>Übereinstimmung mit dem Bundestag</h5>
|
||||
${choices_user_ID_per_bt_pro}
|
||||
${choices_user_ID_per_bt_con}
|
||||
${choices_user_ID_per_bt_ent}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row panel-group" id="acc_6" style="padding-top: 10px;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#acc_6" href="#acc_6_body">Entwicklung: Fraktionen</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="acc_6_body" class="panel-body panel-collapse collapse">
|
||||
<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>
|
||||
</div>
|
||||
<div class="row panel-group" id="acc_3" style="padding-top: 10px;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#acc_3" href="#acc_3_body">community Statistik</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="acc_3_body" class="panel-body panel-collapse collapse">
|
||||
<div class="col-md-6">
|
||||
<h5>Entscheidungsverhalten der uVote Community</h5>
|
||||
<span style="">
|
||||
@ -55,13 +150,22 @@
|
||||
<span style=""> Wie oft der Bundestag
|
||||
<br> Dafür, Dagegen oder
|
||||
<br> Enthaltung gestimmt hat.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="graph_bt_user_overall" class="row"></div>
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_urvote('graph_bt_user_overall',84600);</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--<div id="graph_bt_user_overall" class="row"></div>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_urvote('graph_bt_user_overall',84600);</script>-->
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_user_to_party_overall('graph_user_to_party_overall_cdu', 'cdu', 84600);</script>
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_user_to_party_overall('graph_user_to_party_overall_csu', 'csu', 84600);</script>
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_user_to_party_overall('graph_user_to_party_overall_spd', 'spd', 84600);</script>
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_user_to_party_overall('graph_user_to_party_overall_gruene', 'gruene', 84600);</script>
|
||||
<script type="text/javascript" language="JavaScript">load_visualisation_user_to_party_overall('graph_user_to_party_overall_linke', 'linke', 84600);</script>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
52
uvote/page/user_main_analysis/tpl/user_total.tpl
Normal file
52
uvote/page/user_main_analysis/tpl/user_total.tpl
Normal file
@ -0,0 +1,52 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Deine Stimmverteilung</h5>
|
||||
</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: ${user_total_pro_percentage}%">${user_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: ${user_total_con_percentage}%">${user_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">
|
||||
<br>
|
||||
<div class="progress-bar progress-bar-info" style="width: ${user_total_ent_percentage}%">${user_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: ${user_total_total}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,6 +46,7 @@ class user_main_analysis extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
private function user_per_party_overall(){
|
||||
|
||||
//$vars = votes::get_user_per_party_overall(array(\SYSTEM\SECURITY\Security::getUser()->id));
|
||||
$result = '';
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
@ -65,10 +66,16 @@ class user_main_analysis extends SYSTEM\PAGE\Page {
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/urvoteparties.tpl'), $row);;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
private function user_per_party_by_choicetype($choice){
|
||||
return votes::get_user_match_per_choice($choice);
|
||||
}
|
||||
private function user_per_bt_by_choicetype($choice){
|
||||
return votes::get_user_match_per_choice_bt($choice);
|
||||
}
|
||||
public function build_according_law_html($part, $party){
|
||||
$part = json_decode($part, true);
|
||||
$result = "<div><font color='black'><h6><i>Bei folgenden Gesetzen hast du genauso abgestimmt wie die '".$party."':</i></h6><hr>";
|
||||
$result = "<div><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>";
|
||||
}
|
||||
@ -124,12 +131,29 @@ class user_main_analysis extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public static function get_basic_stats(){
|
||||
$vars = votes::get_user_choice_overall(\SYSTEM\SECURITY\Security::getUser()->id);
|
||||
$vars['user_total_total'] = $vars['user_total_pro'] + $vars['user_total_con'] + $vars['user_total_ent'];
|
||||
$vars['user_total_pro_percentage'] = round($vars['user_total_pro']/$vars['user_total_total']*100+1);
|
||||
$vars['user_total_con_percentage'] = round($vars['user_total_con']/$vars['user_total_total']*100+1);
|
||||
$vars['user_total_ent_percentage'] = round($vars['user_total_ent']/$vars['user_total_total']*100+1);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/user_total.tpl'),$vars);
|
||||
}
|
||||
public static function js(){
|
||||
return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_analysis/js/user_main_analysis.js'));}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
// $vars['poll_compare'] = $this->count_all_polls();
|
||||
$vars['basic_stats'] = $this->get_basic_stats();
|
||||
$vars['votes_all'] = $this->votes_all();
|
||||
$vars['votes_all_bt'] = $this->votes_all_bt();
|
||||
$vars['choices_user_ID'] = $this->user_per_party_overall();
|
||||
$vars['choices_user_ID_per_party_pro'] = $this->user_per_party_by_choicetype('1');
|
||||
$vars['choices_user_ID_per_party_con'] = $this->user_per_party_by_choicetype('2');
|
||||
$vars['choices_user_ID_per_party_ent'] = $this->user_per_party_by_choicetype('3');
|
||||
$vars['choices_user_ID_per_bt_pro'] = $this->user_per_bt_by_choicetype('1');
|
||||
$vars['choices_user_ID_per_bt_con'] = $this->user_per_bt_by_choicetype('2');
|
||||
$vars['choices_user_ID_per_bt_ent'] = $this->user_per_bt_by_choicetype('3');
|
||||
$vars['choices_bt_to_user'] = $this->user_to_bt();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars['user_temp_votes'] = $this->user_temp_votes();
|
||||
|
||||
@ -1,29 +1,60 @@
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<h4>${title}</h4>
|
||||
|
||||
${openvote_help_text}
|
||||
|
||||
${title}
|
||||
${openvote_help_text1}
|
||||
${title} abstimmen.
|
||||
<hr>
|
||||
${vote_buttons}
|
||||
<hr>
|
||||
${voice_weight}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
${bars_user}<br>
|
||||
${bars_bt}
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="panel-group" id="poll_1">
|
||||
<div class="panel panel-default">
|
||||
<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" id="poll_1_body">
|
||||
${bars_user}<br>
|
||||
${bars_bt}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
${icons_party}
|
||||
${choice_party}
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="panel-group" id="poll_2">
|
||||
<div class="panel panel-default">
|
||||
<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" id="poll_2_body">
|
||||
|
||||
${choice_party}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="row" style="text-align: center;">
|
||||
Quelle: <a href="${iframe_link}">${iframe_link} </a>
|
||||
</div>
|
||||
<div class="row" style="text-align: center;" id="iframe_">
|
||||
<iframe src="${iframe_link}" width="730" height="4000"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Ergebnis Bundestag
|
||||
<div class="progress" style="height: 20px; width: 350px;">
|
||||
<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>
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
<div style="width: 500px; height: 20px; float: left">
|
||||
<div style="float: left"><img class="img-responsive" src="${frontend_logos}icon_${party}.png" width="30"></div>
|
||||
<div style="margin-left: 5px; width: 40px; float: left" class="badge ${choice_class}">${choice}</div>
|
||||
<div style="margin-left: 5px; width: 40px; float: left" class="badge badge-success">${party_yes}%</div>
|
||||
<div style="margin-left: 5px; width: 40px; float: left" class="badge badge-error">${party_no}%</div>
|
||||
<div style="margin-left: 5px; width: 40px; float: left" class="badge badge-info">${party_ent}%</div>
|
||||
<div style="margin-left: 5px; width: 40px; float: left" class="badge ">${party_off}%</div>
|
||||
</div>
|
||||
<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>
|
||||
@ -113,15 +113,15 @@ class user_main_poll extends SYSTEM\PAGE\Page {
|
||||
if(!$user_poll){
|
||||
return '<h5>Stimme hier ab</h5>
|
||||
<button id="btnvote_yes" class="btn btn-success btn-default"
|
||||
style="width: 70px"
|
||||
style="width: 90px"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Pro</font></button>
|
||||
<button id="btnvote_no" class="btn btn-danger btn-default"
|
||||
style="width: 70px"
|
||||
style="width: 90px"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Contra</font></button>
|
||||
<button id="btnvote_off" class="btn btn-info btn-default"
|
||||
style="width: 70px"
|
||||
style="width: 90px"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Enthaltung</font></button>';}
|
||||
$classes = array('','','');
|
||||
@ -134,16 +134,16 @@ class user_main_poll extends SYSTEM\PAGE\Page {
|
||||
|
||||
return ' <h5>Ändere deine Stimme hier ab</h5>
|
||||
<button id="btnvote_yes" class="btn btn_vote '.$classes[0].' btn-default btnvote_yes"
|
||||
style="width: 70px"
|
||||
style="width: 90px"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Pro</font></button>
|
||||
<button id="btnvote_no" class="btn btn_vote '.$classes[1].' btn-default btnvote_no"
|
||||
style="width: 70px"
|
||||
style="width: 90px"
|
||||
href="#"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Contra</font></button>
|
||||
<button id="btnvote_off" class="btn btn_vote '.$classes[2].' btn-default btnvote_off"
|
||||
style="width: 70px"
|
||||
style="width: 90px"
|
||||
href="#"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Enthaltung</font></button>
|
||||
|
||||
@ -1,25 +1,38 @@
|
||||
<div class="row" style="padding-bottom: 30px;">
|
||||
<div class="col-md-8">
|
||||
<div class="row panel-group" id="accordion">
|
||||
|
||||
<div class="row panel-group" style="margin: 0; padding:0;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
uvote
|
||||
Willkommen auf uvote.eu!
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${welcome_text}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
${welcome_text}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
${user_temp_votes}
|
||||
<span class="badge badge-info">${user_count}</span> Nutzer auf uVote
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
${user_temp_votes}
|
||||
<span class="badge badge-info">${user_count}</span> Nutzer auf uVote
|
||||
|
||||
</div>
|
||||
<div class="row panel-group">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Hier gehts zur Abstimmung
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
${votelist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${votelist}
|
||||
@ -3,7 +3,7 @@
|
||||
<img src="${frontend_logos}icon_urn_${vote_class}.png">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<a href="#!start(poll);poll.${ID}" class="btn btn-primary btn-small" poll_ID="${ID}">${full_vote_btn}</a>
|
||||
<a href="#!start(poll);poll.${ID}" class="btn btn-primary btn-small" poll_ID="${ID}">Abstimmen</a>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UVOTE_DATA_GRAPH_PARTY_TO_USER_OVERALL_BY_TIME extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT
|
||||
DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP(a.`timestamp`) - MOD(UNIX_TIMESTAMP(a.`timestamp`),?)),"%Y/%m/%d %H:%i:%s") as day,
|
||||
SUM(CASE WHEN a.choice = c.choice THEN 1 ELSE 0 END) class_match,
|
||||
SUM(CASE WHEN a.choice = c.choice THEN 0 ELSE 1 END) class_mismatch
|
||||
FROM uvote_data as a
|
||||
LEFT JOIN (Select choice, poll_ID FROM uvote_data WHERE user_ID = ? GROUP BY choice LIMIT 1) b ON a.poll_ID = b.poll_ID
|
||||
LEFT JOIN uvote_votes_per_party as c ON a.poll_ID = c.poll_ID
|
||||
WHERE c.party = ? AND user_ID = ?
|
||||
GROUP BY day;'
|
||||
;}}
|
||||
11
uvote/sql/qq/UVOTE_DATA_USER_CHOICE_OVERALL.php
Normal file
11
uvote/sql/qq/UVOTE_DATA_USER_CHOICE_OVERALL.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UVOTE_DATA_USER_CHOICE_OVERALL extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'SELECT SUM(IF(choice = "1",1,0)) AS user_total_pro,
|
||||
SUM(IF(choice = "2",1,0)) AS user_total_con,
|
||||
SUM(IF(choice = "3",1,0)) AS user_total_ent
|
||||
FROM `uvote_data` WHERE `user_ID` = ?;'
|
||||
;}}
|
||||
Loading…
x
Reference in New Issue
Block a user