From 5a8c846c84745121d62f4b278e47acead1940ba0 Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 16 Feb 2014 03:27:00 +0100 Subject: [PATCH] uVote fixes --- uVote/api/votes/votes.php | 6 ++-- uVote/dbd/qq/UVOTE_DATA_CHOICE_OVERALL.php | 4 +-- uVote/page/default_page/default_page.php | 2 +- .../page/default_page/{page.html => page.tpl} | 2 +- uVote/page/user_main/main_menu.tpl | 11 +++++-- uVote/page/user_main/user_main.php | 17 +++------- .../user_main_myVote/user_main_myVote.php | 5 ++- uVote/page/user_main_uVote/uVote.tpl | 10 +----- .../page/user_main_uVote/user_main_uVote.php | 32 ++++--------------- 9 files changed, 29 insertions(+), 60 deletions(-) rename uVote/page/default_page/{page.html => page.tpl} (96%) diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 2b472f5..cb7e5b3 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -62,10 +62,8 @@ class votes { } public static function get_all_votes(){ - $res = \DBD\UVOTE_DATA_ALL_VOTES::Q1(); - $votes = mysql_query($res); - $result = mysql_num_rows($votes); - return $result; + $res = \DBD\UVOTE_DATA_CHOICE_OVERALL::QA(); + return $res; } public static function get_bar_bt_per_poll($poll_ID){ diff --git a/uVote/dbd/qq/UVOTE_DATA_CHOICE_OVERALL.php b/uVote/dbd/qq/UVOTE_DATA_CHOICE_OVERALL.php index bbfa635..145c5f6 100644 --- a/uVote/dbd/qq/UVOTE_DATA_CHOICE_OVERALL.php +++ b/uVote/dbd/qq/UVOTE_DATA_CHOICE_OVERALL.php @@ -1,11 +1,11 @@ uVote - + diff --git a/uVote/page/user_main/main_menu.tpl b/uVote/page/user_main/main_menu.tpl index 9962fa9..195d64f 100644 --- a/uVote/page/user_main/main_menu.tpl +++ b/uVote/page/user_main/main_menu.tpl @@ -5,9 +5,16 @@
  • myVote
  • -
    +
    ${uVote}
    -${uVote} \ No newline at end of file + +
    +
    +

    uVote BETA Feedback

    + +
    + +
    \ No newline at end of file diff --git a/uVote/page/user_main/user_main.php b/uVote/page/user_main/user_main.php index bfd927f..b99e676 100644 --- a/uVote/page/user_main/user_main.php +++ b/uVote/page/user_main/user_main.php @@ -1,19 +1,12 @@ user_all_votes(); - $vars['uVote'] = $this->get_main_uVote(); + + $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_myVote/user_main_myVote.php b/uVote/page/user_main_myVote/user_main_myVote.php index 537f077..02db8b5 100644 --- a/uVote/page/user_main_myVote/user_main_myVote.php +++ b/uVote/page/user_main_myVote/user_main_myVote.php @@ -1,8 +1,7 @@ -
    -
    -

    uVote BETA Feedback

    - -
    - -
    \ No newline at end of file +${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 291fcdc..ac704bb 100644 --- a/uVote/page/user_main_uVote/user_main_uVote.php +++ b/uVote/page/user_main_uVote/user_main_uVote.php @@ -1,31 +1,11 @@ poll_ID); - - $pbpp = ""; - foreach($partyvotes as $vote){ - $vote['party_yes'] = round($vote['votes_pro']/$vote['total']*100,0); - $vote['party_no'] = round($vote['votes_contra']/$vote['total']*100,0); - $vote['party_ent'] = round(($vote['nr_attending'] - $vote['votes_pro'] - $vote['votes_contra'])/$vote['total']*100,0); - $pbpp .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote); - } - - return $pbpp; - } +class user_main_uVote extends SYSTEM\PAGE\Page { + private function votes_all(){ + return print_r(votes::get_all_votes(),true);} - private static function user_all_votes(){ - $res = votes::get_all_votes(); - return $res; - } - - public function html(){ - $poll_data = array(); - $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(1)); - $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(2)); - $poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(3)); - - $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; + public function html(){ + $vars = array(); + $vars['votes_all'] = $this->votes_all(); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars); }