started massive cleaning
This commit is contained in:
parent
3213db86a0
commit
35286b86f1
@ -4,7 +4,7 @@ class lists{
|
||||
public static function generate_votelist($filter){
|
||||
$result = array('','');
|
||||
if(!$filter){
|
||||
$votes = votes::getAllVotesOfGroup(1);
|
||||
$votes = \SQL\UVOTE_GENERATE_VOTELIST::QA(array(1));
|
||||
}
|
||||
else{
|
||||
$votes = \SQL\UVOTE_GENERATE_VOTELIST_FILTERED::QA(array(1, $filter));
|
||||
@ -12,7 +12,7 @@ class lists{
|
||||
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_count = \SQL\UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL::Q1(array($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);
|
||||
@ -50,7 +50,7 @@ class lists{
|
||||
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_count = \SQL\UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL::Q1(array($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);
|
||||
|
||||
@ -1,17 +1,9 @@
|
||||
<?php
|
||||
|
||||
class votes {
|
||||
public static function getAllVotesOfGroup($groupid){
|
||||
return \SQL\UVOTE_GENERATE_VOTELIST::QA(array($groupid));}
|
||||
|
||||
public static function getAllExpVotesOfGroup($groupid){
|
||||
return \SQL\UVOTE_GENERATE_VOTELIST_EXP::QA(array($groupid));}
|
||||
|
||||
public static function countAllPolls(){
|
||||
$res = \SQL\UVOTE_DATA_COUNT_VOTES::QQ();
|
||||
return $res;}
|
||||
|
||||
|
||||
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));
|
||||
@ -110,9 +102,6 @@ class votes {
|
||||
public static function get_user_count(){
|
||||
return \SQL\UVOTE_DATA_USER_COUNT_USERS::Q1(array());}
|
||||
|
||||
public static function get_count_user_votes_per_poll($poll_ID){
|
||||
return \SQL\UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL::Q1(array($poll_ID));}
|
||||
|
||||
public static function get_user_per_party_overall($user_ID){
|
||||
return \SQL\UVOTE_DATA_USER_PER_PARTY_OVERALL::QA(array($user_ID));
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
@ -2,7 +2,7 @@
|
||||
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_comment','');
|
||||
//SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_comment','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_impressum','');
|
||||
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_start','');
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
<?php
|
||||
class default_comment 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_pro_comments (){
|
||||
$result = '';
|
||||
$vars = votes::getUserComments($this->poll_ID, 1);
|
||||
foreach($vars as $com){
|
||||
$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){
|
||||
$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 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_page\css\default_page.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['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['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\locale::getStrings(SQL\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(100));
|
||||
|
||||
$vars = array_merge($vars,votes::get_voteinfo($this->poll_ID));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_comment/tpl/comment.tpl'),$vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
<div><font size="1">${timestamp}</font></div>
|
||||
<div>${c_txt}</div>
|
||||
<div><font size="2">${c_src}</font></div>
|
||||
<br>
|
||||
@ -1,6 +0,0 @@
|
||||
.row {
|
||||
margin-right: 30px;
|
||||
}
|
||||
#cover_style {
|
||||
margin-right: 25px;
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
.row {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.span6 {
|
||||
float: right
|
||||
}
|
||||
|
||||
.span6#iframe_ {
|
||||
width: 50%;
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
.row#row_loggedinform {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.btn#btn_loggedinform {
|
||||
margin-left: 150px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
.btn btn-primary#login_submit {
|
||||
float: right;
|
||||
height: 32px;
|
||||
font-size: 13px;
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
body {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.panel-heading :hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.main_container {
|
||||
}
|
||||
|
||||
.modal {
|
||||
float: left;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.navbar-inner {
|
||||
padding-left: 50px;
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
#site-content {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#user_main {
|
||||
padding: 0;
|
||||
padding-top: 0px;
|
||||
width: 50%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#user_list {
|
||||
padding: 0px;
|
||||
width: 49%;
|
||||
float: right;
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
.btn#btn_register_form {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.control-group{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#remember_me {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
#help-block-user-password-combi-wrong {
|
||||
display: none;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.btn btn-primary#btn-primary_register_form {
|
||||
clear: left;
|
||||
height: 32px;
|
||||
font-size: 13px;
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
|
||||
|
||||
#vote_sub1 {
|
||||
float: left;
|
||||
width: 75%;
|
||||
padding: 5px;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
#vote_sub2 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#vote_sub3 {
|
||||
width: 100%;
|
||||
height: 125px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#bt_vote_class_ {
|
||||
float: left;
|
||||
width: 80px;
|
||||
border-left: 1px solid lightgray;
|
||||
padding-right: 2px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
#uv_vote_class_ {
|
||||
float: left;
|
||||
height: 125px;
|
||||
width: 60px;
|
||||
border-left: 1px solid lightgray;
|
||||
padding-right: 2px;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
#time_done {
|
||||
background: white;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#vote_sub_3_1 {
|
||||
width: 5px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#vote_sub_3_2 {
|
||||
width: 5px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#time_left {
|
||||
background: blue;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
#vote_bt_span {
|
||||
float:right;
|
||||
}
|
||||
@ -14,15 +14,6 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
private function css(){
|
||||
return \SYSTEM\HTML\html::link(\LIB\lib_bootstrap::css()).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/default_page.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/full_vote.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/cover.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/vote.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/vote_bt.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/loggedinformtop.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/register_form.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/parties_on_vote.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/loggedinform.css')).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/loginform.css')).
|
||||
\SYSTEM\HTML\html::link(\LIB\lib_font_awesome::css())
|
||||
;
|
||||
}
|
||||
@ -30,21 +21,21 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
public function getloggedinform(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinform.tpl'),array());}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/login/loggedinform.tpl'),array());}
|
||||
|
||||
public function exchange_registerform(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/register_form.tpl'),array());}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/login/register_form.tpl'),array());}
|
||||
|
||||
public function getloginform(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loginform.tpl'),array());}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/login/loginform.tpl'),array());}
|
||||
|
||||
public function exchange_loginform(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinformtop.tpl'),array());}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/login/loggedinformtop.tpl'),array());}
|
||||
|
||||
public function get_menu(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/menu.tpl'),array());}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/menu/menu.tpl'),array());}
|
||||
public function exchange_menu(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/menu_loggedout.tpl'),array());}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/menu/menu_loggedout.tpl'),array());}
|
||||
|
||||
public function html($_escaped_fragment_ = NULL){
|
||||
$vars = array();
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
function getuserpersonaldata()
|
||||
{
|
||||
var userInput = document.getElementById("userInput").value;
|
||||
document.write(userInput);
|
||||
}
|
||||
|
||||
@ -35,51 +35,6 @@ function register_logout(){
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/*function account_create(inputEmail, inputPassword){
|
||||
$.get('./api.php?call=account&action=create&username=' + NULL + '&password_sha=' + password + '&email=' + email + '&locale=deDE', function (data) {
|
||||
dataTmp = data;
|
||||
}).complete(function() {
|
||||
|
||||
});
|
||||
}*/
|
||||
|
||||
function load_openvoteinfo (poll_ID){
|
||||
var openvoteinfo;
|
||||
$.get('./api.php?page=openinfo&poll_ID=' + poll_ID, function (data) {
|
||||
openvoteinfo = data;
|
||||
bodyelem = $("");
|
||||
bodyelem.animate();
|
||||
}).complete(function() {
|
||||
$('#openvoteinfo'+poll_ID).slideUp({duration: 'slow',
|
||||
complete: function(){
|
||||
$('#openvoteinfo'+poll_ID).html(openvoteinfo);
|
||||
$('#openvoteinfo'+poll_ID).slideDown('slow');
|
||||
site_content_is_visible = true;
|
||||
}});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function get_barsperparty (poll_ID) {
|
||||
$.get('./api.php?call_bars_action_getbarsperparty&poll_ID=' + poll_ID, function (data) {
|
||||
dataTmp = data;
|
||||
}).complete(function() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function submit_commentrate (c_ID, val) {
|
||||
alert('success');
|
||||
$.getJSON('./api.php?call=vote&action=commentrate&c_ID=' + c_ID + '&val=' + val, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function encode_utf8(c) {
|
||||
return unescape(encodeURIComponent(c));
|
||||
}
|
||||
@ -88,108 +43,3 @@ function decode_utf8(c) {
|
||||
return decodeURIComponent(escape(c));
|
||||
}
|
||||
|
||||
function submit_c_data (poll_ID) {
|
||||
var c = $("#c_txt_pro").val();
|
||||
var c_src = $("#c_src_pro").val();
|
||||
var a = document.getElementById("side_select");
|
||||
var c_choice = a.options[a.selectedIndex].value;
|
||||
$.getJSON('./api.php?call=vote&action=comment&poll_ID=' + poll_ID + '&c_choice=' + c_choice + '&c_txt=' + c_txt + '&c_src=' + c_src, 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_add_data () {
|
||||
var a = document.getElementById("location");
|
||||
var location = a.options[a.selectedIndex].text;
|
||||
var b = document.getElementById("birthyear");
|
||||
var birthyear = b.options[b.selectedIndex].text;
|
||||
var c = document.getElementById("gender");
|
||||
var gender = c.options[c.selectedIndex].text;
|
||||
var d = document.getElementById("children");
|
||||
var children = d.options[d.selectedIndex].text;
|
||||
$.getJSON('./api.php?call=vote&action=data&location=' + location + '&birthyear=' + birthyear + '&gender=' + gender + '&children=' + children, function(data) {
|
||||
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function send_feedback (feedback) {
|
||||
var val = JSON.stringify(feedback);
|
||||
console.log("feedback called");
|
||||
$.ajax({
|
||||
url: './api.php',
|
||||
// contentType : "application/json; charset=utf-8",
|
||||
data : {
|
||||
'call': 'vote',
|
||||
'action': 'feedback',
|
||||
'feedback': val
|
||||
},
|
||||
type : 'POST',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function() {
|
||||
alert("success");
|
||||
},
|
||||
error: function(error){
|
||||
alert("something failed..."+error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadAjaxContent(url) {
|
||||
var dataTmp;
|
||||
$.get(url, function (data) {
|
||||
dataTmp = data;
|
||||
bodyelem = $("html,body");
|
||||
bodyelem.animate();
|
||||
}).complete(function() {
|
||||
$('#site-content-wrapper').slideUp({duration: 'slow',
|
||||
complete: function(){
|
||||
$('#site-content').html(dataTmp);
|
||||
$('#site-content-wrapper').slideDown('slow');
|
||||
site_content_is_visible = true;
|
||||
}});
|
||||
});
|
||||
}
|
||||
function loadUrlPic(url_pic) {
|
||||
var dataTmp;
|
||||
$.get(url_pic, function (data) {
|
||||
dataTmp = data;
|
||||
bodyelem = $("html,body");
|
||||
bodyelem.animate();
|
||||
}).complete(function() {
|
||||
$('.carousel-inner').slideUp({duration: 'slow',
|
||||
complete: function(){
|
||||
$('#pic').html(dataTmp);
|
||||
$('.carousel-inner').slideDown('slow');
|
||||
site_content_is_visible = true;
|
||||
}});
|
||||
});
|
||||
}
|
||||
|
||||
function loadApiPic(id) {
|
||||
var dataTmp;
|
||||
$.get('./api.php?call=img&id='+id, function (data) {
|
||||
dataTmp = data;
|
||||
bodyelem = $("html,body");
|
||||
bodyelem.animate();
|
||||
}).complete(function() {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<div class="row">
|
||||
<img src="${frontend_logos}cover.png"/>
|
||||
<div id="cover_style">
|
||||
<img src="${frontend_logos}chrome.png" width="200px"/>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,4 +0,0 @@
|
||||
<div class="${bt_vote_class}" style="width: 80px; margin-top: 10px; border-left: 1px solid lightgray;">
|
||||
<img src="${frontend_logos}icon_${party}.png" width="30"><span class="badge badge-success" style="float:right;">${choice}</span><br>
|
||||
|
||||
</div>
|
||||
@ -1,2 +0,0 @@
|
||||
<img src="${frontend_logos}icon_${party}.png" width="30">
|
||||
<span id="vote_bt_span" class="badge ${choice_class}">${choice}</span><br>
|
||||
@ -1 +0,0 @@
|
||||
<span class="badge ${badge}">${perc}%</span>
|
||||
10
uvote/page/default_register/css/default_register.css
Normal file
10
uvote/page/default_register/css/default_register.css
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
/*
|
||||
Created on : 27.10.2015, 10:58:16
|
||||
Author : Nael
|
||||
*/
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
.panel-group#accordion {
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
#carousel-example-generic {
|
||||
width: 50%; float: left;
|
||||
}
|
||||
|
||||
#graph_bt_uv_overall {
|
||||
float: left;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#register_username {
|
||||
margin-bottom: 15px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#register-help-block-username {
|
||||
float: left;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
#register_email {
|
||||
margin-bottom: 15px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#register-help-block-email {
|
||||
float: left;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
#change_user_password_sub {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#user_register_password1 {
|
||||
margin-bottom: 15px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#user_register_password2 {
|
||||
margin-bottom: 15px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#help-block_register {
|
||||
float: left;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
#help-block_register2 {
|
||||
float: left;
|
||||
margin-top: 3px;
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
class default_register extends SYSTEM\PAGE\Page {
|
||||
|
||||
private function css(){
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_register/css/register.css').'" rel="stylesheet">';}
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_register/css/default_register.css').'" rel="stylesheet">';}
|
||||
public static function js(){
|
||||
return array(\SYSTEM\WEBPATH(new \PPAGE(),'default_register/js/default_register.js'));}
|
||||
public function html(){
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
function init_default_register(){
|
||||
register_registerform();
|
||||
}
|
||||
function register_registerform(){
|
||||
function register_registerform(){
|
||||
//console.log("wegwegwegwegwegweg");
|
||||
$("#register_user_form input").not("[type=submit]").jqBootstrapValidation(
|
||||
{
|
||||
|
||||
@ -1,111 +1,111 @@
|
||||
<div class="panel-group" id="accordion">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<i class="glyphicon glyphicon-bookmark"></i> Willkommen auf uvote.eu!
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body row">
|
||||
|
||||
<div id="loggedout_text" class="col-md-6" style="border-right: #d9edf7 solid 2px;">
|
||||
${welcome_text}
|
||||
</div>
|
||||
<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>
|
||||
<th style="width: 200px;">${user_name_register}</th>
|
||||
<td>
|
||||
<div class="control-group controls">
|
||||
<input type="text"
|
||||
id="register_username"
|
||||
placeholder="${ari_name}"
|
||||
minlength="3" data-validation-minlength-message="${register_user_name_too_short}"
|
||||
required data-validation-required-message="${register_user_name_required}"/>
|
||||
<br/>
|
||||
<div id="register-help-block-username" class="help-block"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>${user_email_register}</th>
|
||||
<td>
|
||||
<div class="control-group controls">
|
||||
<input type="email"
|
||||
id="register_email"
|
||||
placeholder="${ari_mail}"
|
||||
data-validation-email-message="${mail_format_wrong}"
|
||||
required data-validation-required-message="${register_email_required}"/>
|
||||
<br/>
|
||||
<div id="register-help-block-email" class="help-block"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>${user_password_register}</th>
|
||||
<td>
|
||||
<div class="control-group" id="change_user_password">
|
||||
<div class="control-group controls" id="change_user_password_sub">
|
||||
<input type="password"
|
||||
id="user_register_password1"
|
||||
name="user_register_password1"
|
||||
placeholder="${ari_pass}"
|
||||
minlength="5" data-validation-minlength-message="${register_password_too_short}"
|
||||
required data-validation-required-message="${register_password_required}"/>
|
||||
<br/>
|
||||
<div class="help-block" id="help-block_register"></div>
|
||||
</div>
|
||||
<div class="control-group controls" style="clear: both">
|
||||
<input type="password"
|
||||
id="user_register_password2"
|
||||
name="user_register_password2"
|
||||
placeholder="${ari_pass}"
|
||||
data-validation-matches-match="user_register_password1"
|
||||
data-validation-matches-message="${register_password_dont_match}"/>
|
||||
<br/>
|
||||
<div class="help-block" id="help-block_register2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<th>${locale}</th>
|
||||
<td>
|
||||
<div id="change_user_locale">
|
||||
<select size="1" id="register_locale_select">
|
||||
<option value="deDE">deDE</option>
|
||||
<option value="enUS">enUS</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="btn btn-primary" type="submit"><i class="glyphicon glyphicon-play-circle"></i> ${register}</button>
|
||||
<div style="display: none" id="help-block-user-password-combi-wrong">Registrierung Fehlgeschlagen</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-group" id="accordion">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<i class="glyphicon glyphicon-bookmark"></i> Willkommen auf uvote.eu!
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body row">
|
||||
|
||||
<div id="loggedout_text" class="col-md-6" style="border-right: #d9edf7 solid 2px;">
|
||||
${welcome_text}
|
||||
</div>
|
||||
<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>
|
||||
<th style="width: 200px;">${user_name_register}</th>
|
||||
<td>
|
||||
<div class="control-group controls">
|
||||
<input type="text"
|
||||
id="register_username"
|
||||
placeholder="${ari_name}"
|
||||
minlength="3" data-validation-minlength-message="${register_user_name_too_short}"
|
||||
required data-validation-required-message="${register_user_name_required}"/>
|
||||
<br/>
|
||||
<div id="register-help-block-username" class="help-block"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>${user_email_register}</th>
|
||||
<td>
|
||||
<div class="control-group controls">
|
||||
<input type="email"
|
||||
id="register_email"
|
||||
placeholder="${ari_mail}"
|
||||
data-validation-email-message="${mail_format_wrong}"
|
||||
required data-validation-required-message="${register_email_required}"/>
|
||||
<br/>
|
||||
<div id="register-help-block-email" class="help-block"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>${user_password_register}</th>
|
||||
<td>
|
||||
<div class="control-group" id="change_user_password">
|
||||
<div class="control-group controls" id="change_user_password_sub">
|
||||
<input type="password"
|
||||
id="user_register_password1"
|
||||
name="user_register_password1"
|
||||
placeholder="${ari_pass}"
|
||||
minlength="5" data-validation-minlength-message="${register_password_too_short}"
|
||||
required data-validation-required-message="${register_password_required}"/>
|
||||
<br/>
|
||||
<div class="help-block" id="help-block_register"></div>
|
||||
</div>
|
||||
<div class="control-group controls" style="clear: both">
|
||||
<input type="password"
|
||||
id="user_register_password2"
|
||||
name="user_register_password2"
|
||||
placeholder="${ari_pass}"
|
||||
data-validation-matches-match="user_register_password1"
|
||||
data-validation-matches-message="${register_password_dont_match}"/>
|
||||
<br/>
|
||||
<div class="help-block" id="help-block_register2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<th>${locale}</th>
|
||||
<td>
|
||||
<div id="change_user_locale">
|
||||
<select size="1" id="register_locale_select">
|
||||
<option value="deDE">deDE</option>
|
||||
<option value="enUS">enUS</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="btn btn-primary" type="submit"><i class="glyphicon glyphicon-play-circle"></i> ${register}</button>
|
||||
<div style="display: none" id="help-block-user-password-combi-wrong">Registrierung Fehlgeschlagen</div>
|
||||
</div>
|
||||
</form>
|
||||
</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>
|
||||
</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>
|
||||
|
||||
@ -15,16 +15,17 @@ class page_uvote extends \SYSTEM\API\api_default {
|
||||
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_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 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()){
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
function init_user_main_analysis(){
|
||||
|
||||
/* toggle little arrows on panel elements (for all) */
|
||||
$('.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 -------- */
|
||||
/* -------- clickhandlers for basic_stats_tab -------- */
|
||||
$('#a_acc_2').click(function () {
|
||||
var set = 'basic';
|
||||
var cat = 'user';
|
||||
@ -28,10 +25,7 @@ $('#a_acc_10').click(function () {
|
||||
load_tab(set, cat, body);
|
||||
});
|
||||
|
||||
/* -------- clickhandlers for bilance_stats_tab --------
|
||||
----------- set specifies tab type, --------
|
||||
----------- cat specifies perspective, --------
|
||||
----------- body specifies load-to element -------- */
|
||||
/* -------- clickhandlers for bilance_stats_tab -------- */
|
||||
$('#a_acc_3').click(function () {
|
||||
var set = 'bilance';
|
||||
var cat = 'user';
|
||||
@ -57,10 +51,7 @@ $('#a_acc_11').click(function () {
|
||||
load_tab(set, cat, body);
|
||||
});
|
||||
|
||||
/* -------- clickhandlers for bilance_choice_stats_tab --------
|
||||
----------- set specifies tab type, --------
|
||||
----------- cat specifies perspective, --------
|
||||
----------- body specifies load-to element -------- */
|
||||
/* -------- clickhandlers for bilance_choice_stats_tab -------- */
|
||||
$('#a_acc_4').click(function () {
|
||||
var set = 'bilance_choice';
|
||||
var cat = 'user_party';
|
||||
@ -91,6 +82,8 @@ $('#a_acc_5').click(function () {
|
||||
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));
|
||||
});
|
||||
|
||||
/* END OF CLICKHANDLERS AND INIT FUNCTION*/
|
||||
}
|
||||
|
||||
function load_tab(set, cat, body){
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
<div id="comment_main">
|
||||
<div id="comment_sub1">${timestamp}</div>
|
||||
<a style="float: right" class="btn btn-warning btn-mini c_spam" c_ID="${c_ID}"><i class="icon-white icon-exclamation-sign"></i></a>
|
||||
<div id="comment_sub2"></div>
|
||||
<div>${c_txt}</div>
|
||||
<br>
|
||||
<div id="comment_sub3">
|
||||
${count_up}
|
||||
<a class="btn btn-success btn-mini c_up" c_ID="${c_ID}"><i class="icon-white icon-thumbs-up"></i></a>
|
||||
${count_down}
|
||||
<a class="btn btn-danger btn-mini c_down" c_ID="${c_ID}"><i class="icon-white icon-thumbs-down"></i></a>
|
||||
<div id="comment_sub4">Quelle:<font size="2">${c_src}</font></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
@ -97,6 +97,8 @@
|
||||
<div class="panel-body" id="poll_4_body">
|
||||
<div class="row">
|
||||
${vote_buttons}
|
||||
</div>
|
||||
<div class="row">
|
||||
${voice_weight}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
8
uvote/page/user_main_poll/tpl/stats/voteweight.tpl
Normal file
8
uvote/page/user_main_poll/tpl/stats/voteweight.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
<div class="col-md-8">
|
||||
Dein aktuelles Stimmgewicht bei dieser Abstimmung:
|
||||
<span class="badge badge-info">${voteweight}%</span>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
Gesamt: <span class="badge badge-info">${count}</span> Stimme/n
|
||||
</div>
|
||||
@ -1,12 +0,0 @@
|
||||
|
||||
<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>
|
||||
@ -1,4 +0,0 @@
|
||||
<div style="margin-top: 20px;">
|
||||
Dein aktuelles Stimmgewicht bei dieser Abstimmung:
|
||||
<span class="badge badge-info">${voteweight}%</span>
|
||||
</div>
|
||||
@ -18,58 +18,54 @@ class user_main_poll extends SYSTEM\PAGE\Page {
|
||||
'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending']);
|
||||
if($vote['party_yes'] == '0' && $vote['party_no'] == '0' && $vote['party_ent'] == '0'){
|
||||
$vote['party_ent'] = 100;}
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_bt.tpl'),$vote);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/vote_bt.tpl'),$vote);
|
||||
}
|
||||
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(),'user_main_poll/tpl/bars_user.tpl'),$bars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/bars_user.tpl'),$bars);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function bars_bt(){
|
||||
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
|
||||
$info = votes::get_voteinfo($this->poll_ID, 1);
|
||||
if (!$vars['bt_total']){
|
||||
|
||||
$var['disclaimer'] = 'Keine differenzierten Ergebnisse für den Bundestag verfügbar';
|
||||
$var['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$var['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($var['choice_full'] == 'open'){
|
||||
$var['choice_full'] = 'noch nicht';
|
||||
}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $var);
|
||||
$var['disclaimer'] = 'Keine differenzierten Ergebnisse für den Bundestag verfügbar';
|
||||
$var['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$var['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($var['choice_full'] == 'open'){
|
||||
$var['choice_full'] = 'noch nicht';
|
||||
}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/table_bt_choice.tpl'), $var);
|
||||
}
|
||||
|
||||
$vars['disclaimer'] = '';
|
||||
$vars['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$vars['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($vars['choice_full'] == 'open'){
|
||||
$vars['disclaimer'] = '';
|
||||
$vars['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$vars['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($vars['choice_full'] == 'open'){
|
||||
$vars['choice_full'] = 'noch nicht';
|
||||
}
|
||||
$vars['choice_show'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $vars);
|
||||
}
|
||||
$vars['choice_show'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/table_bt_choice.tpl'), $vars);
|
||||
$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(),'user_main_poll/tpl/table_bt.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/table_bt.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function voice_weight(){
|
||||
$vars = votes::get_count_user_votes_per_poll($this->poll_ID);
|
||||
$vars = \SQL\UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL::Q1(array($this->poll_ID));
|
||||
$vars['voteweight'] = $vars['count'] ? round(1/$vars['count']*100) : 'no votes';
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/voteweight.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/voteweight.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function vote_buttons($poll_expired,$user_poll){
|
||||
if($poll_expired){
|
||||
private function vote_buttons($user_poll){
|
||||
if(!$user_poll){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons_fresh.tpl', array('poll_ID'=>$this->poll_ID)));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/buttons/vote_buttons_fresh.tpl', array('poll_ID'=>$this->poll_ID)));
|
||||
}
|
||||
$classes = array('','','');
|
||||
switch($user_poll){
|
||||
@ -79,21 +75,13 @@ class user_main_poll extends SYSTEM\PAGE\Page {
|
||||
default: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'','choice'=>'');
|
||||
}
|
||||
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons.tpl'), $classes);
|
||||
|
||||
} else {
|
||||
return 'ye soon to come infos';
|
||||
}
|
||||
}
|
||||
private function get_voteinfo(){
|
||||
$var = votes::get_voteinfo($this->poll_ID, 1);
|
||||
return $var['iframe_link'];
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/buttons/vote_buttons.tpl'), $classes);
|
||||
|
||||
}
|
||||
public static function js(){
|
||||
return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_poll/js/user_main_poll.js'));}
|
||||
|
||||
public function html(){
|
||||
$poll_expired = \SQL\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID, 1));
|
||||
$user_vote = votes::getUserPollData($this->poll_ID);
|
||||
$vars = array();
|
||||
$vars = array_merge($vars, votes::get_voteinfo($this->poll_ID, 1));
|
||||
@ -102,12 +90,11 @@ class user_main_poll extends SYSTEM\PAGE\Page {
|
||||
$vars['bars_user'] = $this->bars_user();
|
||||
$vars['bars_bt'] = $this->bars_bt();
|
||||
$vars['voice_weight'] = $this->voice_weight();
|
||||
$vars['vote_buttons'] = $this->vote_buttons($poll_expired, $user_vote);
|
||||
$vars['vote_buttons'] = $this->vote_buttons($user_vote);
|
||||
$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['vote'] = $this->get_voteinfo(); //votes::getVoteOfGroup($poll_ID);
|
||||
$result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/full_vote.tpl'), $vars);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
<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>
|
||||
@ -1,17 +0,0 @@
|
||||
<div id="comment_main">
|
||||
<div id="comment_sub1">${timestamp}</div>
|
||||
<a style="float: right" class="btn btn-warning btn-mini c_spam" c_ID="${c_ID}"><i class="icon-white icon-exclamation-sign"></i></a>
|
||||
<div id="comment_sub2"></div>
|
||||
<div>${c_txt}</div>
|
||||
<br>
|
||||
<div id="comment_sub3">
|
||||
${count_up}
|
||||
<a class="btn btn-success btn-mini c_up" c_ID="${c_ID}"><i class="icon-white icon-thumbs-up"></i></a>
|
||||
${count_down}
|
||||
<a class="btn btn-danger btn-mini c_down" c_ID="${c_ID}"><i class="icon-white icon-thumbs-down"></i></a>
|
||||
<div id="comment_sub4">Quelle:<font size="2">${c_src}</font></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
@ -1 +0,0 @@
|
||||
<h5>${urvote_party_table_desc}</h5>
|
||||
@ -1,7 +0,0 @@
|
||||
${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>
|
||||
@ -1,3 +0,0 @@
|
||||
<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}
|
||||
@ -1,12 +0,0 @@
|
||||
|
||||
<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>
|
||||
@ -1,11 +0,0 @@
|
||||
<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>
|
||||
@ -1,24 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h5>Ändere deine Stimme hier ab</h5>
|
||||
<button id="btnvote_yes" class="btn btn_vote ${yes} btn-default btnvote_yes"
|
||||
style=""
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3"><span class="glyphicon glyphicon-ok-sign"></span> Pro</font></button>
|
||||
<button id="btnvote_no" class="btn btn_vote ${no} btn-default btnvote_no"
|
||||
style=""
|
||||
href="#"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3"><span class="glyphicon glyphicon-remove-sign"></span> Contra</font></button>
|
||||
<button id="btnvote_off" class="btn btn_vote ${ent} btn-default btnvote_off"
|
||||
style=""
|
||||
href="#"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3"><span class="glyphicon glyphicon-ban-circle"></span> 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>
|
||||
@ -1,18 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h5>Stimme hier ab</h5>
|
||||
<button id="btnvote_yes" class="btn btn-success btn-default"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3"><span class="glyphicon glyphicon-ok-sign"></span> Pro</font></button>
|
||||
<button id="btnvote_no" class="btn btn-danger btn-default"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3"><span class="glyphicon glyphicon-remove-sign"></span> Contra</font></button>
|
||||
<button id="btnvote_off" class="btn btn-info btn-default"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3"><span class="glyphicon glyphicon-ban-circle"></span> Enthaltung</font></button>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h5>Noch nich Abgestimmt...</h5>
|
||||
<img class="img-responsive"src="${frontend_logos}icon_urn.png"/>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,4 +0,0 @@
|
||||
<div style="margin-top: 20px;">
|
||||
Dein aktuelles Stimmgewicht bei dieser Abstimmung:
|
||||
<span class="badge badge-info">${voteweight}%</span>
|
||||
</div>
|
||||
@ -18,58 +18,54 @@ class user_main_poll_sub extends SYSTEM\PAGE\Page {
|
||||
'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending']);
|
||||
if($vote['party_yes'] == '0' && $vote['party_no'] == '0' && $vote['party_ent'] == '0'){
|
||||
$vote['party_ent'] = 100;}
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_bt.tpl'),$vote);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/vote_bt.tpl'),$vote);
|
||||
}
|
||||
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(),'user_main_poll/tpl/bars_user.tpl'),$bars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/bars_user.tpl'),$bars);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function bars_bt(){
|
||||
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
|
||||
$info = votes::get_voteinfo($this->poll_ID , 2);
|
||||
if (!$vars['bt_total']){
|
||||
|
||||
$var['disclaimer'] = 'Keine differenzierten Ergebnisse für den Bundestag verfügbar';
|
||||
$var['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$var['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($var['choice_full'] == 'open'){
|
||||
$var['choice_full'] = 'noch nicht';
|
||||
$var['disclaimer'] = 'Keine differenzierten Ergebnisse für den Bundestag verfügbar';
|
||||
$var['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$var['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($var['choice_full'] == 'open'){
|
||||
$var['choice_full'] = 'noch nicht';
|
||||
}
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $var);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/table_bt_choice.tpl'), $var);
|
||||
}
|
||||
|
||||
$vars['disclaimer'] = '';
|
||||
$vars['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$vars['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($vars['choice_full'] == 'open'){
|
||||
$vars['disclaimer'] = '';
|
||||
$vars['choice'] = switchers::tablerow_class($info['bt_choice']);
|
||||
$vars['choice_full'] = switchers::tablerow_class($info['bt_choice']);
|
||||
if ($vars['choice_full'] == 'open'){
|
||||
$vars['choice_full'] = 'noch nicht';
|
||||
}
|
||||
$vars['choice_show'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/table_bt_choice.tpl'), $vars);
|
||||
}
|
||||
$vars['choice_show'] = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/table_bt_choice.tpl'), $vars);
|
||||
$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(),'user_main_poll/tpl/table_bt.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'uuser_main_poll/tpl/stats/table_bt.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function voice_weight(){
|
||||
$vars = votes::get_count_user_votes_per_poll($this->poll_ID);
|
||||
$vars = \SQL\UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL::Q1(array($this->poll_ID));
|
||||
$vars['voteweight'] = $vars['count'] ? round(1/$vars['count']*100) : 'no votes';
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/voteweight.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/stats/voteweight.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function vote_buttons($poll_expired,$user_poll){
|
||||
|
||||
private function vote_buttons($user_poll){
|
||||
if(!$user_poll){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons_fresh.tpl', array('poll_ID'=>$this->poll_ID)));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/buttons/vote_buttons_fresh.tpl', array('poll_ID'=>$this->poll_ID)));
|
||||
}
|
||||
$classes = array('','','');
|
||||
switch($user_poll){
|
||||
@ -78,19 +74,13 @@ class user_main_poll_sub extends SYSTEM\PAGE\Page {
|
||||
case 3: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'disabled','choice'=>'_ent'); break;
|
||||
default: $classes = array('poll_ID'=>$this->poll_ID, 'yes'=>'','no'=>'','ent'=>'','choice'=>'');
|
||||
}
|
||||
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/vote_buttons.tpl'), $classes);
|
||||
|
||||
}
|
||||
private function get_voteinfo(){
|
||||
$var = votes::get_voteinfo($this->poll_ID, 2);
|
||||
return $var['iframe_link'];
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll/tpl/butons/vote_buttons.tpl'), $classes);
|
||||
}
|
||||
|
||||
public static function js(){
|
||||
return array(\SYSTEM\WEBPATH(new \PPAGE(),'user_main_poll_sub/js/user_main_poll_sub.js'));}
|
||||
|
||||
public function html(){
|
||||
$poll_expired = \SQL\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID, 2));
|
||||
$user_vote = votes::getUserPollDataSub($this->poll_ID);
|
||||
$vars = array();
|
||||
$vars = array_merge($vars,votes::get_voteinfo_sub($this->poll_ID));
|
||||
@ -98,12 +88,11 @@ class user_main_poll_sub extends SYSTEM\PAGE\Page {
|
||||
$vars['bars_user'] = $this->bars_user();
|
||||
$vars['bars_bt'] = $this->bars_bt();
|
||||
$vars['voice_weight'] = $this->voice_weight();
|
||||
$vars['vote_buttons'] = $this->vote_buttons($poll_expired, $user_vote);
|
||||
$vars['vote_buttons'] = $this->vote_buttons($user_vote);
|
||||
$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['vote'] = $this->get_voteinfo(); //votes::getVoteOfGroup($poll_ID);
|
||||
$result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_poll_sub/tpl/full_vote.tpl'), $vars);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -12,8 +12,6 @@ class user_main_start extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user