uvote to bt overall now working
This commit is contained in:
parent
1b42a206e6
commit
d18596c322
@ -8,8 +8,7 @@ class UVOTE_DATA_UVOTE_TO_PARTY_OVERALL extends \SYSTEM\DB\QQ {
|
||||
'',
|
||||
//mys
|
||||
'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
|
||||
GROUP BY party;'
|
||||
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 GROUP BY party;'
|
||||
);}}
|
||||
@ -1,5 +1,13 @@
|
||||
<div style="width: 50%; float: left; margin-bottom: 30px;">
|
||||
|
||||
<div style="float: left">
|
||||
<table style="border-collapse: separate;
|
||||
border-spacing: 10px 5px; width: 350px;">
|
||||
<tr>
|
||||
<h5>Übereinstimmung von uVote & Politik</h5>
|
||||
${uvote_to_bt}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div style="width: 50%; float: right; margin-bottom: 30px;">
|
||||
<h5>Entscheidungsverhalten der uVote Community</h5>
|
||||
<span style="float: left;">
|
||||
${votes_all}
|
||||
@ -8,7 +16,7 @@
|
||||
<br> insgesamt Dafür, Dagegen oder
|
||||
<br> Enthaltung gestimmt hat.</span>
|
||||
</div>
|
||||
<div style="width: 50%;">
|
||||
<div style="width: 50%; float: right;">
|
||||
<h5>Entscheidungsverhalten des Bundestags</h5>
|
||||
<span style="">
|
||||
${votes_all_bt}
|
||||
|
||||
@ -1,7 +1,16 @@
|
||||
<?php
|
||||
class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
private function uvote_to_parties (){
|
||||
$votes = votes::get_uvote_to_bt_overall();
|
||||
$result = '';
|
||||
print_r($votes, TRUE);
|
||||
foreach($votes as $vote){
|
||||
$vote['match_percentage'] = round($vote['class_MATCH']/($vote['class_MATCH']+$vote['class_MISSMATCH'])*100,2);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uvoteparties.tpl'), $vote);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
private function votes_all(){
|
||||
@ -64,9 +73,11 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['uvote_to_bt'] = $this->uvote_to_parties();
|
||||
$vars['votes_all'] = $this->votes_all();
|
||||
$vars['votes_all_bt'] = $this->votes_all_bt();
|
||||
$vars['user_count'] = $this->user_count();
|
||||
$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\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars);
|
||||
|
||||
8
uVote/page/user_main_uVote/uvoteparties.tpl
Normal file
8
uVote/page/user_main_uVote/uvoteparties.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<tr>
|
||||
<td>
|
||||
<img src="${frontend_logos}icon_${party}.png"/>
|
||||
</td>
|
||||
<td><span class="badge badge-success">${class_MATCH}</span></td>
|
||||
<td><span class="badge badge-important">${class_MISSMATCH}</span></td>
|
||||
<td><span class="badge">${match_percentage}%</span></td>
|
||||
</tr>
|
||||
Loading…
x
Reference in New Issue
Block a user