poll count
This commit is contained in:
parent
d8146cf121
commit
7e7aced5a1
@ -3,6 +3,9 @@
|
||||
class votes {
|
||||
public static function getAllVotesOfGroup($groupid){
|
||||
return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));}
|
||||
|
||||
public static function countAllPolls($group){
|
||||
return \DBD\UVOTE_DATA_COUNT_VOTES::QP($group);}
|
||||
|
||||
public static function insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){
|
||||
return \DBD\UVOTE_GENERATE_VOTELIST::QI(array($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice));}
|
||||
|
||||
11
uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php
Normal file
11
uVote/dbd/qq/UVOTE_DATA_COUNT_VOTES.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class UVOTE_DATA_COUNT_VOTES extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT COUNT(*) as "count" FROM uvote_votes WHERE group = ?'
|
||||
);}}
|
||||
@ -53,6 +53,7 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
$('#user_main').load('./?action=user_main', function(){
|
||||
|
||||
$("#register_user_form input").not("[type=submit]").jqBootstrapValidation(
|
||||
{
|
||||
preventSubmit: true,
|
||||
@ -69,8 +70,8 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
$('#feedback_submit').click(function (data){
|
||||
|
||||
send_feedback($('#feedback_text').val());
|
||||
var test = $('textarea#feedback_text').val();
|
||||
send_feedback(test);
|
||||
|
||||
});
|
||||
$('#tabs_user_main a').click(function (e) {
|
||||
@ -148,16 +149,30 @@ function vote_click (poll_ID, vote) {
|
||||
|
||||
function send_feedback (feedback) {
|
||||
|
||||
$.getJSON('./api.php?call=vote&action=feedback&feedback=' + feedback, function(data) {
|
||||
console.log("hallo3672rt2ziuzir");
|
||||
var items = [];
|
||||
alert(feedback);
|
||||
if(data.status == true){
|
||||
// $.getJSON('./api.php?call=vote&action=feedback&feedback=' + feedback, function(data) {
|
||||
// console.log("hallo3672rt2ziuzir");
|
||||
// var items = [];
|
||||
// alert(feedback);
|
||||
// if(data.status == true){
|
||||
// alert("success");
|
||||
// } else {
|
||||
// alert(data.result.message);
|
||||
// }
|
||||
// });
|
||||
|
||||
$.ajax({
|
||||
url: 'http://mojotrollz.eu/web/uVote/api.php',
|
||||
// contentType : "application/json; charset=utf-8",
|
||||
data : {
|
||||
call: 'vote',
|
||||
action: 'feedback',
|
||||
feedback: feedback
|
||||
},
|
||||
dataType : 'json',
|
||||
type : 'POST' ,
|
||||
success: function(data) {
|
||||
alert("success");
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
}});
|
||||
}
|
||||
|
||||
function open_vote (poll_ID) {
|
||||
|
||||
1
uVote/page/user_main_urVote/all_polls.tpl
Normal file
1
uVote/page/user_main_urVote/all_polls.tpl
Normal file
@ -0,0 +1 @@
|
||||
${poll_compare}
|
||||
@ -5,6 +5,7 @@
|
||||
<tr>
|
||||
<h5>${urVote_title}</h5>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<h6>${urVote_user_party_compare}</h6>
|
||||
${choices_user_ID}
|
||||
@ -12,6 +13,7 @@
|
||||
|
||||
<tr>
|
||||
${choices_bt_to_user}
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
${poll_compare}
|
||||
</div>
|
||||
@ -1,8 +1,14 @@
|
||||
<?php
|
||||
class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
private function user_to_bt(){
|
||||
private function count_all_polls (){
|
||||
$result = '';
|
||||
$vars = votes::countAllPolls(1);
|
||||
new INFO('bla'.print_r($vars, true));
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function user_to_bt(){
|
||||
//$vars = votes::get_user_per_party_overall($user_ID);
|
||||
$result = '';
|
||||
$con = new \SYSTEM\DB\Connection();
|
||||
@ -42,6 +48,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
$vars = array();
|
||||
$vars['choices_user_ID'] = $this->user_per_party_overall();
|
||||
$vars['choices_bt_to_user'] = $this->user_to_bt();
|
||||
$vars['poll_compare'] = $this->count_all_polls();
|
||||
$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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user