diff --git a/uVote/api/api_uvote.php b/uVote/api/api_uvote.php index e9155f0..b747351 100644 --- a/uVote/api/api_uvote.php +++ b/uVote/api/api_uvote.php @@ -4,7 +4,14 @@ class api_uvote extends \SYSTEM\API\api_login { public static function call_vote_action_vote($poll_ID, $vote) { return votes::write_vote($poll_ID, $vote); - } + } + + public static function call_vote_action_feedback($feedback) { + new \SYSTEM\LOG\INFO($feedback); + return votes::write_feedback($feedback); + + } + public static function call_vote_action_open_vote($poll_ID) { return votes::open_vote($poll_ID); diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 10045c4..ecdd1f3 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -99,6 +99,18 @@ class votes { return JsonResult::ok(); } + public static function write_feedback($feedback){ + if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ + throw new ERROR("You need to be logged in.");} + + $con = new \SYSTEM\DB\Connection(new \DBD\uVote()); + $res = $con->prepare( 'insertFeedback', + 'INSERT INTO uvote_beta_feedback + VALUES (?, ?);', + array(\SYSTEM\SECURITY\Security::getUser()->id, $feedback)); + return JsonResult::ok(); + } + public static function open_vote($poll_ID){ diff --git a/uVote/img/frontend_logos/chrome.png b/uVote/img/frontend_logos/chrome.png index 7f6ddc5..5aed0f3 100644 Binary files a/uVote/img/frontend_logos/chrome.png and b/uVote/img/frontend_logos/chrome.png differ diff --git a/uVote/img/frontend_logos/chrome.psd b/uVote/img/frontend_logos/chrome.psd index 3b01007..7fbc6c9 100644 Binary files a/uVote/img/frontend_logos/chrome.psd and b/uVote/img/frontend_logos/chrome.psd differ diff --git a/uVote/img/frontend_logos/contra.png b/uVote/img/frontend_logos/contra.png new file mode 100644 index 0000000..46aff79 Binary files /dev/null and b/uVote/img/frontend_logos/contra.png differ diff --git a/uVote/img/frontend_logos/cover.png b/uVote/img/frontend_logos/cover.png index 0bbf86a..691f7ab 100644 Binary files a/uVote/img/frontend_logos/cover.png and b/uVote/img/frontend_logos/cover.png differ diff --git a/uVote/img/frontend_logos/cover.psd b/uVote/img/frontend_logos/cover.psd index 5cb675d..8161d92 100644 Binary files a/uVote/img/frontend_logos/cover.psd and b/uVote/img/frontend_logos/cover.psd differ diff --git a/uVote/img/frontend_logos/enth.png b/uVote/img/frontend_logos/enth.png new file mode 100644 index 0000000..568d702 Binary files /dev/null and b/uVote/img/frontend_logos/enth.png differ diff --git a/uVote/img/frontend_logos/pro.png b/uVote/img/frontend_logos/pro.png new file mode 100644 index 0000000..0255fd0 Binary files /dev/null and b/uVote/img/frontend_logos/pro.png differ diff --git a/uVote/img/frontend_logos/vote_background.psd b/uVote/img/frontend_logos/vote_background.psd new file mode 100644 index 0000000..575afca Binary files /dev/null and b/uVote/img/frontend_logos/vote_background.psd differ diff --git a/uVote/page/default_cover/cover.tpl b/uVote/page/default_cover/cover.tpl index 1bc9cc5..bced509 100644 --- a/uVote/page/default_cover/cover.tpl +++ b/uVote/page/default_cover/cover.tpl @@ -1,2 +1,6 @@ - - +
+ +
+ +
+
diff --git a/uVote/page/default_page/css/default_page.css b/uVote/page/default_page/css/default_page.css index 40ee889..04204ab 100644 --- a/uVote/page/default_page/css/default_page.css +++ b/uVote/page/default_page/css/default_page.css @@ -8,13 +8,13 @@ body { }*/ .pro{ - background: lightgreen; + background: url(http://mojotrollz.eu/web/uVote/api.php?call=img&cat=frontend_logos&id=pro.png); } .contra{ - background: lightcoral; + background: url(http://mojotrollz.eu/web/uVote/api.php?call=img&cat=frontend_logos&id=contra.png)no-repeat; } .ent{ - background: lightgray; + background: url(http://mojotrollz.eu/web/uVote/api.php?call=img&cat=frontend_logos&id=enth.png)no-repeat; } \ No newline at end of file diff --git a/uVote/page/default_page/default_page.php b/uVote/page/default_page/default_page.php index 1a80339..98c83e1 100644 --- a/uVote/page/default_page/default_page.php +++ b/uVote/page/default_page/default_page.php @@ -77,7 +77,7 @@ class default_page extends SYSTEM\PAGE\Page { public function html(){ $vars = array(); $vars['js'] = $this->js(); - $vars['css'] = $this->css(); + $vars['css'] = $this->css(); $vars['votelist'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->generate_votelist() : $this->get_coverpage() ; $vars['vote'] = $this->generate_vote(); $vars['registerform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->getloggedinform() : $this->exchange_registerform(); diff --git a/uVote/page/default_page/js/loadtexts.js b/uVote/page/default_page/js/loadtexts.js index b7db66a..35f916c 100644 --- a/uVote/page/default_page/js/loadtexts.js +++ b/uVote/page/default_page/js/loadtexts.js @@ -68,6 +68,11 @@ $(document).ready(function() { event.preventDefault(); } }); + $('#feedback_submit').click(function (data){ + + send_feedback($('#feedback_text').val()); + + }); $('#tabs_user_main a').click(function (e) { e.preventDefault(); $(this).tab('show'); @@ -79,8 +84,10 @@ $(document).ready(function() { function load_user_main_tab(action){ switch(action){ + case 'user_main_uVote': - $('#tab_uVote').load('./?action='+ action); + window.location.reload(); + $('#tab_uVote').load('./?action='+ action); return; case 'user_main_urVote': $('#tab_urVote').load('./?action='+ action); @@ -137,6 +144,20 @@ 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){ + alert("success"); + } else { + alert(data.result.message); + } + }); +} + function open_vote (poll_ID) { $('#list').load('./api.php?call=vote&action=open_vote&poll_ID=' + poll_ID, function(){ $('.btnvote_yes').click(function () { diff --git a/uVote/page/default_page/page.html b/uVote/page/default_page/page.html index 929ae35..9d0eeb3 100644 --- a/uVote/page/default_page/page.html +++ b/uVote/page/default_page/page.html @@ -46,17 +46,19 @@
-
-
+
+ + +
${votelist}
-
+
- diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index e1e1968..fcc7a5e 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -1,12 +1,18 @@ -
-
-
-

${vote_title}

- Initiiert von: ${vote_init} + +
+
+ + + + + - - - - + +
Nr.
- Politikfeld(er): - - Abstimmen + ${poll_ID}
+

${vote_title}

+ Politikfeld(er): +
+ Abstimmen +
diff --git a/uVote/page/register_page_classes.php b/uVote/page/register_page_classes.php index e6fabae..bdbfa61 100644 --- a/uVote/page/register_page_classes.php +++ b/uVote/page/register_page_classes.php @@ -7,4 +7,6 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_openinfo',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_bulletin',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_uVote',''); +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_urVote',''); +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_myVote',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_cover',''); \ No newline at end of file diff --git a/uVote/page/user_main/main_menu.tpl b/uVote/page/user_main/main_menu.tpl index 47edbb8..9962fa9 100644 --- a/uVote/page/user_main/main_menu.tpl +++ b/uVote/page/user_main/main_menu.tpl @@ -9,4 +9,5 @@
-
\ No newline at end of file +
+${uVote} \ 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 d6baa21..88347b7 100644 --- a/uVote/page/user_main/user_main.php +++ b/uVote/page/user_main/user_main.php @@ -1,8 +1,13 @@ get_main_uVote(); + $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); } } \ No newline at end of file diff --git a/uVote/page/user_main_myVote/myVote.tpl b/uVote/page/user_main_myVote/myVote.tpl new file mode 100644 index 0000000..0c759a4 --- /dev/null +++ b/uVote/page/user_main_myVote/myVote.tpl @@ -0,0 +1 @@ +test123 \ No newline at end of file diff --git a/uVote/page/user_main_myVote/user_main_myVote.php b/uVote/page/user_main_myVote/user_main_myVote.php new file mode 100644 index 0000000..537f077 --- /dev/null +++ b/uVote/page/user_main_myVote/user_main_myVote.php @@ -0,0 +1,8 @@ + - \ No newline at end of file + +
+
+

