new style stuff
This commit is contained in:
parent
e5732455c4
commit
40e34ce9b8
@ -95,9 +95,16 @@ class votes {
|
||||
public static function get_user_to_bt_overall($user_ID){
|
||||
return \DBD\UVOTE_DATA_USER_TO_BT::QA(array($user_ID));
|
||||
}
|
||||
|
||||
public static function get_uvote_to_bt_overall(){
|
||||
return \DBD\UVOTE_DATA_UVOTE_TO_PARTY_OVERALL::QA(array());
|
||||
}
|
||||
|
||||
public static function get_users_choice_per_poll($poll_ID){
|
||||
return \DBD\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));}
|
||||
|
||||
public static function get_pfields_per_poll($poll_ID){
|
||||
return \DBD\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));}
|
||||
|
||||
public static function get_voteinfo($poll_ID){
|
||||
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
|
||||
|
||||
11
uVote/dbd/qq/UVOTE_DATA_PFIELDS_PER_POLL.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_PFIELDS_PER_POLL.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_PFIELDS_PER_POLL extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT COUNT(*) as count, choice FROM uvote_data WHERE `poll_ID` = ? GROUP BY choice ORDER BY count DESC;'
|
||||
);}}
|
||||
15
uVote/dbd/qq/UVOTE_DATA_UVOTE_TO_PARTY_OVERALL.php
Normal file
15
uVote/dbd/qq/UVOTE_DATA_UVOTE_TO_PARTY_OVERALL.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_UVOTE_TO_PARTY_OVERALL extends \SYSTEM\DB\QQ {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//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;'
|
||||
);}}
|
||||
BIN
uVote/img/frontend_logos/background.png
Normal file
BIN
uVote/img/frontend_logos/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 MiB |
BIN
uVote/img/frontend_logos/icon_urn_con.png
Normal file
BIN
uVote/img/frontend_logos/icon_urn_con.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
BIN
uVote/img/frontend_logos/icon_urn_ent.png
Normal file
BIN
uVote/img/frontend_logos/icon_urn_ent.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
uVote/img/frontend_logos/icon_urn_open.png
Normal file
BIN
uVote/img/frontend_logos/icon_urn_open.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
BIN
uVote/img/frontend_logos/icon_urn_pro.png
Normal file
BIN
uVote/img/frontend_logos/icon_urn_pro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
@ -44,6 +44,19 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/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){
|
||||
@ -105,7 +118,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$vars['css'] = $this->css();
|
||||
|
||||
$vars['vote_buttons'] = $this->vote_buttons($poll_expired,$user_vote);
|
||||
|
||||
// $vars['p_fields'] = $this->p_fields();
|
||||
if($user_vote){
|
||||
$vars['bars_party'] = $poll_expired ? '' : $this->bars_party();
|
||||
$vars['bars_user'] = $this->bars_user();
|
||||
|
||||
@ -11,10 +11,11 @@ body {
|
||||
background: #5eb95e;
|
||||
}
|
||||
|
||||
.contra{
|
||||
.con{
|
||||
background: #ee5f5b;
|
||||
}
|
||||
|
||||
.ent{
|
||||
background: lightgrey;
|
||||
}
|
||||
|
||||
|
||||
@ -34,11 +34,11 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
case 1:
|
||||
return 'pro';
|
||||
case 2:
|
||||
return 'contra';
|
||||
return 'con';
|
||||
case 3:
|
||||
return 'ent';
|
||||
default:
|
||||
return '';
|
||||
return 'open';
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
case 2:
|
||||
return 'badge-important';
|
||||
case 3:
|
||||
return '';
|
||||
return 'badge-info';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@ -72,6 +72,7 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
$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);
|
||||
@ -124,7 +125,7 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
$vars = array();
|
||||
$vars['js'] = $this->js();
|
||||
$vars['css'] = $this->css();
|
||||
$vars['votelist'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->generate_votelist() : $this->get_coverpage() ;
|
||||
$vars['votelist'] = $this->generate_votelist();
|
||||
$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=img&cat=frontend_logos&id=';
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body style="padding-top: 50px;">
|
||||
<body style="background: ${frontend_logos}background.png, padding-top: 50px;">
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner" style="padding-left: 50px; padding-right: 50px;">
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
<table style="margin-bottom: 5px; width: 95%; height: 100px; border: solid lightgray 1px; background: beige;">
|
||||
<tr>
|
||||
<td class="${vote_class}" style="width: 10px; margin-top: 10px; border-left: 1px solid lightgray;">
|
||||
</td>
|
||||
<td style="padding: 5px;">
|
||||
<h4>${title}</h4>
|
||||
<!--<td class="${vote_class}" style="width: 10px; margin-top: 10px; border-left: 1px solid lightgray;">
|
||||
</td>-->
|
||||
<td style="padding: 5px; padding-top: 0;">
|
||||
<h5>${title}</h5>
|
||||
<img src="${frontend_logos}icon_urn_${vote_class}.png"/>
|
||||
<a class="btn btn-primary btn-small btn_vote" style="" poll_ID="${ID}">${full_vote_btn}</a>
|
||||
</td>
|
||||
<td class="${bt_vote_class}" style="width: 80px; margin-top: 10px; border-left: 1px solid lightgray;">
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<div style="width: 90%;">
|
||||
<img src="${frontend_logos}logo2.png"/>
|
||||
<br />
|
||||
<br />
|
||||
@ -83,4 +84,5 @@
|
||||
</table>
|
||||
<button class="btn btn-primary" type="submit"><i class="icon-ok icon-white"></i> ${register}</button>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
@ -1 +1,14 @@
|
||||
test123
|
||||
Geburtsjahr
|
||||
<br>
|
||||
<input type="text" id="feedback_text"/>
|
||||
<br>
|
||||
<ul class="dropdown-menu" style="display: block;">
|
||||
<li><a tabindex="-1" href="#">männlich</a></li>
|
||||
<li><a tabindex="-1" href="#">weiblich</a></li>
|
||||
<li><a tabindex="-1" href="#">weder noch</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a tabindex="-1" href="#">keine Angabe</a></li>
|
||||
</ul>
|
||||
|
||||
<input type="submit" id="feedback_submit" />
|
||||
|
||||
|
||||
8
uVote/page/user_main_uVote/bt_to_uvote_overall.tpl
Normal file
8
uVote/page/user_main_uVote/bt_to_uvote_overall.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<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-important">${class_MISSMATCH}</span></td>
|
||||
<td><span class="badge">${match_percentage}%</span></td>
|
||||
</tr>
|
||||
@ -1,4 +1,4 @@
|
||||
<div style="width: 50%; float: left;">
|
||||
<div style="width: 50%; float: left; margin-bottom: 30px;">
|
||||
|
||||
<h5>Entscheidungsverhalten der uVote Community</h5>
|
||||
<span style="float: left;">
|
||||
@ -8,12 +8,12 @@
|
||||
<br> insgesamt Dafür, Dagegen oder
|
||||
<br> Enthaltung gestimmt hat.</span>
|
||||
</div>
|
||||
<div style="width: 50%; float: right;">
|
||||
<div style="width: 50%;">
|
||||
<h5>Entscheidungsverhalten des Bundestags</h5>
|
||||
<span style="float: left">
|
||||
<span style="">
|
||||
${votes_all_bt}
|
||||
</span>
|
||||
<span style=""> Wie oft der Bundestag
|
||||
<span style="float: left;"> Wie oft der Bundestag
|
||||
<br> Dafür, Dagegen oder
|
||||
<br> Enthaltung gestimmt hat.</span>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
|
||||
|
||||
private function votes_all(){
|
||||
$votes = votes::get_all_votes();
|
||||
$result = '';
|
||||
@ -8,12 +11,15 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
switch($vote['choice']){
|
||||
case 1:
|
||||
$vote['choice'] = 'PRO';
|
||||
$vote['badge_color'] = 'badge-success';
|
||||
break;
|
||||
case 2:
|
||||
$vote['choice'] = 'CONTRA';
|
||||
$vote['choice'] = 'CON';
|
||||
$vote['badge_color'] = 'badge-important';
|
||||
break;
|
||||
case 3:
|
||||
$vote['choice'] = 'ENTH';
|
||||
$vote['choice'] = 'ENT';
|
||||
$vote['badge_color'] = 'badge-info';
|
||||
break;
|
||||
}
|
||||
//$vote['count'];
|
||||
@ -29,12 +35,15 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
switch($vote['bt_choice']){
|
||||
case 1:
|
||||
$vote['bt_choice'] = 'PRO';
|
||||
$vote['badge_color'] = 'badge-success';
|
||||
break;
|
||||
case 2:
|
||||
$vote['bt_choice'] = 'CONTRA';
|
||||
$vote['bt_choice'] = 'CON';
|
||||
$vote['badge_color'] = 'badge-important';
|
||||
break;
|
||||
case 3:
|
||||
$vote['bt_choice'] = 'ENTH';
|
||||
$vote['bt_choice'] = 'ENT';
|
||||
$vote['badge_color'] = 'badge-info';
|
||||
break;
|
||||
case 0:
|
||||
$vote['bt_choice'] = 'OFFEN';
|
||||
@ -51,6 +60,7 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
return $vars['count'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<span class="badge badge-info" style="width: 50px;">${choice}</span>
|
||||
<span class="badge badge-success" style="width: 20px; margin-left: 10px;">${count}</span>
|
||||
<span class="badge" style="">${choice}</span>
|
||||
<span class="badge ${badge_color}" style="">${count}</span>
|
||||
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div>
|
||||
<span class="badge badge-info" style="width: 50px;">${bt_choice}</span>
|
||||
<span class="badge badge-success" style="width: 20px;">${count}</span>
|
||||
<span class="badge" style="">${bt_choice}</span>
|
||||
<span class="badge ${badge_color}" style="">${count}</span>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<h5>Deine Abstimmungsquote</h5>
|
||||
<br>
|
||||
<div style="">
|
||||
<div style="float: left">Abgestimmt/</div>
|
||||
<div style="margin-left: 90px;">Offen</div>
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
|
||||
private function user_temp_votes (){
|
||||
$vars = votes::get_user_temp_votes(\SYSTEM\SECURITY\Security::getUser()->id);
|
||||
$v = $vars['voted'];
|
||||
@ -54,7 +56,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
// $vars['poll_compare'] = $this->count_all_polls();
|
||||
// $vars['poll_compare'] = $this->count_all_polls();
|
||||
$vars['choices_user_ID'] = $this->user_per_party_overall();
|
||||
$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=img&cat=frontend_logos&id=';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user