diff --git a/uVote/api/api_uvote.php b/uVote/api/api_uvote.php index a84e4c1..b5617d9 100644 --- a/uVote/api/api_uvote.php +++ b/uVote/api/api_uvote.php @@ -11,4 +11,10 @@ class api_uvote extends \SYSTEM\API\api_login { } public static function call_vote_action_barsperusers($poll_ID){ return votes::get_barsperusers($poll_ID);} -} \ No newline at end of file + + + public static function call_img($cat, $id){ + return \SYSTEM\IMG\img::get($cat, $id); + + } +} diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 65e3a92..00350f0 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -100,7 +100,7 @@ class votes { $vote = votes::getVoteOfGroup($poll_ID); new INFO(print_r($vote, true)); - $vars = array('vote_text' => $vote['text'], 'vote_quick' => $vote['quick'], 'vote_title' => $vote['title'], 'vote_init' => $vote['initiative'], 'poll_ID' => $vote['ID'], 'time_end' => $vote['time_end']); + $vars = array('vote_text' => $vote['text'], 'vote_title' => $vote['title'], 'vote_init' => $vote['initiative'], 'poll_ID' => $vote['ID'], 'time_end' => $vote['time_end']); $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/full_vote.tpl'), $vars); return $result; } diff --git a/uVote/autoload.inc.php b/uVote/autoload.inc.php index c974a96..97a9de5 100644 --- a/uVote/autoload.inc.php +++ b/uVote/autoload.inc.php @@ -4,5 +4,5 @@ require_once dirname(__FILE__).'/path/register_path_classes.php'; require_once dirname(__FILE__).'/page/register_page_classes.php'; require_once dirname(__FILE__).'/dbd/autoload.inc.php'; - +require_once dirname(__FILE__).'/img/autoload.inc.php'; require_once dirname(__FILE__).'/api/autoload.inc.php'; \ No newline at end of file diff --git a/uVote/img/autoload.inc.php b/uVote/img/autoload.inc.php new file mode 100644 index 0000000..e137e6a --- /dev/null +++ b/uVote/img/autoload.inc.php @@ -0,0 +1,3 @@ + + +
+
Auf einen Blick
${vote_quick}
- Pro poll_ID=$poll_ID; } - - +private function js(){ + return ''; +} + public function html(){ - - $result = array(); - $result = array_merge($result,votes::get_voteinfo($this->poll_ID)); - return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$result); + $vars['js'] = $this->js(); + $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,votes::get_voteinfo($this->poll_ID)); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$vars); } } \ No newline at end of file diff --git a/uVote/page/default_bulletin/js/vote.js b/uVote/page/default_bulletin/js/vote.js new file mode 100644 index 0000000..e80a010 --- /dev/null +++ b/uVote/page/default_bulletin/js/vote.js @@ -0,0 +1,27 @@ +$('#btnvote_yes').click(function () { + alert("1"); + vote_click($(this).attr('poll_ID'),1); + alert("2"); + }); + + +$('#btnvote_no').click(function () { + vote_click($(this).attr('poll_ID'),2); + }); + +$('#btnvote_off').click(function () { + vote_click($(this).attr('poll_ID'),3); + }); + + +function vote_click (poll_ID, vote) { + $.getJSON('./api.php?call=vote&action=vote&poll_ID=' + poll_ID + '&vote=' + vote, function(data) { + var items = []; + if(data.status == true){ + alert("sucess"); + } else { + alert(data.result.message); + alert("abc") + } + }); +} \ No newline at end of file diff --git a/uVote/page/default_page/full_vote.tpl b/uVote/page/default_page/full_vote.tpl index 7f44afc..3bd648c 100644 --- a/uVote/page/default_page/full_vote.tpl +++ b/uVote/page/default_page/full_vote.tpl @@ -1,5 +1,5 @@ -
-
+ +

${vote_title}


@@ -12,6 +12,6 @@ ${vote_text}
- +
-
\ No newline at end of file + diff --git a/uVote/page/default_page/js/loadtexts.js b/uVote/page/default_page/js/loadtexts.js index 9eea037..fbb8afe 100644 --- a/uVote/page/default_page/js/loadtexts.js +++ b/uVote/page/default_page/js/loadtexts.js @@ -11,8 +11,10 @@ $(document).ready(function() { open_vote($(this).attr('poll_ID')); $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); }); - /*$('.btnvote_yes').click(function () { + $('.btnvote_yes').click(function () { + alert("1"); vote_click($(this).attr('poll_ID'),1); + alert("2"); }); $('.btnvote_no').click(function () { vote_click($(this).attr('poll_ID'),2); @@ -21,7 +23,7 @@ $(document).ready(function() { vote_click($(this).attr('poll_ID'),3); }); - $('.btn_openvoteinfo').click(function () { + /*$('.btn_openvoteinfo').click(function () { if($("#openvoteinfo"+$(this).attr('poll_ID')).is(':visible')){ $('#openvoteinfo'+$(this).attr('poll_ID')).slideUp('slow'); }else{ @@ -139,6 +141,7 @@ function vote_click (poll_ID, vote) { alert("sucess"); } else { alert(data.result.message); + alert("abc") } }); } diff --git a/uVote/page/default_page/page.html b/uVote/page/default_page/page.html index 5667f58..77518e4 100644 --- a/uVote/page/default_page/page.html +++ b/uVote/page/default_page/page.html @@ -47,7 +47,7 @@
-
+
${votelist}
@@ -56,4 +56,4 @@
- \ No newline at end of file + diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index 60c7af2..74f6a01 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -1,4 +1,4 @@ -
+