sum kind of utf-8 prob in comment function. problem is encoding in js 90% sure

This commit is contained in:
Nael 2014-03-12 19:53:55 +01:00
parent 34fdeae9c9
commit ea7262fdbc
8 changed files with 66 additions and 27 deletions

View File

@ -210,16 +210,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 ){
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
$res = $con->prepare( 'insertPoll',
'INSERT INTO uvote_votes
VALUES (?, ?, ?);',
array($ID, $title, $iframe_link));
return JsonResult::ok();
}
public static function write_feedback($feedback){
$feedback = json_decode($feedback);

View File

@ -0,0 +1,12 @@
<?php
namespace DBD;
class UVOTE_DATA_USER_COMMENT_INSERT 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 (?, ?, ?);'
);}}

View File

@ -109,14 +109,17 @@ class default_bulletin extends SYSTEM\PAGE\Page {
}
private function icons_party(){
$vars = array();
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/icons_table_parties.tpl'), $vars);
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
if (!$vars['bt_total']){
return '';}
$info = array();
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/icons_table_parties.tpl'), $info);
}
private function bars_bt(){
$vars = votes::get_bar_bt_per_poll($this->poll_ID);
if (!$vars['bt_total']){
return 'no data yet';}
return 'Keine Ergebnisse für den Bundestag verfügbar';}
$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);

View File

@ -215,7 +215,8 @@ function vote_click (poll_ID, vote) {
}
function submit_commentrate (c_ID, val) {
$.getJSON('./api.php?call=vote&action=commentrate&c_ID=' + c_ID + '&val=' + val, function(data) {
$.getJSON('./api.php?call=vote&action=commentrate&c_ID=' + c_ID + '&val=' + val, function(data) {
alert('success');
var items = [];
if(data.status == true){
} else {
@ -229,7 +230,6 @@ function submit_c_data (poll_ID) {
var c_src = $("#c_src_pro").val();
var a = document.getElementById("side_select");
var c_choice = a.options[a.selectedIndex].value;
alert(c_choice);
$.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){
@ -253,6 +253,7 @@ function submit_add_data () {
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");

View File

@ -1,12 +1,12 @@
function init_saimod_uvote_vote_edit(){
$('#vote_data_submit').click(function() {
vote_data_edit(array(
$('#vote_title').val(title),
$('#iframe_link').val(iframe_link),
$('#poll_ID').val(poll_ID)
));
$('.btn_editvote').click(function() {
alert ('');
var poll_ID = $('#input_poll_ID').val();
var title = $('#input_poll_title').val();
var iframe_link = $('#input_poll_link').val();
vote_data_edit(poll_ID, title, iframe_link);
// var data = new Array();
@ -31,7 +31,9 @@ function init_saimod_uvote_vote_edit(){
function vote_data_edit (poll_ID, title, iframe_link) {
$.getJSON('./api.php?call=vote&action=vote&poll_ID=' + poll_ID + 'title=' + title + '&iframe_link=' + iframe_link, function(data) {
alert('vote_data_edit');
$.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");

View File

@ -14,6 +14,14 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
$vars = votes::insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice);
}
public static function sai_mod_saimod_uvote_new_vote(){
$result = '';
$vote = array();
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/vote.tpl'), $vote);
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl'), array('vote' => $result));
}
public static function sai_mod_saimod_uvote_vote_edit(){
/*$vars = array();
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';

View File

@ -1,3 +1,4 @@
<table style="margin-bottom: 5px; width: 95%; border: solid lightgray 1px; background: beige;">
${vote}
${list}
</table>

View File

@ -1,6 +1,8 @@
<tr style="border: solid lightgray 1px;">
<td style="padding: 5px;">
${title}
<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="">
</td>
<td>
Nr.${ID}
@ -8,12 +10,27 @@
<td>
<a class="btn btn-primary btn-small btn_editvote" style="float:right" poll_ID="${ID}">Edit</a>
</td>
<td class="${bt_vote_class}" style="width: 80px; margin-top: 10px; border-left: 1px solid lightgray;">
cdu<span class="badge badge-success" style="float:right;">123</span><br/>
csu<span class="badge badge-important" style="float:right;">123</span><br/>
spd<span class="badge" style="float:right;">123</span><br/>
grüne<span class="badge badge-success" style="float:right;">123</span><br/>
linke<span class="badge badge-important" style="float:right;">123</span>
<td class="${bt_vote_class}" style="width: 200px; margin-top: 10px; border-left: 1px solid lightgray;">
cdu<span class="badge badge-success" style="float:left;"></span>
<span class="badge badge-important" style="float:left;">123</span>
<span class="badge" style="float:left;">123</span>
<span class="badge badge-info" style="float:left;">123</span><br/>
csu<span class="badge badge-success" style="float:left;">123</span>
<span class="badge badge-important" style="float:left;">123</span>
<span class="badge" style="float:left;">123</span>
<span class="badge badge-info" style="float:left;">123</span><br/>
spd<span class="badge badge-success" style="float:left;">123</span>
<span class="badge badge-important" style="float:left;">123</span>
<span class="badge" style="float:left;">123</span>
<span class="badge badge-info" style="float:left;">123</span><br/>
grüne<span class="badge badge-success" style="float:left;">123</span>
<span class="badge badge-important" style="float:left;">123</span>
<span class="badge" style="float:left;">123</span>
<span class="badge badge-info" style="float:left;">123</span><br/>
linke<span class="badge badge-success" style="float:left;">123</span>
<span class="badge badge-important" style="float:left;">123</span>
<span class="badge" style="float:left;">123</span>
<span class="badge badge-info" style="float:left;">123</span><br/>
</td>
<td class="" style="width: 30px; margin-top: 10px; border-left: 1px solid lightgray;">
uv