utf8 fix
This commit is contained in:
parent
2a18c523d5
commit
1acc2498c9
@ -163,7 +163,7 @@ class votes {
|
||||
'SELECT * FROM `uvote_votes` WHERE `ID` = ?;',
|
||||
array($poll_ID));
|
||||
$res = $res->next();
|
||||
$res['title'] = utf8_encode($res['title']);
|
||||
// $res['title'] = utf8_encode($res['title']);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -201,7 +201,7 @@ class votes {
|
||||
public static function write_comment($poll_ID, $c_choice, $c_txt, $c_src){
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
throw new ERROR("You need to be logged in.");}
|
||||
return \DBD\UVOTE_DATA_USER_COMMENT_INSERT::Q1(array($c_choice, $poll_ID, \SYSTEM\SECURITY\Security::getUser()->id, $c_txt, $c_src));}
|
||||
return \DBD\UVOTE_DATA_USER_COMMENT_INSERT::Q1(array($c_choice, $poll_ID, \SYSTEM\SECURITY\Security::getUser()->id, utf8_encode($c_txt), $c_src));}
|
||||
|
||||
public static function write_commentrate($c_ID, $val){
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
@ -211,8 +211,11 @@ class votes {
|
||||
public static function get_add_data(){
|
||||
return \DBD\UVOTE_DATA_USER_ADD_DATA::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id));
|
||||
}
|
||||
public static function write_poll($ID, $title, $iframe_link ){
|
||||
return \DBD\UVOTE_DATA_NEW_POLL::Q1($ID, $title, $iframe_link);
|
||||
public static function write_poll($ID, $title, $iframe_link ){
|
||||
if ($ID == -1){
|
||||
return \DBD\UVOTE_DATA_NEW_POLL::QI(array($title, $iframe_link));
|
||||
}
|
||||
return \DBD\UVOTE_DATA_UPDATE_POLL::QI(array($title, $iframe_link, $ID));
|
||||
}
|
||||
|
||||
|
||||
|
||||
13
uVote/dbd/qq/UVOTE_ACCORD_WITH_FRACTION.php
Normal file
13
uVote/dbd/qq/UVOTE_ACCORD_WITH_FRACTION.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
class UVOTE_ACCORD_WITH_FRACTION extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT uvote_votes.*
|
||||
FROM uvote_votes
|
||||
WHERE ID IN (SELECT poll_ID FROM uvote_votes_per_party WHERE party = ?
|
||||
AND choice = ?);'
|
||||
);}}
|
||||
11
uVote/dbd/qq/UVOTE_DATA_ALL_VOTES.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_ALL_VOTES.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_ALL_VOTES extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT COUNT(*) FROM uvote_data;'
|
||||
);}}
|
||||
13
uVote/dbd/qq/UVOTE_DATA_BT_INSERT.php
Normal file
13
uVote/dbd/qq/UVOTE_DATA_BT_INSERT.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_BT_INSERT extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'INSERT INTO uvote_votes_per_party
|
||||
(poll_ID, party, votes_pro, votes_contra, nr_attending, total, choice)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?);'
|
||||
);}}
|
||||
11
uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_CHOICE_BT_OVERALL.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_CHOICE_BT_OVERALL extends \SYSTEM\DB\QQ {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT COUNT(*) as "count", bt_choice FROM uvote_votes GROUP BY bt_choice;'
|
||||
);}}
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_USER_COMMENT_INSERT extends \SYSTEM\DB\QP {
|
||||
class UVOTE_DATA_NEW_POLL extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'INSERT INTO `uvote_votes` (`ID`, `title`, `iframe_link`)
|
||||
VALUES (?, ?, ?);'
|
||||
'INSERT INTO `uvote_votes` (`title`, `iframe_link`)
|
||||
VALUES (?, ?);'
|
||||
);}}
|
||||
11
uVote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_PARTY_CHOICE_PER_POLL extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT `choice` FROM `uvote_votes_per_party` WHERE `poll_ID` = ? AND `party` = ?;'
|
||||
);}}
|
||||
12
uVote/dbd/qq/UVOTE_DATA_UPDATE_POLL.php
Normal file
12
uVote/dbd/qq/UVOTE_DATA_UPDATE_POLL.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_UPDATE_POLL extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'UPDATE `uvote_votes` SET `title` = ?, `iframe_link` = ?
|
||||
WHERE ID = ?;'
|
||||
);}}
|
||||
11
uVote/dbd/qq/UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT COUNT(*) AS count FROM uvote_data WHERE `poll_ID` = ?;'
|
||||
);}}
|
||||
11
uVote/dbd/qq/UVOTE_DATA_USER_COUNT_USERS.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_USER_COUNT_USERS.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_USER_COUNT_USERS extends \SYSTEM\DB\QQ {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT COUNT(*) AS count FROM system_user;'
|
||||
);}}
|
||||
2
uVote/dbd/qq/select_user_voted_notvoted_overall.sql
Normal file
2
uVote/dbd/qq/select_user_voted_notvoted_overall.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SELECT SUM(CASE WHEN uvote_data.user_ID = 15 THEN 1 ELSE 0 END) as voted,
|
||||
SUM(CASE WHEN uvote_data.user_ID = 15 THEN 0 ELSE 1 END) as not_voted FROM uvote_data RIGHT JOIN uvote_votes ON ( uvote_data.poll_ID = uvote_votes.ID AND uvote_data.user_ID = 15);
|
||||
@ -64,7 +64,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$com['count_up'] = $rating['count'];
|
||||
$rating2 = votes::get_commentrate($com['c_ID'], 2);
|
||||
$com['count_down'] = $rating2['count'];
|
||||
$com['c_txt'] = utf8_encode($com['c_txt']);
|
||||
// $com['c_txt'] = utf8_encode($com['c_txt']);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com);
|
||||
}
|
||||
return $result;
|
||||
@ -79,7 +79,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$com['count_up'] = $rating['count'];
|
||||
$rating2 = votes::get_commentrate($com['c_ID'], 2);
|
||||
$com['count_down'] = $rating2['count'];
|
||||
$com['c_txt'] = utf8_encode($com['c_txt']);
|
||||
// $com['c_txt'] = utf8_encode($com['c_txt']);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com);
|
||||
}
|
||||
return $result;
|
||||
|
||||
4
uVote/page/default_bulletin/voteweight.tpl
Normal file
4
uVote/page/default_bulletin/voteweight.tpl
Normal file
@ -0,0 +1,4 @@
|
||||
<div style="margin-top: 20px;">
|
||||
Dein aktuelles Stimmgewicht bei dieser Abstimmung:
|
||||
<span class="badge badge-info">${voteweight}%</span>
|
||||
</div>
|
||||
@ -225,8 +225,16 @@ function submit_commentrate (c_ID, val) {
|
||||
});
|
||||
}
|
||||
|
||||
function encode_utf8(c) {
|
||||
return unescape(encodeURIComponent(c));
|
||||
}
|
||||
|
||||
function decode_utf8(c) {
|
||||
return decodeURIComponent(escape(c));
|
||||
}
|
||||
|
||||
function submit_c_data (poll_ID) {
|
||||
var c_txt = $("#c_txt_pro").val();
|
||||
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;
|
||||
|
||||
@ -48,7 +48,7 @@ class user_list_active extends SYSTEM\PAGE\Page {
|
||||
$time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']);
|
||||
$vote_count = votes::get_count_user_votes_per_poll($vote['ID']);
|
||||
|
||||
$vote['title'] = utf8_encode($vote['title']);
|
||||
// $vote['title'] = utf8_encode($vote['title']);
|
||||
$vote['time_left'] = round($time_remain/($time_span+1)*100,0);
|
||||
$vote['time_done'] = 100-$vote['time_left'];
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ function init_saimod_uvote_vote_edit(){
|
||||
|
||||
$('.btn_editvote').click(function() {
|
||||
alert ('');
|
||||
var poll_ID = $('#input_poll_ID').val();
|
||||
var poll_ID = $('#input_poll_title').attr('poll_ID');
|
||||
var title = $('#input_poll_title').val();
|
||||
var iframe_link = $('#input_poll_link').val();
|
||||
vote_data_edit(poll_ID, title, iframe_link);
|
||||
@ -33,7 +33,7 @@ function init_saimod_uvote_vote_edit(){
|
||||
function vote_data_edit (poll_ID, title, iframe_link) {
|
||||
alert('vote_data_edit');
|
||||
|
||||
$.getJSON('./api.php?call=vote&action=new_vote&poll_ID=' + poll_ID + 'title=' + title + '&iframe_link=' + iframe_link, function(data) {
|
||||
$.getJSON('./api.php?call=vote&action=new_vote&poll_ID=' + poll_ID + '&title=' + title + '&iframe_link=' + iframe_link, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
|
||||
@ -28,6 +28,7 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
|
||||
return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.tpl', $vars);*/
|
||||
|
||||
$result = '';
|
||||
// $result.=self::sai_mod_saimod_uvote_new_vote();
|
||||
$votes = votes::getAllVotesOfGroup(1);
|
||||
foreach($votes as $vote){
|
||||
$time_remain = strtotime($vote['time_end'])- microtime(true);
|
||||
@ -60,5 +61,6 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod_saimod_uvote_vote_edit_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array(
|
||||
\SYSTEM\WEBPATH(new PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.js')
|
||||
));}
|
||||
|
||||
public static function sai_mod_saimod_uvote_vote_edit_flag_css(){return \SYSTEM\LOG\JsonResult::toString(array()
|
||||
);}
|
||||
}
|
||||
@ -1,8 +1,7 @@
|
||||
<tr style="border: solid lightgray 1px;">
|
||||
<td style="padding: 5px;">
|
||||
<input id="input_poll_title" type="text" placeholder="${title}" style="width: 500px;">
|
||||
<input id="input_poll_link" type="text" placeholder="Link" style="width: 500px;">
|
||||
<input id="input_poll_id" type="text" placeholder="ID" style="">
|
||||
<input id="input_poll_title" poll_ID="${ID}" type="text" value="${title}" style="width: 500px;">
|
||||
<input id="input_poll_link" type="text" value="${iframe_link}" style="width: 500px;">
|
||||
</td>
|
||||
<td>
|
||||
Nr.${ID}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user