diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php
index cb7e5b3..2ace03d 100644
--- a/uVote/api/votes/votes.php
+++ b/uVote/api/votes/votes.php
@@ -3,6 +3,9 @@
class votes {
public static function getAllVotesOfGroup($groupid){
return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));}
+
+ 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));}
public static function getVoteOfGroup($poll_ID){
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
@@ -70,7 +73,8 @@ class votes {
return \DBD\UVOTE_DATA_BT_PER_POLL::Q1(array($poll_ID));}
public static function get_user_per_party_overall($user_ID){
- return \DBD\UVOTE_DATA_USER_PER_PARTY_OVERALL::QA(array($user_ID));}
+ return \DBD\UVOTE_DATA_USER_PER_PARTY_OVERALL::QA(array($user_ID));
+ }
public static function get_voteinfo($poll_ID){
diff --git a/uVote/dbd/qq/UVOTE_DATA_USER_PER_PARTY_OVERALL.php b/uVote/dbd/qq/UVOTE_DATA_USER_PER_PARTY_OVERALL.php
index c05faa2..e9b774f 100644
--- a/uVote/dbd/qq/UVOTE_DATA_USER_PER_PARTY_OVERALL.php
+++ b/uVote/dbd/qq/UVOTE_DATA_USER_PER_PARTY_OVERALL.php
@@ -8,8 +8,8 @@ class UVOTE_DATA_USER_PER_PARTY_OVERALL extends \SYSTEM\DB\QP {
'',
//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 LEFT JOIN uvote_votes_per_party
+ sum(case when uvote_data.choice = uvote_votes_per_party.choice then 0 else 1 end) class_MISSMATCH
+FROM uvote_data INNER JOIN uvote_votes_per_party
ON uvote_data.poll_ID = uvote_votes_per_party.poll_ID
WHERE user_ID = ? GROUP BY party;'
);}}
\ No newline at end of file
diff --git a/uVote/img/frontend_logos/vote_background.psd b/uVote/img/frontend_logos/vote_background.psd
index 575afca..92dbae0 100644
Binary files a/uVote/img/frontend_logos/vote_background.psd and b/uVote/img/frontend_logos/vote_background.psd differ
diff --git a/uVote/page/user_main/user_main.php b/uVote/page/user_main/user_main.php
index b99e676..ecd2718 100644
--- a/uVote/page/user_main/user_main.php
+++ b/uVote/page/user_main/user_main.php
@@ -6,7 +6,7 @@ class user_main extends SYSTEM\PAGE\Page {
$uv = new user_main_uVote();
$vars['uVote'] = $uv->html();
-
+
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main/main_menu.tpl'),$vars);
}
diff --git a/uVote/page/user_main_uVote/uVote.tpl b/uVote/page/user_main_uVote/uVote.tpl
index 4365782..cafa9b9 100644
--- a/uVote/page/user_main_uVote/uVote.tpl
+++ b/uVote/page/user_main_uVote/uVote.tpl
@@ -1 +1,7 @@
-${votes_all}
\ No newline at end of file
+
+
+ | Choice |
+ Vote Count |
+
+ ${votes_all}
+
\ No newline at end of file
diff --git a/uVote/page/user_main_uVote/user_main_uVote.php b/uVote/page/user_main_uVote/user_main_uVote.php
index ac704bb..3ec5a7a 100644
--- a/uVote/page/user_main_uVote/user_main_uVote.php
+++ b/uVote/page/user_main_uVote/user_main_uVote.php
@@ -1,12 +1,31 @@
votes_all();
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars);
+ return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars);
}
}
\ No newline at end of file
diff --git a/uVote/page/user_main_urVote/user_main_urVote.php b/uVote/page/user_main_urVote/user_main_urVote.php
index 987dc7b..9e2d723 100644
--- a/uVote/page/user_main_urVote/user_main_urVote.php
+++ b/uVote/page/user_main_urVote/user_main_urVote.php
@@ -3,7 +3,6 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
private function user_per_party_overall(){
$vars = votes::get_user_per_party_overall(array(\SYSTEM\SECURITY\Security::getUser()->id));
-
return print_r($vars, TRUE);
// if (!$vars['bt_total']){
@@ -16,8 +15,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
public function html(){
$vars = array();
- $vars['choices_user_ID'] = $this->user_per_party_overall();
- $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
+ $vars['choices_user_ID'] = $this->user_per_party_overall();
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urVote.tpl'),$vars);
}
diff --git a/uVote/sai/saimod_uvote_vote_edit/main.tpl b/uVote/sai/saimod_uvote_vote_edit/main.tpl
index fcfac14..c7c8cca 100644
--- a/uVote/sai/saimod_uvote_vote_edit/main.tpl
+++ b/uVote/sai/saimod_uvote_vote_edit/main.tpl
@@ -1,75 +1,27 @@
+
+
+
\ No newline at end of file
diff --git a/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js b/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js
index f954963..074bc04 100644
--- a/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js
+++ b/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js
@@ -1,7 +1,6 @@
function init_saimod_uvote_vote_edit(){
$('#vote_data_submit').click(function() {
- alert ('bla');
vote_data_edit(array(
$('#vote_title').val(title),
$('#iframe_link').val(iframe_link),
diff --git a/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php b/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php
index 05258c4..9bc0c5f 100644
--- a/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php
+++ b/uVote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php
@@ -9,6 +9,10 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
return $res->affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no data added")) : \SYSTEM\LOG\JsonResult::ok();
new \SYSTEM\LOG\INFO($vote);
}
+
+ public static function sai_mod_saimod_uvote_vote_edit_action_insertPartyChoice ($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){
+ $vars = votes::insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice);
+ }
public static function sai_mod_saimod_uvote_vote_edit(){
$vars = array();