uVote BETA Feedback

+ +
+ +
\ 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 821b676..c257a32 100644 --- a/uVote/page/user_main_uVote/user_main_uVote.php +++ b/uVote/page/user_main_uVote/user_main_uVote.php @@ -1,8 +1,8 @@ +${choices_user_ID} +
\ 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 new file mode 100644 index 0000000..a7f0df1 --- /dev/null +++ b/uVote/page/user_main_urVote/user_main_urVote.php @@ -0,0 +1,8 @@ +prepare('addText' ,'INSERT INTO uvote_votes (poll_ID, title, text, p_fields, time_start, time_end) VALUES (?1, ?2, ?3, ?4, ?5, ?6);', array($poll_ID)); + return $res->affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no data added")) : \SYSTEM\LOG\JsonResult::ok(); + } + public function saimod_uvote_data_input(){ $vars = array(); return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.tpl', $vars);} @@ -7,7 +15,7 @@ class saimod_uvote_data_input extends \SYSTEM\SAI\SaiModule { public static function html_li_menu(){return '
  • data completion
  • ';} public static function right_public(){return false;} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} - public static function sai_mod_saimod_uvote_vote_edit_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array( + public static function sai_mod_saimod_uvote_data_input_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array( \SYSTEM\WEBPATH(new PSAI(),'saimod_uvote_data_input/saimod_uvote_data_input.js') ));} public static function sai_mod_saimod_uvote_data_input_flag_css(){} diff --git a/uVote/sai/saimod_uvote_vote_edit/main.tpl b/uVote/sai/saimod_uvote_vote_edit/main.tpl index 1f10019..b54e856 100644 --- a/uVote/sai/saimod_uvote_vote_edit/main.tpl +++ b/uVote/sai/saimod_uvote_vote_edit/main.tpl @@ -48,7 +48,7 @@
    Auf einen Blick

    - +
    @@ -71,4 +71,4 @@

    -Submit \ No newline at end of file +Submit \ 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 8b13789..d183a5a 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 +1,24 @@ +function init_saimod_uvote_vote_edit(){ + alert("doc ready works") + + $('#vote_data_submit').click(function () { + //vote_click($(this).attr('poll_ID')); + alert("doc ready works") +// vote_data_edit($(this).attr('poll_ID')); + $.getJSON(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_uvote_vote_edit&action=data_submit',function(){ + init__SYSTEM_SAI_uvote_vote_edit(); + }); + }); + + }; +function vote_data_edit (poll_ID, vote) { + $.getJSON('./api.php?call=vote&action=vote&poll_ID=' + poll_ID, function(data) { + var items = []; + if(data.status == true){ + alert("success"); + } else { + alert(data.result.message); + } + }); +} 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 e4cb779..0edd622 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 @@ -1,11 +1,12 @@ prepare('addText' ,'INSERT INTO uvote_votes (ID) VALUES ($1);', array($poll_ID)); + $res = $con->prepare('addText' ,'INSERT INTO uvote_votes (poll_ID, title, text, p_fields, time_start, time_end) VALUES (?1, ?2, ?3, ?4, ?5, ?6);', array($poll_ID)); return $res->affectedRows() == 0 ? \SYSTEM\LOG\JsonResult::error(new \SYSTEM\LOG\WARNING("no data added")) : \SYSTEM\LOG\JsonResult::ok(); } + 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=';