diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4b0f99 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nbproject/private diff --git a/uvote/api/api_uvote.php b/uvote/api/api_uvote.php new file mode 100644 index 0000000..7af1c13 --- /dev/null +++ b/uvote/api/api_uvote.php @@ -0,0 +1,41 @@ +id, utf8_encode($c_txt), $c_src));} + + public static function write_commentrate($c_ID, $val){ + if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ + throw new ERROR("You need to be logged in.");} + return \DBD\UVOTE_DATA_USER_COMMENTRATE_INSERT::Q1(array($c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val, $c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val));} +} diff --git a/uvote/api/votes/graphs.php b/uvote/api/votes/graphs.php new file mode 100644 index 0000000..1e36272 --- /dev/null +++ b/uvote/api/votes/graphs.php @@ -0,0 +1,27 @@ +next()){ + $result[] = array( 0 => $row['day'], + 'match' => $row['class_match'] > 0 ? round($row['class_match'] / ($row['class_match']+$row['class_mismatch']),2) : 0, + 'mismatch' => $row['class_match'] > 0 ? round($row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']),2) : 0); + } + return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; + } + + public static function graph_bt_to_user_overall_by_time ($timespan = 84600,$returnasjson = true){ + $result = array(); + $res = \DBD\UVOTE_DATA_GRAPH_BT_TO_USER_OVERALL_BY_TIME::QQ(array($timespan, \SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->id)); + while ($row = $res->next()){ + $result[] = array( 0 => $row['day'], + 'class_match' => $row['class_match'] / ($row['class_match']+$row['class_mismatch']+1), + 'class_mismatch' => $row['class_mismatch'] / ($row['class_match']+$row['class_mismatch']+1)); + } + return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result; + } + +} diff --git a/uvote/api/votes/should_be_in_backend.php b/uvote/api/votes/should_be_in_backend.php new file mode 100644 index 0000000..d382206 --- /dev/null +++ b/uvote/api/votes/should_be_in_backend.php @@ -0,0 +1,13 @@ +prepare( 'selVoteByGrp', + 'SELECT * FROM `uvote_data` WHERE `user_ID` = ? AND poll_ID = ?;', + array(\SYSTEM\SECURITY\Security::getUser()->id,$poll_ID)); + $result = $res->next(); + return $result['choice']; + } + + public static function get_barsperusers($poll_ID,$return_as_json = true){ + $con = new \SYSTEM\DB\Connection(new \DBD\uVote()); + //count + $res = $con->prepare( 'selVoteBy_count', + 'SELECT COUNT(*) as "count" FROM `uvote_data` WHERE `poll_ID` = ?;', + array($poll_ID)); + $res = $res->next(); + $result = array(); + $result['poll_ID'] = $poll_ID; + $result['count'] = $res['count'] >= 1 ? $res['count'] : 1; + //yes + $res = $con->prepare( 'selVoteBy_count', + 'SELECT COUNT(*) as "count" FROM `uvote_data` WHERE `poll_ID` = ? AND choice = 1;', + array($poll_ID)); + $res = $res->next(); + $result['yes'] = $res['count']; + + $result['yes_perc'] = $res['count'] / $result['count']; + //no + $res = $con->prepare( 'selVoteBy_count', + 'SELECT COUNT(*) as "count" FROM `uvote_data` WHERE `poll_ID` = ? AND choice = 2;', + array($poll_ID)); + $res = $res->next(); + $result['no'] = $res['count']; + $result['no_perc'] = $res['count'] / $result['count']; + //ent + $res = $con->prepare( 'selVoteBy_count', + 'SELECT COUNT(*) as "count" FROM `uvote_data` WHERE `poll_ID` = ? AND choice = 3;', + array($poll_ID)); + $res = $res->next(); + $result['ent'] = $res['count']; + $result['ent_perc'] = $res['count'] / $result['count']; + + return $return_as_json ? JsonResult::toString($result) : $result; + } + + public static function get_all_votes(){ + $res = \DBD\UVOTE_DATA_CHOICE_OVERALL::QA(); + return $res; + } + + public static function get_all_votes_bt(){ + $res = \DBD\UVOTE_DATA_CHOICE_BT_OVERALL::QA(); + return $res; + } + + public static function get_user_temp_votes($user_ID){ + return \DBD\UVOTE_DATA_TEMP_VOTES::Q1(array($user_ID, $user_ID, $user_ID));} + + public static function get_user_overall_votes($user_ID, $creationDate){ + return \DBD\UVOTE_DATA_OVERALL_VOTES::Q1(array($user_ID, $user_ID, $user_ID, $creationDate));} + + public static function get_bar_bt_per_poll($poll_ID){ + return \DBD\UVOTE_DATA_BT_PER_POLL::Q1(array($poll_ID));} + + public static function get_user_count(){ + return \DBD\UVOTE_DATA_USER_COUNT_USERS::Q1(array());} + + public static function get_count_user_votes_per_poll($poll_ID){ + return \DBD\UVOTE_DATA_USER_COUNT_CHOICE_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)); + } + public static function get_user_to_bt_overall($user_ID){ + return \DBD\UVOTE_DATA_USER_TO_BT::QA(array($user_ID)); + } + + public static function get_uvote_to_bt_overall(){ + return \DBD\UVOTE_DATA_UVOTE_TO_PARTY_OVERALL::QA(array()); + } + + public static function vote_accord_with_party($party){ + if (!\SYSTEM\SECURITY\Security::isloggedin()){ + throw new ERROR("U need to be logged in....sry bro / sis");} + $user = \SYSTEM\SECURITY\Security::getUser()->id; + $data = \DBD\UVOTE_ACCORD_WITH_FRACTION::QA(array($party,$user)); + //$data_escaped = array_walk_recursive($data, 'mysql_real_escape_string'); + return \SYSTEM\LOG\JsonResult::toString($data); + } + public static function get_users_choice_per_poll($poll_ID){ + return \DBD\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));} + + public static function get_pfields_per_poll($poll_ID){ + return \DBD\UVOTE_DATA_USERS_CHOICE_PER_POLL::QA(array($poll_ID));} + + public static function get_voteinfo($poll_ID){ + $con = new \SYSTEM\DB\Connection(new \DBD\uVote()); + $res = $con->prepare( 'selVoteByID', + 'SELECT * FROM `uvote_votes` WHERE `ID` = ?;', + array($poll_ID)); + $res = $res->next(); +// $res['title'] = utf8_encode($res['title']); + return $res; + } + + public static function get_barsperparty($poll_ID){ + return \DBD\UVOTE_DATA_PARTY_PER_POLL::QA(array($poll_ID));} + + public static function get_party_choice($poll_ID, $party){ + $res = \DBD\UVOTE_DATA_PARTY_CHOICE_PER_POLL::Q1(array($poll_ID, $party)); + return $res; + } + + public static function write_vote($poll_ID, $vote){ + 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( 'selVote', + 'SELECT * FROM `uvote_votes` WHERE `ID` = ? AND time_end < CURDATE();', + array($poll_ID)); + if ($res->next()){ + throw new ERROR('Your rights have expired!');} + + $res = $con->prepare( 'insertVote', + 'REPLACE uvote_data + VALUES (?, ?, ?, 0, NOW());', + array($poll_ID, \SYSTEM\SECURITY\Security::getUser()->id, $vote)); + return JsonResult::ok(); + } + + public static function write_data($location, $birthyear, $gender, $children){ + if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ + throw new ERROR("You need to be logged in.");} + return \DBD\UVOTE_DATA_USER_ADD_DATA_INSERT::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id, $location, $birthyear, $gender, $children, \SYSTEM\SECURITY\Security::getUser()->id, $location, $birthyear, $gender, $children));} + + public static function get_add_data(){ + return \DBD\UVOTE_DATA_USER_ADD_DATA::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id)); + } + + public static function write_feedback($feedback){ + $feedback = json_decode($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)); + new WARNING("feedback was added"); + return JsonResult::ok(); + } + + public static function open_vote($poll_ID){ + $vote = self::get_voteinfo($poll_ID); //votes::getVoteOfGroup($poll_ID); + $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/full_vote.tpl'), $vote); + return $result; + } +} diff --git a/uvote/autoload.inc b/uvote/autoload.inc new file mode 100644 index 0000000..1b688b8 --- /dev/null +++ b/uvote/autoload.inc @@ -0,0 +1,6 @@ +registerFolder(dirname(__FILE__).'/tbl/definitions/','DBD\DEFINITIONS'); +//$autoload->registerFolder(dirname(__FILE__).'/tbl/data/','DBD\DATA'); +//$autoload->registerFolder(dirname(__FILE__).'/tbl/data_processed/','DBD\DATA_PROCESSED'); \ No newline at end of file diff --git a/uvote/dbd/db/uVote.php b/uvote/dbd/db/uVote.php new file mode 100644 index 0000000..936ec7b --- /dev/null +++ b/uvote/dbd/db/uVote.php @@ -0,0 +1,8 @@ + FROM_UNIXTIME(?);' +);}} diff --git a/uvote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php b/uvote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php new file mode 100644 index 0000000..8998286 --- /dev/null +++ b/uvote/dbd/qq/UVOTE_DATA_PARTY_CHOICE_PER_POLL.php @@ -0,0 +1,11 @@ + NOW();' +);}} diff --git a/uvote/dbd/qq/UVOTE_DATA_UPDATE_POLL.php b/uvote/dbd/qq/UVOTE_DATA_UPDATE_POLL.php new file mode 100644 index 0000000..fe59a38 --- /dev/null +++ b/uvote/dbd/qq/UVOTE_DATA_UPDATE_POLL.php @@ -0,0 +1,12 @@ + NOW() ORDER BY (time_end-time_start) ASC;' +);}} \ No newline at end of file diff --git a/uvote/dbd/qq/UVOTE_GENERATE_VOTELIST_EXP.php b/uvote/dbd/qq/UVOTE_GENERATE_VOTELIST_EXP.php new file mode 100644 index 0000000..232dabb --- /dev/null +++ b/uvote/dbd/qq/UVOTE_GENERATE_VOTELIST_EXP.php @@ -0,0 +1,11 @@ + CURDATE();' +);}} \ No newline at end of file diff --git a/uvote/dbd/qq/select_bt_vs_uvote_overall_match_missmatch.sql b/uvote/dbd/qq/select_bt_vs_uvote_overall_match_missmatch.sql new file mode 100644 index 0000000..451a5f6 --- /dev/null +++ b/uvote/dbd/qq/select_bt_vs_uvote_overall_match_missmatch.sql @@ -0,0 +1,7 @@ +SELECT + SUM(CASE WHEN a.choice = c.bt_choice THEN 1 ELSE 0 END) class_match, + SUM(CASE WHEN a.choice = c.bt_choice THEN 0 ELSE 1 END) class_mismatch +FROM uvote_data as a +LEFT JOIN (Select choice, poll_ID FROM uvote_data GROUP BY choice LIMIT 1) b ON a.poll_ID = b.poll_ID +LEFT JOIN uvote_votes as c ON a.poll_ID = c.ID +WHERE bt_choice \ No newline at end of file diff --git a/uvote/dbd/qq/select_bt_vs_uvote_overall_match_missmatch_group_by_day.sql b/uvote/dbd/qq/select_bt_vs_uvote_overall_match_missmatch_group_by_day.sql new file mode 100644 index 0000000..b54fa5d --- /dev/null +++ b/uvote/dbd/qq/select_bt_vs_uvote_overall_match_missmatch_group_by_day.sql @@ -0,0 +1,9 @@ +SELECT + DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP(a.`timestamp`) - MOD(UNIX_TIMESTAMP(a.`timestamp`),86400)),"%Y/%m/%d %H:%i:%s") as day, + SUM(CASE WHEN a.choice = c.bt_choice THEN 1 ELSE 0 END) class_match, + SUM(CASE WHEN a.choice = c.bt_choice THEN 0 ELSE 1 END) class_mismatch +FROM uvote_data as a +LEFT JOIN (Select choice, poll_ID FROM uvote_data GROUP BY choice LIMIT 1) b ON a.poll_ID = b.poll_ID +LEFT JOIN uvote_votes as c ON a.poll_ID = c.ID +WHERE bt_choice +GROUP BY day \ No newline at end of file diff --git a/uvote/dbd/qq/select_user_voted_notvoted_overall.sql b/uvote/dbd/qq/select_user_voted_notvoted_overall.sql new file mode 100644 index 0000000..9c4f4e5 --- /dev/null +++ b/uvote/dbd/qq/select_user_voted_notvoted_overall.sql @@ -0,0 +1,2 @@ +SELECT SUM(CASE WHEN uvote_data.user_ID = 15 THEN 1 ELSE 0 END) as voted, + SUM(CASE WHEN uvote_data.user_ID = 15 THEN 0 ELSE 1 END) as not_voted FROM uvote_data RIGHT JOIN uvote_votes ON ( uvote_data.poll_ID = uvote_votes.ID AND uvote_data.user_ID = 15); \ No newline at end of file diff --git a/uvote/dbd/tbl/locale_string.php b/uvote/dbd/tbl/locale_string.php new file mode 100644 index 0000000..c5cfeb2 --- /dev/null +++ b/uvote/dbd/tbl/locale_string.php @@ -0,0 +1,9 @@ +${bulletin_bars_title} +${urvote_bars_user} +
+
${vote_yes_perc}%
+
${vote_no_perc}%
+
${vote_ent_perc}%
+
diff --git a/uvote/page/default_bulletin/bulletin.tpl b/uvote/page/default_bulletin/bulletin.tpl new file mode 100644 index 0000000..1c6a945 --- /dev/null +++ b/uvote/page/default_bulletin/bulletin.tpl @@ -0,0 +1,58 @@ +
+

${title}

+ ${vote_buttons} +
+ +
+
+ ${openvote_help_text} + ${title} + ${openvote_help_text1} +
+
+ ${voice_weight} +
+
+ ${bars_user}
+ ${bars_bt} +
+
+ ${icons_party} + ${choice_party} +
+
+
+
+

Kommentare

+
+
+
Pro
+ ${comments_pro} +
+
+
Contra
+ ${comments_con} +
+
+
+
+ Kommentar
+
+ Quelle
+
+
+
${submit}
+
+
+ + + + +
\ No newline at end of file diff --git a/uvote/page/default_bulletin/comment.tpl b/uvote/page/default_bulletin/comment.tpl new file mode 100644 index 0000000..e0450f9 --- /dev/null +++ b/uvote/page/default_bulletin/comment.tpl @@ -0,0 +1,17 @@ +
+
${timestamp}
+ +
+
${c_txt}
+
+
+ ${count_up} + + ${count_down} + +
Quelle:${c_src}
+
+ +
+ +
\ No newline at end of file diff --git a/uvote/page/default_bulletin/css/bars_user.css b/uvote/page/default_bulletin/css/bars_user.css new file mode 100644 index 0000000..513c5aa --- /dev/null +++ b/uvote/page/default_bulletin/css/bars_user.css @@ -0,0 +1,4 @@ +.progress#progress_bars_user { + height: 20px; + width: 350px; +} \ No newline at end of file diff --git a/uvote/page/default_bulletin/css/bulletin.css b/uvote/page/default_bulletin/css/bulletin.css new file mode 100644 index 0000000..1cb78e3 --- /dev/null +++ b/uvote/page/default_bulletin/css/bulletin.css @@ -0,0 +1,48 @@ +#bulletin_main { + float: left; + width: 100%; +} + +#bulletin_left { + float: left; +} + +#bulletin_sub1 { + margin-top: 30px; +} + +#bulletin_sub2 { + float: left; + width: 50%; + padding-top: 30px; +} + +#bulletin_sub3 { + float: right; + width: 50%; + padding-top: 30px; +} +#divider { + clear: both; +} + +#bulletin_sub4 { + padding-top: 30px; +} +#bulletin_sub5 { + padding-top: 20px; +} + +#bulletin_sub5_sub { + float: left; + width: 40%; +} + + #bulletin_sub6 { + float: right; + width: 40%; + } + + #bulletin_sub7 { + clear: both; + } \ No newline at end of file diff --git a/uvote/page/default_bulletin/css/comment.css b/uvote/page/default_bulletin/css/comment.css new file mode 100644 index 0000000..125793f --- /dev/null +++ b/uvote/page/default_bulletin/css/comment.css @@ -0,0 +1,22 @@ +#comment_main { + float: left; + width: 90%; +} + +#comment_sub1 { + float: left; + font-size: 1; +} + +#comment_sub2 { + clear: both; +} + +#comment_sub3 { + font-size: 2; +} + +#comment_sub4 { + float: right; + font-size: 1; +} \ No newline at end of file diff --git a/uvote/page/default_bulletin/default_bulletin.php b/uvote/page/default_bulletin/default_bulletin.php new file mode 100644 index 0000000..5d6361b --- /dev/null +++ b/uvote/page/default_bulletin/default_bulletin.php @@ -0,0 +1,242 @@ +poll_ID=$poll_ID;} + + public function vote_choice(){ + $vars = votes::getUserPollData($this->poll_ID); + return $this->tablerow_class($vars); + } + + private static function tablerow_class($choice){ + switch($choice){ + case 1: + return 'pro'; + case 2: + return 'con'; + case 3: + return 'ent'; + default: + return 'open'; + } + } + + private function get_party_per_poll($choice){ + switch($choice){ + case 1: + return 'PRO'; + case 2: + return 'CON'; + case 3: + return 'ENT'; + default: + return 'NONE'; + } + } + + private function choice_party (){ + $result = ''; + $party_votes = votes::get_barsperparty($this->poll_ID); + +// $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); + foreach($party_votes as $pv){ + + $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/vote_bt.tpl'), + array( 'party' => $pv['party'], + 'choice' => $this->get_party_per_poll($pv['choice']), + 'choice_class' => $this->tablerow_class($pv['choice']), + 'party_yes' => $pv['votes_pro'] > 0 ? round($pv['votes_pro']/$pv['total']*100,0) : $pv['votes_pro'], + 'party_no' => $pv['votes_contra'] > 0 ? round($pv['votes_contra']/$pv['total']*100,0) : $pv['votes_contra'], + 'party_off' => $pv['total'] > 0 ? round(($pv['total'] - $pv['nr_attending'])/$pv['total']*100,0) : $pv['total'], + 'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending'])); + } + return $result; + } + + private function get_pro_comments (){ + $result = ''; + $vars = votes::getUserComments($this->poll_ID, 1); + + foreach($vars as $com){ + $rating = votes::get_commentrate($com['c_ID'], 1); + $com['count_up'] = $rating['count']; + $rating2 = votes::get_commentrate($com['c_ID'], 2); + $com['count_down'] = $rating2['count']; +// $com['c_txt'] = utf8_encode($com['c_txt']); + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com); + } + return $result; + + } + private function get_con_comments (){ + $result = ''; + $vars = votes::getUserComments($this->poll_ID, 2); + + foreach($vars as $com){ + $rating = votes::get_commentrate($com['c_ID'], 1); + $com['count_up'] = $rating['count']; + $rating2 = votes::get_commentrate($com['c_ID'], 2); + $com['count_down'] = $rating2['count']; +// $com['c_txt'] = utf8_encode($com['c_txt']); + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com); + } + return $result; + + } + private function bars_user(){ + $bars = votes::get_barsperusers($this->poll_ID,false); + $bars['vote_yes_perc'] = round($bars['yes_perc']*100,0); + $bars['vote_no_perc'] = round($bars['no_perc']*100,0); + $bars['vote_ent_perc'] = round($bars['ent_perc']*100,0); + $bars['title'] = 'Gemessen auf uVote'; + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bars_user.tpl'),$bars); + } + + private function bars_party(){ + $partyvotes = votes::get_barsperparty($this->poll_ID); + + $result = ""; + foreach($partyvotes as $vote){ + $vote['party_yes'] = $vote['votes_pro'] > 0 ? round($vote['votes_pro']/$vote['total']*100,0) : $vote['votes_pro']; + $vote['party_no'] = $vote['votes_contra'] > 0 ? round($vote['votes_contra']/$vote['total']*100,0) : $vote['votes_contra']; + $vote['party_ent'] = $vote['nr_attending'] > 0 ? round(($vote['nr_attending'] - $vote['votes_pro'] - $vote['votes_contra'])/$vote['total']*100,0) : $vote['nr_attending']; + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote); + } + + return $result; + } + + private function icons_party(){ + $vars = votes::get_bar_bt_per_poll($this->poll_ID); + if (!$vars['bt_total']){ + return '';} + $info = array(); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/icons_table_parties.tpl'), $info); + } + + private function bars_bt(){ + $vars = votes::get_bar_bt_per_poll($this->poll_ID); + if (!$vars['bt_total']){ + return 'Keine Ergebnisse für den Bundestag verfügbar';} + $vars['bt_ent'] = round(($vars['bt_attending'] - $vars['bt_pro'] - $vars['bt_con'])/$vars['bt_total']*100,0); + $vars['bt_pro'] = round($vars['bt_pro']/$vars['bt_total']*100,0); + $vars['bt_con'] = round($vars['bt_con']/$vars['bt_total']*100,0); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_bt.tpl'), $vars); + } + + private function voice_weight(){ + $vars = votes::get_count_user_votes_per_poll($this->poll_ID); + $vars['voteweight'] = round(1/$vars['count']*100); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars); + } + + private function p_fields (){ + $result = ""; + + $list = array (array(1, 'Aussenpolitik'), + array(2, 'Aussenpolitik'), + array(4, 'Aussenpolitik'), + array(8, 'Aussenpolitik')); + foreach($list as $l){ + if($p_fields & $l[0]) $result .= $l[1]; + } + return $result; + } + + private function vote_buttons($poll_expired,$user_poll){ + if($poll_expired){ + if(!$user_poll){ + return '
Stimme hier ab
+ Pro + Contra + Enthaltung';} + $classes = array('','',''); + switch($user_poll){ + case 1: $classes = array('btn-success disabled','btn-danger','btn-info'); break; + case 2: $classes = array('btn-success','btn-danger disabled','btn-info'); break; + case 3: $classes = array('btn-success','btn-danger','btn-info disabled'); break; + default: array('','',''); + } + + return '
Ändere deine Stimme hier ab
+ Pro + Contra + Enthaltung + '; + } else { + return 'ye soon to come infos'; + } + } + + private function js(){ + return '';} + private function css(){ + return ''. + ''. + '';} + + + + public function html(){ + $poll_expired = \DBD\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID)); + $user_vote = votes::getUserPollData($this->poll_ID); + + $vars = array(); + $vars['choice_party'] = ''; + $vars['voice_weight'] = $vars['bars_user'] = $vars['bars_bt'] = ''; + $vars['bars_party'] = ''; + $vars['icons_party'] = ''; + $vars['vote_class'] = $this->vote_choice(); + $vars['comments_pro'] = ''; + $vars['comments_con'] = ''; + $vars['js'] = $this->js(); + $vars['css'] = $this->css(); + + $vars['vote_buttons'] = $this->vote_buttons($poll_expired,$user_vote); +// $vars['p_fields'] = $this->p_fields(); + if($user_vote){ + $vars['comments_pro'] = $this->get_pro_comments(); + $vars['comments_con'] = $this->get_con_comments(); + $vars['icons_party'] = $this->icons_party(); + $vars['choice_party'] = $this->choice_party(); + $vars['bars_party'] = $this->bars_party(); + $vars['bars_user'] = $this->bars_user(); + $vars['bars_bt'] = $this->bars_bt(); + $vars['voice_weight'] = $this->voice_weight(); + } + + $vars['poll_ID'] = $this->poll_ID; //put it here - so its filled in! + $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)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(100)); + + $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/icons_table_parties.tpl b/uvote/page/default_bulletin/icons_table_parties.tpl new file mode 100644 index 0000000..b082c99 --- /dev/null +++ b/uvote/page/default_bulletin/icons_table_parties.tpl @@ -0,0 +1,8 @@ +
${urvote_party_table_desc}
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/uvote/page/default_bulletin/table_bt.tpl b/uvote/page/default_bulletin/table_bt.tpl new file mode 100644 index 0000000..5e75d86 --- /dev/null +++ b/uvote/page/default_bulletin/table_bt.tpl @@ -0,0 +1,6 @@ +Ergebnis Bundestag +
+
${bt_pro}%
+
${bt_con}%
+

${bt_ent}%

+
diff --git a/uvote/page/default_bulletin/table_parties.tpl b/uvote/page/default_bulletin/table_parties.tpl new file mode 100644 index 0000000..699e779 --- /dev/null +++ b/uvote/page/default_bulletin/table_parties.tpl @@ -0,0 +1,6 @@ + +
+
${party_yes}%
+
${party_no}%
+
${party_ent}%
+
diff --git a/uvote/page/default_bulletin/vote_bt.tpl b/uvote/page/default_bulletin/vote_bt.tpl new file mode 100644 index 0000000..05813f2 --- /dev/null +++ b/uvote/page/default_bulletin/vote_bt.tpl @@ -0,0 +1,8 @@ +
+
+
${choice}
+
${party_yes}%
+
${party_no}%
+
${party_ent}%
+
${party_off}%
+
\ No newline at end of file diff --git a/uvote/page/default_bulletin/voteweight.tpl b/uvote/page/default_bulletin/voteweight.tpl new file mode 100644 index 0000000..fc5d06f --- /dev/null +++ b/uvote/page/default_bulletin/voteweight.tpl @@ -0,0 +1,4 @@ +
+ Dein aktuelles Stimmgewicht bei dieser Abstimmung: + ${voteweight}% +
\ No newline at end of file diff --git a/uvote/page/default_comment/comment.tpl b/uvote/page/default_comment/comment.tpl new file mode 100644 index 0000000..8f01cea --- /dev/null +++ b/uvote/page/default_comment/comment.tpl @@ -0,0 +1,4 @@ +
${timestamp}
+
${c_txt}
+
${c_src}
+
\ No newline at end of file diff --git a/uvote/page/default_comment/default_comment.php b/uvote/page/default_comment/default_comment.php new file mode 100644 index 0000000..32b9b0c --- /dev/null +++ b/uvote/page/default_comment/default_comment.php @@ -0,0 +1,87 @@ +poll_ID=$poll_ID;} + + public function vote_choice(){ + $vars = votes::getUserPollData($this->poll_ID); + return $this->tablerow_class($vars); + } + + private static function tablerow_class($choice){ + switch($choice){ + case 1: + return 'pro'; + case 2: + return 'con'; + case 3: + return 'ent'; + default: + return 'open'; + } + } + + + + private function get_pro_comments (){ + $result = ''; + $vars = votes::getUserComments($this->poll_ID, 1); + foreach($vars as $com){ + $com['c_txt'] = utf8_encode($com['c_txt']); + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com); + } + return $result; + + } + private function get_con_comments (){ + $result = ''; + $vars = votes::getUserComments($this->poll_ID, 2); + + foreach($vars as $com){ + $com['c_txt'] = utf8_encode($com['c_txt']); + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com); + } + return $result; + + } + + + + + + + private function js(){ + return '';} + private function css(){ + return '';} + + public function html(){ + $poll_expired = \DBD\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID)); + $user_vote = votes::getUserPollData($this->poll_ID); + + $vars = array(); + $vars['comments_pro'] = ''; + $vars['comments_con'] = ''; + $vars['js'] = $this->js(); + $vars['css'] = $this->css(); + + $vars['vote_buttons'] = $this->vote_buttons($poll_expired,$user_vote); +// $vars['p_fields'] = $this->p_fields(); + if($user_vote){ + $vars['comments_pro'] = $this->get_pro_comments(); + $vars['comments_con'] = $this->get_con_comments(); + } + + $vars['poll_ID'] = $this->poll_ID; //put it here - so its filled in! + $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)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(100)); + + $vars = array_merge($vars,votes::get_voteinfo($this->poll_ID)); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_comment/comment.tpl'),$vars); + } + +} \ No newline at end of file diff --git a/uvote/page/default_page/css/cover.css b/uvote/page/default_page/css/cover.css new file mode 100644 index 0000000..df0a719 --- /dev/null +++ b/uvote/page/default_page/css/cover.css @@ -0,0 +1,6 @@ +.row { + margin-right: 30px; +} +#cover_style { + margin-right: 25px; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/default_page.css b/uvote/page/default_page/css/default_page.css new file mode 100644 index 0000000..84f72b3 --- /dev/null +++ b/uvote/page/default_page/css/default_page.css @@ -0,0 +1,67 @@ +body { + padding-top: 60px; + padding-bottom: 40px; +} + +/*.list { + border: 2px solid #ccc; +}*/ + +.pro{ + background: #5eb95e; +} + +.con{ + background: #ee5f5b; +} + +.ent{ + background: lightgrey; +} + +.badge { + padding: 1px 9px 2px; + font-size: 12.025px; + font-weight: bold; + white-space: nowrap; + color: #ffffff; + background-color: #999999; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; +} +.badge:hover { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.badge-error { + background-color: #b94a48; +} +.badge-error:hover { + background-color: #953b39; +} +.badge-warning { + background-color: #f89406; +} +.badge-warning:hover { + background-color: #c67605; +} +.badge-success { + background-color: #468847; +} +.badge-success:hover { + background-color: #356635; +} +.badge-info { + background-color: #3a87ad; +} +.badge-info:hover { + background-color: #2d6987; +} +.badge-inverse { + background-color: #333333; +} +.badge-inverse:hover { + background-color: #1a1a1a; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/full_vote.css b/uvote/page/default_page/css/full_vote.css new file mode 100644 index 0000000..40a001f --- /dev/null +++ b/uvote/page/default_page/css/full_vote.css @@ -0,0 +1,11 @@ +.row { + margin: 0; +} + +.span6 { + float: right +} + +.span6#iframe_ { + width: 50%; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/loggedinform.css b/uvote/page/default_page/css/loggedinform.css new file mode 100644 index 0000000..5da54ab --- /dev/null +++ b/uvote/page/default_page/css/loggedinform.css @@ -0,0 +1,9 @@ +.row#row_loggedinform { + padding-bottom: 20px; +} + +.btn#btn_loggedinform { + margin-left: 150px; + height: 100px; + width: 100px; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/loggedinformtop.css b/uvote/page/default_page/css/loggedinformtop.css new file mode 100644 index 0000000..e69de29 diff --git a/uvote/page/default_page/css/loginform.css b/uvote/page/default_page/css/loginform.css new file mode 100644 index 0000000..63ce3ac --- /dev/null +++ b/uvote/page/default_page/css/loginform.css @@ -0,0 +1,20 @@ +#help-block { + float: right; + padding: 0; +} + +#controls { + float: right; + margin-right: 10px; +} + + #controls2 { + float: right; + margin-right: 20px; + } + +.btn btn-primary#login_submit { + float: right; + height: 32px; + font-size: 13px; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/page.css b/uvote/page/default_page/css/page.css new file mode 100644 index 0000000..198bc6d --- /dev/null +++ b/uvote/page/default_page/css/page.css @@ -0,0 +1,35 @@ +body { + padding-top: 60px; +} + +.main_container { +} + +.modal { + float: left; + display:none; +} + +.navbar-inner { + padding-left: 50px; + padding-right: 50px; +} + +#site-content { + padding: 0; + margin: 0; + margin-left: 35px; +} + +#user_main { + padding: 0; + padding-top: 0px; + width: 50%; + float: left; +} + +#user_list { + padding: 0px; + width: 49%; + float: right; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/parties_on_vote.css b/uvote/page/default_page/css/parties_on_vote.css new file mode 100644 index 0000000..e69de29 diff --git a/uvote/page/default_page/css/register_form.css b/uvote/page/default_page/css/register_form.css new file mode 100644 index 0000000..5984d36 --- /dev/null +++ b/uvote/page/default_page/css/register_form.css @@ -0,0 +1,23 @@ +.btn#btn_register_form { + margin-top: 0; +} + +.control-group{ + margin: 0px; + padding: 0px; +} + +#remember_me { + margin-top: -1px; +} + +#help-block-user-password-combi-wrong { + display: none; + color: red; +} + +.btn btn-primary#btn-primary_register_form { + clear: left; + height: 32px; + font-size: 13px; +} \ No newline at end of file diff --git a/uvote/page/default_page/css/vote.css b/uvote/page/default_page/css/vote.css new file mode 100644 index 0000000..a73fddb --- /dev/null +++ b/uvote/page/default_page/css/vote.css @@ -0,0 +1,69 @@ +#vote_main { + margin-bottom: 5px; + width: 100%; + min-height: 125px; + border: solid lightgray 1px; + background: beige; +} + +#vote_sub1 { + float: left; + width: 75%; + padding: 5px; + padding-top: 0; +} + +#vote_sub2 { + margin: 0; + padding: 0; + float: right; +} + +#vote_sub3 { + width: 100%; + height: 125px; + margin: 0; + padding: 0; +} + +#bt_vote_class_ { + float: left; + width: 80px; + border-left: 1px solid lightgray; + padding-right: 2px; + padding-left: 2px; +} + + #uv_vote_class_ { + float: left; + height: 125px; + width: 60px; + border-left: 1px solid lightgray; + padding-right: 2px; + padding-left: 2px; + } + +#time_done { + background: white; + margin: 0; + padding: 0; +} + +#vote_sub_3_1 { + width: 5px; + margin: 0; + padding: 0; +} + +#vote_sub_3_2 { + width: 5px; + margin: 0; + padding: 0; +} + +#time_left { + background: blue; + margin: 0; + padding: 0; +} + \ No newline at end of file diff --git a/uvote/page/default_page/css/vote_bt.css b/uvote/page/default_page/css/vote_bt.css new file mode 100644 index 0000000..7ef6333 --- /dev/null +++ b/uvote/page/default_page/css/vote_bt.css @@ -0,0 +1,3 @@ +#vote_bt_span { + float:right; +} \ No newline at end of file diff --git a/uvote/page/default_page/default_page.php b/uvote/page/default_page/default_page.php new file mode 100644 index 0000000..0a42ad4 --- /dev/null +++ b/uvote/page/default_page/default_page.php @@ -0,0 +1,168 @@ +'. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''; + } + + private function css(){ + return ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + ''. + '';} + + private function get_party_per_poll($choice){ + switch($choice){ + case 1: + return 'PRO'; + case 2: + return 'CON'; + case 3: + return 'ENT'; + default: + return 'NONE'; + } + } + + private static function tablerow_class($choice){ + switch($choice){ + case 1: + return 'pro'; + case 2: + return 'con'; + case 3: + return 'ent'; + default: + return 'open'; + } + } + + private static function badge_class($choice){ + switch($choice){ + case 1: + return 'badge-success'; + case 2: + return 'badge-important'; + case 3: + return 'badge-info'; + default: + return ''; + } + } + + public static function panel_class($choice){ + switch($choice){ + case 1: + return 'panel-success'; + case 2: + return 'panel-danger'; + case 3: + return 'panel-info'; + default: + return 'panel-default'; + } + } + + public function generate_votelist(){ + $result = array('',''); + $votes = votes::getAllVotesOfGroup(1); + foreach($votes as $vote){ + $time_remain = strtotime($vote['time_end'])- microtime(true); + $time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']); + $vote_count = votes::get_count_user_votes_per_poll($vote['ID']); + + $vote['title'] = utf8_encode($vote['title']); + $vote['time_left'] = round($time_remain/($time_span+1)*100,0); + $vote['time_done'] = 100-$vote['time_left']; + + $vote['full_vote_btn'] = $time_remain > 0 ? 'Abstimmen' : 'Ansehen'; + $vote['uv'] = $vote['bt'] = ''; + $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5'; + + $user_vote = votes::getUserPollData($vote['ID']); + $vote['vote_class'] = $this->tablerow_class($user_vote); + if($user_vote){ + //user vote + $vote['vote_class'] = $this->tablerow_class($user_vote); + + //bt vote + $party_votes = votes::get_barsperparty($vote['ID']); + $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); + foreach($party_votes as $pv){ + $vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote_bt.tpl'), + array( 'party' => $pv['party'], + 'choice' => $this->get_party_per_poll($pv['choice']), + 'choice_class' => $this->badge_class($pv['choice']))); + } + + //uvote vote + $uvote = votes::get_users_choice_per_poll($vote['ID']); + $vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : ''; + foreach($uvote as $v){ + $vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote_uv.tpl'), + array( 'badge' => self::badge_class($v['choice']), + 'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0)); + } + } + + //new panels: + $vote['panel_class'] = self::panel_class($user_vote); + + if($time_remain > 0){ + $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote); + } else { + $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote); + } + } + return $result[0].$result[1]; + } + + public function get_coverpage(){ + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/cover.tpl'), array());} + + public function getloggedinform(){ + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinform.tpl'),array());} + + public function exchange_registerform(){ + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/register_form.tpl'),array());} + + public function getloginform(){ + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loginform.tpl'),array());} + + public function exchange_loginform(){ + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinformtop.tpl'),array());} + + public function html($_escaped_fragment_ = NULL){ + $vars = array(); + if(!$_escaped_fragment_){ + $vars['js'] = $this->js();} + $vars['css'] = $this->css(); + $vars['votelist'] = $this->generate_votelist(); + $vars['registerform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->getloggedinform() : $this->exchange_registerform(); + $vars['loginform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->exchange_loginform() : $this->getloginform() ; + $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\PAGE\text::tag('uvote')); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register')); + + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/page.tpl'), $vars); + } +} \ No newline at end of file diff --git a/uvote/page/default_page/js/account_create.js b/uvote/page/default_page/js/account_create.js new file mode 100644 index 0000000..28f1e77 --- /dev/null +++ b/uvote/page/default_page/js/account_create.js @@ -0,0 +1,6 @@ +function getuserpersonaldata() +{ + var userInput = document.getElementById("userInput").value; + document.write(userInput); +} + diff --git a/uvote/page/default_page/js/loadtexts.js b/uvote/page/default_page/js/loadtexts.js new file mode 100644 index 0000000..1c7bff4 --- /dev/null +++ b/uvote/page/default_page/js/loadtexts.js @@ -0,0 +1,434 @@ +$(document).ready(function() { + load_user_main(); + load_user_list(); + register_login(); + register_logout(); +}); + +function load_user_list(){ + $('#user_list').load('./?action=user_list', function(){ + register_user_list();}); +} +function load_user_main(){ + $('#user_main').load('./?action=user_main', function(){ + register_user_main(); + }); +} + +function register_user_list(){ + $('#tabs_user_list a').click(function (e) { + e.preventDefault(); + load_user_list_tab($(this).attr('action')); + $(this).tab('show'); + }); + $('.btn_vote').click(function () { + //vote_click($(this).attr('poll_ID')); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); + open_vote($(this).attr('poll_ID')); + register_registerform(); + }); + $('.btn_fade').click(function () { + $('#vote_data_panel' + $(this).attr('poll_ID')).toggle(); + }); +} +function register_user_main(){ + register_registerform(); + $('#feedback_submit').click(function (data){ + var test = $('textarea#feedback_text').val(); + send_feedback(test); + }); + $('#tabs_user_main a').click(function (e) { + e.preventDefault(); + load_user_main_tab($(this).attr('action')); + $(this).tab('show'); + }); +} + +function register_login(){ + $("#form_login input").not("[type=submit]").jqBootstrapValidation({ + //load_user_main_tab('user_main_uVote'); + }); + + $('#user_list').load('./?action=user_list', function(){ + $('#tabs_user_list a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + load_user_list_tab($(this).attr('action')); + + }); + $('.btn_vote').click(function () { + //vote_click($(this).attr('poll_ID')); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); + open_vote($(this).attr('poll_ID')); + register_registerform(); + }); + $('.btn_fade').click(function () { + $('#vote_data_panel' + $(this).attr('poll_ID')).show(); + }); + + //load_user_main_tab('user_main_uVote'); + }); + $("#form_login input").not("[type=submit]").jqBootstrapValidation({ + + preventSubmit: true, + submitError: function($form, event, errors) {}, + submitSuccess: function($form, event){ + $.get('./api.php?call=account&action=login&username=' + $('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) { + if(data == 1){ + window.location.reload(); + } else { + $('#help-block-user-password-combi-wrong').attr('style', 'display: block;'); + } + }); + event.preventDefault(); + } + }); +} +function register_logout(){ + $('#btn_logout').click(function(){ + $.get('./api.php?call=account&action=logout', function () { + window.location.reload(); + }); + }) + /*$("#form_logout input").not("[type=submit]").jqBootstrapValidation( + { + preventSubmit: true, + submitError: function($form, event, errors) {}, + submitSuccess: function($form, event){ + $.get('./api.php?call=account&action=logout', function (data) { + window.location.reload(); + }); + event.preventDefault(); + } + });*/ + + +} + +function register_registerform(){ + //console.log("wegwegwegwegwegweg"); + $("#register_user_form input").not("[type=submit]").jqBootstrapValidation( + { + preventSubmit: true, + submitError: function($form, event, errors) {}, + submitSuccess: function($form, event){ + $.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) { + if(data == 1){ + window.location.reload(); + } else { + $('#help-block-user-password-combi-wrong').attr('style', 'display: block;'); + } + }); + event.preventDefault(); + } + }); +} + +function load_user_main_tab(action){ + switch(action){ + case 'user_main_uVote': + //$('#tab_uVote').load('./?action='+ action); //causes error + return; + case 'user_main_urVote': + $('#tab_urVote').load('./?action='+ action); + return; + case 'user_main_myVote': + $('#tab_myVote').load('./?action='+ action, function(){ + $('.add_data_submit').click(function () { + submit_add_data(); + alert('success'); + }); + }); + return; + default: + } +} +function load_user_list_tab(action){ + switch(action){ + case 'user_list_active': + $('#tab_active').load('./?action='+ action, function(){ + $('.btn_fade').click(function () { + $('#vote_data_panel' + $(this).attr('poll_ID')).show(); + }); + $('.btn_vote').click(function () { + //vote_click($(this).attr('poll_ID')); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); + open_vote($(this).attr('poll_ID')); + register_registerform(); + + })}); + return; + case 'user_list_ended': + $('#tab_ended').load('./?action='+ action, function(){ + $('.btn_fade').click(function () { + $('#vote_data_panel' + $(this).attr('poll_ID')).show(); + }); + $('.btn_vote').click(function () { + //vote_click($(this).attr('poll_ID')); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); + open_vote($(this).attr('poll_ID')); + register_registerform(); + })}); + return; + default: + } +} + +function account_create(inputEmail, inputPassword){ + $.get('./api.php?call=account&action=create&username=' + NULL + '&password_sha=' + password + '&email=' + email + '&locale=deDE', function (data) { + dataTmp = data; + }).complete(function() { + + }); +} + +function load_openvoteinfo (poll_ID){ + var openvoteinfo; + $.get('./index.php?action=openinfo&poll_ID=' + poll_ID, function (data) { + openvoteinfo = data; + bodyelem = $(""); + bodyelem.animate(); + }).complete(function() { + $('#openvoteinfo'+poll_ID).slideUp({duration: 'slow', + complete: function(){ + $('#openvoteinfo'+poll_ID).html(openvoteinfo); + $('#openvoteinfo'+poll_ID).slideDown('slow'); + site_content_is_visible = true; + }}); + }); + +} + +function get_barsperparty (poll_ID) { + $.get('./api.php?call_bars_action_getbarsperparty&poll_ID=' + poll_ID, function (data) { + dataTmp = data; + }).complete(function() { + + }); +} + +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("success"); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + poll_ID, function(){ + open_vote(poll_ID); + }); + } else { + alert(data.result.message); + } + }); +} + +function submit_commentrate (c_ID, val) { + alert('success'); + $.getJSON('./api.php?call=vote&action=commentrate&c_ID=' + c_ID + '&val=' + val, function(data) { + var items = []; + if(data.status == true){ + } else { + alert(data.result.message); + } + }); +} + +function encode_utf8(c) { + return unescape(encodeURIComponent(c)); +} + +function decode_utf8(c) { + return decodeURIComponent(escape(c)); +} + +function submit_c_data (poll_ID) { + var c = $("#c_txt_pro").val(); + var c_src = $("#c_src_pro").val(); + var a = document.getElementById("side_select"); + var c_choice = a.options[a.selectedIndex].value; + $.getJSON('./api.php?call=vote&action=comment&poll_ID=' + poll_ID + '&c_choice=' + c_choice + '&c_txt=' + c_txt + '&c_src=' + c_src, function(data) { + var items = []; + if(data.status == true){ + alert("success"); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + poll_ID, function(){ + open_vote(poll_ID); + }); + } else { + alert(data.result.message); + } + }); +} + +function submit_add_data () { + var a = document.getElementById("location"); + var location = a.options[a.selectedIndex].text; + var b = document.getElementById("birthyear"); + var birthyear = b.options[b.selectedIndex].text; + var c = document.getElementById("gender"); + var gender = c.options[c.selectedIndex].text; + var d = document.getElementById("children"); + var children = d.options[d.selectedIndex].text; + $.getJSON('./api.php?call=vote&action=data&location=' + location + '&birthyear=' + birthyear + '&gender=' + gender + '&children=' + children, function(data) { + + var items = []; + if(data.status == true){ + alert("success"); + } else { + alert(data.result.message); + } + }); +} + +function send_feedback (feedback) { + var val = JSON.stringify(feedback); + console.log("feedback called"); + $.ajax({ + url: 'http://mojotrollz.eu/web/uVote/api.php', + // contentType : "application/json; charset=utf-8", + data : { + 'call': 'vote', + 'action': 'feedback', + 'feedback': val + }, + type : 'POST', + dataType: 'json', + async: false, + success: function() { + alert("success"); + }, + error: function(error){ + alert("something failed..."+error); + } + }); +} + +function open_vote (poll_ID) { + $('#user_list').load('./api.php?call=vote&action=open_vote&poll_ID=' + poll_ID, function(){ + $('.btnvote_yes').click(function () { + vote_click($(this).attr('poll_ID'),1); + }); + $('.btnvote_no').click(function () { + vote_click($(this).attr('poll_ID'),2); + }); + $('.btnvote_off').click(function () { + vote_click($(this).attr('poll_ID'),3); + }); + $('.submit_pro').click(function () { + submit_c_data($(this).attr('poll_ID')); + alert('success'); + }); + $('.c_up').click(function () { + submit_commentrate($(this).attr('c_ID'), 1); + }); + $('.c_down').click(function () { + submit_commentrate($(this).attr('c_ID'), 2); + }); + $('.c_spam').click(function () { + submit_commentrate($(this).attr('c_ID'), 3); + }); + $('#test').click(function(){ + $('#myModal').modal(); + }); + + register_registerform(); + }); +} + +function loadAjaxContent(url) { + var dataTmp; + $.get(url, function (data) { + dataTmp = data; + bodyelem = $("html,body"); + bodyelem.animate(); + }).complete(function() { + $('#site-content-wrapper').slideUp({duration: 'slow', + complete: function(){ + $('#site-content').html(dataTmp); + $('#site-content-wrapper').slideDown('slow'); + site_content_is_visible = true; + }}); + }); +} +function loadUrlPic(url_pic) { + var dataTmp; + $.get(url_pic, function (data) { + dataTmp = data; + bodyelem = $("html,body"); + bodyelem.animate(); + }).complete(function() { + $('.carousel-inner').slideUp({duration: 'slow', + complete: function(){ + $('#pic').html(dataTmp); + $('.carousel-inner').slideDown('slow'); + site_content_is_visible = true; + }}); + }); +} + +function loadApiPic(id) { + var dataTmp; + $.get('./api.php?call=img&id='+id, function (data) { + dataTmp = data; + bodyelem = $("html,body"); + bodyelem.animate(); + }).complete(function() { + + }); +} + +function load_visualisation(id, timespan){ + $('img#loader').show(); + $.getJSON('./api.php?call=graph_bt_to_uvote_overall_by_time',function(json){ + if(!json || json.status != true || !json.result){ + $('img#loader').hide(); + return; + } + json = json.result; + $('img#loader').hide(); + var data = new google.visualization.DataTable(); + first = true; + $.each(json[0], function(key, value){ + if(first){ + data.addColumn('datetime',key); + first = false; + } else { + data.addColumn('number',key); + } + }); + $.each(json, function(key, value){ + first = true; + data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [parseFloat(v)];}}));}); + + console.log(data); + var options = {title: 'Übereinstimmung uVote Community/Bundestag', aggregationTarget: 'category', selectionMode: 'multiple', /*curveType: 'function',*/ /*focusTarget: 'category',*/ chartArea:{}, vAxis:{format:'#%', logScale: false}, interpolateNulls: false, width: "300", height: "250"}; + //LineChart + new google.visualization.ColumnChart(document.getElementById(id)).draw(data, options); + }); +} +function load_visualisation_urvote(id, timespan){ + $('img#loader').show(); + $.getJSON('./api.php?call=graph_bt_to_user_overall_by_time',function(json){ + if(!json || json.status != true || !json.result){ + $('img#loader').hide(); + return; + } + json = json.result; + $('img#loader').hide(); + var data = new google.visualization.DataTable(); + first = true; + $.each(json[0], function(key, value){ + if(first){ + data.addColumn('datetime',key); + first = false; + } else { + data.addColumn('number',key); + } + }); + $.each(json, function(key, value){ + first = true; + data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [parseFloat(v)];}}));}); + + console.log(data); + var options = {title: id, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{}, vAxis:{logScale: false}, interpolateNulls: false, width: "300", height: "250"}; + new google.visualization.LineChart(document.getElementById(id)).draw(data, options); + }); +} \ No newline at end of file diff --git a/uvote/page/default_page/pics/logo2.png b/uvote/page/default_page/pics/logo2.png new file mode 100644 index 0000000..e2e514e Binary files /dev/null and b/uvote/page/default_page/pics/logo2.png differ diff --git a/uvote/page/default_page/tpl/cover.tpl b/uvote/page/default_page/tpl/cover.tpl new file mode 100644 index 0000000..1ff8efd --- /dev/null +++ b/uvote/page/default_page/tpl/cover.tpl @@ -0,0 +1,6 @@ +
+ +
+ +
+
diff --git a/uvote/page/default_page/tpl/full_vote.tpl b/uvote/page/default_page/tpl/full_vote.tpl new file mode 100644 index 0000000..47f533b --- /dev/null +++ b/uvote/page/default_page/tpl/full_vote.tpl @@ -0,0 +1,9 @@ +
+
+ Quelle: ${iframe_link} +
+
+ +
+
+ diff --git a/uvote/page/default_page/tpl/loggedinform.tpl b/uvote/page/default_page/tpl/loggedinform.tpl new file mode 100644 index 0000000..7b259ae --- /dev/null +++ b/uvote/page/default_page/tpl/loggedinform.tpl @@ -0,0 +1,66 @@ +
+ +
+ +uVote kann die Repräsentativität der Daten +
+nur durch die freiwillige Angabe von +
+persöhnlichen Daten gewährleisten. +
+Zum Umgang mit diesen Daten lesen sie bitte +
+unsere AGBs. +
+ + +
+ +
+ \ No newline at end of file diff --git a/uvote/page/default_page/tpl/loggedinformtop.tpl b/uvote/page/default_page/tpl/loggedinformtop.tpl new file mode 100644 index 0000000..130cffc --- /dev/null +++ b/uvote/page/default_page/tpl/loggedinformtop.tpl @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/uvote/page/default_page/tpl/loginform.tpl b/uvote/page/default_page/tpl/loginform.tpl new file mode 100644 index 0000000..eb944b8 --- /dev/null +++ b/uvote/page/default_page/tpl/loginform.tpl @@ -0,0 +1,52 @@ + + \ No newline at end of file diff --git a/uvote/page/default_page/tpl/page.tpl b/uvote/page/default_page/tpl/page.tpl new file mode 100644 index 0000000..11c268f --- /dev/null +++ b/uvote/page/default_page/tpl/page.tpl @@ -0,0 +1,66 @@ + + + + uVote + + + + + ${css} + ${js} + + +
+ + + + +
+ +
+ +
+ +
+
+ + diff --git a/uvote/page/default_page/tpl/parties_on_vote.tpl b/uvote/page/default_page/tpl/parties_on_vote.tpl new file mode 100644 index 0000000..1762160 --- /dev/null +++ b/uvote/page/default_page/tpl/parties_on_vote.tpl @@ -0,0 +1,4 @@ +
+ ${choice}
+ +
\ No newline at end of file diff --git a/uvote/page/default_page/tpl/register_form.tpl b/uvote/page/default_page/tpl/register_form.tpl new file mode 100644 index 0000000..c9823de --- /dev/null +++ b/uvote/page/default_page/tpl/register_form.tpl @@ -0,0 +1,48 @@ +
+ + +
+
+ +
+ +
+ +
+
+
+
+ + +
+ +
+
${login_not_successfull}
+ + + +
+ + +
+ + + + + \ No newline at end of file diff --git a/uvote/page/default_page/tpl/vote.tpl b/uvote/page/default_page/tpl/vote.tpl new file mode 100644 index 0000000..c071dee --- /dev/null +++ b/uvote/page/default_page/tpl/vote.tpl @@ -0,0 +1,67 @@ +
+
+
${title}
+ + ${full_vote_btn} + ${fade} +
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/uvote/page/default_page/tpl/vote_bt.tpl b/uvote/page/default_page/tpl/vote_bt.tpl new file mode 100644 index 0000000..db443f1 --- /dev/null +++ b/uvote/page/default_page/tpl/vote_bt.tpl @@ -0,0 +1,2 @@ + +${choice}
\ No newline at end of file diff --git a/uvote/page/default_page/tpl/vote_uv.tpl b/uvote/page/default_page/tpl/vote_uv.tpl new file mode 100644 index 0000000..1fdff47 --- /dev/null +++ b/uvote/page/default_page/tpl/vote_uv.tpl @@ -0,0 +1 @@ +${perc}% diff --git a/uvote/page/default_register/css/register.css b/uvote/page/default_register/css/register.css new file mode 100644 index 0000000..254e010 --- /dev/null +++ b/uvote/page/default_register/css/register.css @@ -0,0 +1,56 @@ +.panel-group#accordion { + padding-right: 30px; +} + +#carousel-example-generic { + width: 50%; float: left; +} + +#graph_bt_uv_overall { + float: left; + width: 300px; +} + +#register_username { + margin-bottom: 15px; + float: left; +} + +#register-help-block-username { + float: left; + margin-top: 3px; +} + +#register_email { + margin-bottom: 15px; + float: left; +} + +#register-help-block-email { + float: left; + margin-top: 3px; +} + +#change_user_password_sub { + clear: both; +} + +#user_register_password1 { + margin-bottom: 15px; + float: left; +} + +#user_register_password2 { + margin-bottom: 15px; + float: left; +} + +#help-block_register { + float: left; + margin-top: 3px; +} + +#help-block_register2 { + float: left; + margin-top: 3px; +} \ No newline at end of file diff --git a/uvote/page/default_register/default_register.php b/uvote/page/default_register/default_register.php new file mode 100644 index 0000000..a167f29 --- /dev/null +++ b/uvote/page/default_register/default_register.php @@ -0,0 +1,17 @@ +';} + + public function html(){ + $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='; + $vars['css'] = $this->css(); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register')); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote')); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_register/register.tpl'), $vars); + + } +} \ No newline at end of file diff --git a/uvote/page/default_register/register.tpl b/uvote/page/default_register/register.tpl new file mode 100644 index 0000000..d5d4172 --- /dev/null +++ b/uvote/page/default_register/register.tpl @@ -0,0 +1,144 @@ +
+
+
+

+ Welcome +

+
+
+ + +

+ ${welcome_text} +
+
+
+
+

+ Gallery +

+
+ +
+
+
+

+ Registrieren +

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
${user_name_register} +
+ +
+
+
+
${user_email_register} +
+ +
+
+
+
${user_password_register} +
+
+ +
+
+
+
+ +
+
+
+
+
${locale} +
+ +
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/uvote/page/page_uvote.php b/uvote/page/page_uvote.php new file mode 100644 index 0000000..327e845 --- /dev/null +++ b/uvote/page/page_uvote.php @@ -0,0 +1,32 @@ +html($_escaped_fragment_);} + + public static function action_open_bulletin ($poll_ID){ + if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ + return (new default_register ())->html();} + return (new default_bulletin($poll_ID))->html();} + + public static function action_user_main(){ + if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ + return (new default_register ())->html();} + return (new user_main())->html();} + + public static function action_user_list(){ + return (new user_list())->html();} + + public static function action_user_list_active(){ + return (new user_list_active())->html();} + + public static function action_user_list_ended(){ + return (new user_list_ended())->html();} + + public static function action_user_main_urVote(){ + return (new user_main_urVote())->html();} + + public static function action_user_main_myVote(){ + return (new user_main_myVote())->html();} +} \ No newline at end of file diff --git a/uvote/page/user_list/css/list_menu.css b/uvote/page/user_list/css/list_menu.css new file mode 100644 index 0000000..40f7469 --- /dev/null +++ b/uvote/page/user_list/css/list_menu.css @@ -0,0 +1,7 @@ +#tabbable_list_menu { + padding-right: 50px; +} + +#tab-content_list_menu { + padding-top: 10px; +} \ No newline at end of file diff --git a/uvote/page/user_list/list_menu.tpl b/uvote/page/user_list/list_menu.tpl new file mode 100644 index 0000000..04ae49d --- /dev/null +++ b/uvote/page/user_list/list_menu.tpl @@ -0,0 +1,11 @@ +
+ +
+
${active}
+
+
+
+ diff --git a/uvote/page/user_list/user_list.php b/uvote/page/user_list/user_list.php new file mode 100644 index 0000000..f2e8a3c --- /dev/null +++ b/uvote/page/user_list/user_list.php @@ -0,0 +1,20 @@ +';} + + public function html(){ + $vars = array(); + + $uv = new user_list_active(); + $vars['css'] = $this->css(); + $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; + $vars['active'] = $uv->html(); + + + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list/list_menu.tpl'),$vars); + } + +} \ No newline at end of file diff --git a/uvote/page/user_list_active/active.tpl b/uvote/page/user_list_active/active.tpl new file mode 100644 index 0000000..3955133 --- /dev/null +++ b/uvote/page/user_list_active/active.tpl @@ -0,0 +1 @@ +${votetlist} \ No newline at end of file diff --git a/uvote/page/user_list_active/user_list_active.php b/uvote/page/user_list_active/user_list_active.php new file mode 100644 index 0000000..1d42c71 --- /dev/null +++ b/uvote/page/user_list_active/user_list_active.php @@ -0,0 +1,107 @@ + 0 ? 'Abstimmen' : 'Ansehen'; + $vote['uv'] = $vote['bt'] = ''; + $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5'; + + $user_vote = votes::getUserPollData($vote['ID']); + $vote['vote_class'] = $this->tablerow_class($user_vote); + if($user_vote){ + //user vote + $vote['vote_class'] = $this->tablerow_class($user_vote); + + //bt vote + $party_votes = votes::get_barsperparty($vote['ID']); + $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); + foreach($party_votes as $pv){ + $vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_bt.tpl'), + array( 'party' => $pv['party'], + 'choice' => $this->get_party_per_poll($pv['choice']), + 'choice_class' => $this->badge_class($pv['choice']))); + } + + //uvote vote + $uvote = votes::get_users_choice_per_poll($vote['ID']); + $vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : ''; + foreach($uvote as $v){ + $vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_uv.tpl'), + array( 'badge' => self::badge_class($v['choice']), + 'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0)); + } + } + + //new panels: + $vote['panel_class'] = default_page::panel_class($user_vote); + + if($time_remain > 0){ + $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); + } else { + $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); + } + } + return $result[0].$result[1]; + } + + public function html(){ + $vars = array(); + $vars['votelist'] = $this->generate_votelist(); + $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\PAGE\text::tag('uvote_register')); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_poll')); + $vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote')); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_active/active.tpl'), $vars); + } + +} \ No newline at end of file diff --git a/uvote/page/user_list_ended/ended.tpl b/uvote/page/user_list_ended/ended.tpl new file mode 100644 index 0000000..f2cef67 --- /dev/null +++ b/uvote/page/user_list_ended/ended.tpl @@ -0,0 +1 @@ +${votelist} \ No newline at end of file diff --git a/uvote/page/user_list_ended/user_list_ended.php b/uvote/page/user_list_ended/user_list_ended.php new file mode 100644 index 0000000..55a6b8a --- /dev/null +++ b/uvote/page/user_list_ended/user_list_ended.php @@ -0,0 +1,106 @@ + 0 ? 'Abstimmen' : 'Ansehen'; + $vote['uv'] = $vote['bt'] = ''; + $vote['uv_count'] = $vote_count['count'] > 4 ? $vote_count['count'] : '< 5'; + + $user_vote = votes::getUserPollData($vote['ID']); + $vote['vote_class'] = $this->tablerow_class($user_vote); + if($user_vote){ + //user vote + $vote['vote_class'] = $this->tablerow_class($user_vote); + + //bt vote + $party_votes = votes::get_barsperparty($vote['ID']); + $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']); + foreach($party_votes as $pv){ + $vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_bt.tpl'), + array( 'party' => $pv['party'], + 'choice' => $this->get_party_per_poll($pv['choice']), + 'choice_class' => $this->badge_class($pv['choice']))); + } + + //uvote vote + $uvote = votes::get_users_choice_per_poll($vote['ID']); + $vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : ''; + foreach($uvote as $v){ + $vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_uv.tpl'), + array( 'badge' => self::badge_class($v['choice']), + 'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0)); + } + } + + //new panels: + $vote['panel_class'] = default_page::panel_class($user_vote); + + if($time_remain > 0){ + $result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); + } else { + $result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote); + } + } + return $result[0].$result[1]; + } + + public function html(){ + $vars = array(); + $vars['votelist'] = $this->generate_votelist(); + $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)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(110)); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_ended/ended.tpl'), $vars); + } + +} \ No newline at end of file diff --git a/uvote/page/user_main/main_menu.tpl b/uvote/page/user_main/main_menu.tpl new file mode 100644 index 0000000..a148e52 --- /dev/null +++ b/uvote/page/user_main/main_menu.tpl @@ -0,0 +1,30 @@ +
+ +
+
${uVote}
+
+
+
+
+
+

+ Feedback +

+
+
+
+
+
+

uVote BETA Feedback

+ +
+ +
+
+
+
+
diff --git a/uvote/page/user_main/user_main.php b/uvote/page/user_main/user_main.php new file mode 100644 index 0000000..2f86906 --- /dev/null +++ b/uvote/page/user_main/user_main.php @@ -0,0 +1,18 @@ +';} + public function html(){ + $vars = array(); + + $uv = new user_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='; + $vars['uVote'] = $uv->html(); + + + 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/css/myVote.css b/uvote/page/user_main_myVote/css/myVote.css new file mode 100644 index 0000000..79adac0 --- /dev/null +++ b/uvote/page/user_main_myVote/css/myVote.css @@ -0,0 +1,12 @@ +#myVote_main { + width: 100%; + padding-top: 10px; +} +#myVote_sub1 { + float: left; + margin-top: 30px; +} + +#myVote_sub2 { + float: right; +} \ 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..fbf00cf --- /dev/null +++ b/uvote/page/user_main_myVote/myVote.tpl @@ -0,0 +1,167 @@ +
+
+
+

+ Einstellungen +

+
+
+
${myvote_bodytext}
+
+
+ ${location}
+ +
+ ${birthyear}
+ +
+ ${gender}
+ +
+ ${children}
+ +
+
Absenden
+
+
+
+
\ 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..536b4a3 --- /dev/null +++ b/uvote/page/user_main_myVote/user_main_myVote.php @@ -0,0 +1,29 @@ +';} + + public function html(){ + $vars = array(); + $vars = $this->get_add_data(); + $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)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(110)); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_myVote/myVote.tpl'), $vars); + } + +} \ No newline at end of file diff --git a/uvote/page/user_main_uVote/bt_to_uvote_overall.tpl b/uvote/page/user_main_uVote/bt_to_uvote_overall.tpl new file mode 100644 index 0000000..34cff78 --- /dev/null +++ b/uvote/page/user_main_uVote/bt_to_uvote_overall.tpl @@ -0,0 +1,8 @@ + + + + + ${class_MATCH} + ${class_MISSMATCH} + ${match_percentage}% + \ No newline at end of file diff --git a/uvote/page/user_main_uVote/uVote.tpl b/uvote/page/user_main_uVote/uVote.tpl new file mode 100644 index 0000000..fe3cad5 --- /dev/null +++ b/uvote/page/user_main_uVote/uVote.tpl @@ -0,0 +1,76 @@ +
+
+
+
+

+ Welcome +

+
+
+ ${welcome_text} +
+
+
+ +
+
+
+ + +
Übereinstimmung von uVote & Politik
+ ${uvote_to_bt} + +
+
+
+ +
+
+
+
+ +
+
+
+
Entscheidungsverhalten der uVote Community
+ + ${votes_all} + + Wie oft die uVote Community +
insgesamt Dafür, Dagegen oder +
Enthaltung gestimmt hat.
+
+
+
Entscheidungsverhalten des Bundestags
+ + ${votes_all_bt} + + Wie oft der Bundestag +
Dafür, Dagegen oder +
Enthaltung gestimmt hat.
+
+
+
+
+
+
+

+ uVote Community +

+
+
+
+ ${user_count} Nutzer auf uVote +
+
+
+
+
diff --git a/uvote/page/user_main_uVote/user_main_uVote.php b/uvote/page/user_main_uVote/user_main_uVote.php new file mode 100644 index 0000000..c7bc9dc --- /dev/null +++ b/uvote/page/user_main_uVote/user_main_uVote.php @@ -0,0 +1,88 @@ +uvote_to_parties(); + $vars['votes_all'] = $this->votes_all(); + $vars['votes_all_bt'] = $this->votes_all_bt(); + $vars['user_count'] = $this->user_count(); + $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)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(100)); + 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_uVote/uvoteparties.tpl b/uvote/page/user_main_uVote/uvoteparties.tpl new file mode 100644 index 0000000..8c30031 --- /dev/null +++ b/uvote/page/user_main_uVote/uvoteparties.tpl @@ -0,0 +1,8 @@ + + + + + ${class_MATCH} + ${class_MISSMATCH} + ${match_percentage}% + \ No newline at end of file diff --git a/uvote/page/user_main_uVote/votecountchoice.tpl b/uvote/page/user_main_uVote/votecountchoice.tpl new file mode 100644 index 0000000..1b6f8ea --- /dev/null +++ b/uvote/page/user_main_uVote/votecountchoice.tpl @@ -0,0 +1,5 @@ +
+${choice} +${count} + +
diff --git a/uvote/page/user_main_uVote/votecountchoicebt.tpl b/uvote/page/user_main_uVote/votecountchoicebt.tpl new file mode 100644 index 0000000..3e74993 --- /dev/null +++ b/uvote/page/user_main_uVote/votecountchoicebt.tpl @@ -0,0 +1,4 @@ +
+${bt_choice} +${count} +
diff --git a/uvote/page/user_main_urVote/all_polls.tpl b/uvote/page/user_main_urVote/all_polls.tpl new file mode 100644 index 0000000..b57717f --- /dev/null +++ b/uvote/page/user_main_urVote/all_polls.tpl @@ -0,0 +1,14 @@ +
+
Aktueller Status
+
+
+ Teilnahme an aktuellen Abstimmungen +
+
${vote_perc}%
+
+
+
+ Teilgenommen: ${voted}, nicht Teilgenommen: ${not_voted} +
+
+
diff --git a/uvote/page/user_main_urVote/bt_to_user_overall.tpl b/uvote/page/user_main_urVote/bt_to_user_overall.tpl new file mode 100644 index 0000000..cd2c1f8 --- /dev/null +++ b/uvote/page/user_main_urVote/bt_to_user_overall.tpl @@ -0,0 +1,8 @@ + + + + + ${class_MATCH} + ${class_MISSMATCH} + ${match_percentage} + \ No newline at end of file diff --git a/uvote/page/user_main_urVote/overall_all_polls.tpl b/uvote/page/user_main_urVote/overall_all_polls.tpl new file mode 100644 index 0000000..bcafd92 --- /dev/null +++ b/uvote/page/user_main_urVote/overall_all_polls.tpl @@ -0,0 +1,11 @@ +
+ Abstimmungsquote seit Accounterstellung +
+
${vote_perc}%
+
+
+
+ Teilgenommen: ${voted}, + nicht Teilgenommen: ${not_voted} +
+
\ No newline at end of file diff --git a/uvote/page/user_main_urVote/urVote.tpl b/uvote/page/user_main_urVote/urVote.tpl new file mode 100644 index 0000000..2ed1719 --- /dev/null +++ b/uvote/page/user_main_urVote/urVote.tpl @@ -0,0 +1,72 @@ +
+ +
+
+
+

+ ${urVote_title} +

+
+
+ ${urvote_body_text} +
+
+
+ +
+
+
+ + +
${urVote_user_party_compare}
+ ${urvote_user_party_compare_sub} + ${choices_user_ID} + + + + ${choices_bt_to_user} + +
+
+
+
${user_temp_votes}
+
+
${user_overall_votes}
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. +
+
+
+
+
+ + \ No newline at end of file diff --git a/uvote/page/user_main_urVote/urvoteparties.tpl b/uvote/page/user_main_urVote/urvoteparties.tpl new file mode 100644 index 0000000..cc85ac8 --- /dev/null +++ b/uvote/page/user_main_urVote/urvoteparties.tpl @@ -0,0 +1,18 @@ +
+ + + + + ${class_MATCH} + ${class_MISSMATCH} + + ${match_percentage}% + + + +
+ \ 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..6889e5d --- /dev/null +++ b/uvote/page/user_main_urVote/user_main_urVote.php @@ -0,0 +1,95 @@ +id, \SYSTEM\SECURITY\Security::getUser()->creationDate); + $v = $vars['voted'] > 1 ? $vars['voted'] : 1; + $nv = $vars['not_voted']; + return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/overall_all_polls.tpl'), + array( 'vote_perc'=> round($v/($nv+$v)*100, 2), + 'no_vote_perc'=> round($nv/($nv+$v)*100, 2), + 'voted'=> $v, + 'not_voted'=> $nv)); + } + + private function user_temp_votes (){ + $vars = votes::get_user_temp_votes(\SYSTEM\SECURITY\Security::getUser()->id); + $v = $vars['voted']; + $nv = $vars['not_voted']; + print_r($vars, true); + return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/all_polls.tpl'), + array( 'vote_perc'=> round($v/($nv+$v)*100, 2), + 'no_vote_perc'=> round($nv/($nv+$v)*100, 2), + 'voted'=> $v, + 'not_voted'=> $nv)); + } + + private function user_to_bt(){ + //$vars = votes::get_user_per_party_overall($user_ID); + $result = ''; + $con = new \SYSTEM\DB\Connection(); + $res = $con->prepare( 'bt_to_user', + 'SELECT sum(case when uvote_data.choice = uvote_votes.bt_choice then 1 else 0 end) class_MATCH, + sum(case when uvote_data.choice != uvote_votes.bt_choice then 1 else 0 end) class_MISSMATCH + FROM uvote_data LEFT JOIN uvote_votes + ON uvote_data.poll_ID = uvote_votes.ID + WHERE user_ID = ?;', + array(\SYSTEM\SECURITY\Security::getUser()->id)); + while($row = $res->next()){ + $row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH']+1)*100,2); + + $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/bt_to_user_overall.tpl'), $row); + } + return $result; + $row['votes_cast'] = round(($row['class_MATCH']+$row['class_MISSMATCH']),2); +} + + + + private function user_per_party_overall(){ + //$vars = votes::get_user_per_party_overall(array(\SYSTEM\SECURITY\Security::getUser()->id)); + $result = ''; + $con = new \SYSTEM\DB\Connection(); + $res = $con->prepare( 'test', + '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 INNER JOIN uvote_votes_per_party + ON uvote_data.poll_ID = uvote_votes_per_party.poll_ID + WHERE user_ID = ? GROUP BY party;', + array(\SYSTEM\SECURITY\Security::getUser()->id)); + $i = 0; + while($row = $res->next()){ + + $res2 = votes::vote_accord_with_party($row['party']); + $row['according_laws'] = $this->build_according_law_html($res2, $row['party']); + $row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2); + $result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urvoteparties.tpl'), $row);; + } + return $result; +} + public function build_according_law_html($part, $party){ + $part = json_decode($part, true); + $result = "
Bei folgenden Gesetzen hast du genauso abgestimmt wie die '".$party."':

"; + foreach ($part['result'] as $p){ + $result .= $p['title']."
"; + } + $result .= "
"; + new INFO($result); + return $result; + } + public function html(){ + $vars = array(); +// $vars['poll_compare'] = $this->count_all_polls(); + $vars['choices_user_ID'] = $this->user_per_party_overall(); + $vars['choices_bt_to_user'] = $this->user_to_bt(); + $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; + $vars['user_temp_votes'] = $this->user_temp_votes(); + $vars['user_overall_votes'] = $this->user_overall_votes(); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(150)); + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urVote.tpl'),$vars); + } + +} \ No newline at end of file diff --git a/uvote/path/PLIB.php b/uvote/path/PLIB.php new file mode 100644 index 0000000..f0bb5dd --- /dev/null +++ b/uvote/path/PLIB.php @@ -0,0 +1,5 @@ + + + + +
+
+

poll start

+ - 00:00 +

poll end

+ - 00:00 +
+Submit + +
+
+

BT DATEN

+ +
+ + + + + + +
+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 new file mode 100644 index 0000000..069cefd --- /dev/null +++ b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.js @@ -0,0 +1,44 @@ +function init_saimod_uvote_vote_edit(){ + + $('.btn_editvote').click(function() { + alert (''); + var poll_ID = $('#input_poll_title').attr('poll_ID'); + var title = $('#input_poll_title').val(); + var iframe_link = $('#input_poll_link').val(); + vote_data_edit(poll_ID, title, iframe_link); + + + +// var data = new Array(); +// alert("bla") +// $.ajax({ +// url: SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_uvote_vote_edit&action='+ vote, +// contentType : "application/json; charset=utf-8", +// vote : JSON.stringify({ +// sai_mod: 'saimod_uvote_vote_edit', +// action: 'new_vote', +// json: data, +// }), +// dataType : 'json', +// type : 'POST' , +// success: function(vote) { +// alert("success"); +// }}); +// alert("js läuft"); + })}; + + + + +function vote_data_edit (poll_ID, title, iframe_link) { + alert('vote_data_edit'); + + $.getJSON('./api.php?call=vote&action=new_vote&poll_ID=' + poll_ID + '&title=' + title + '&iframe_link=' + iframe_link, 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 new file mode 100644 index 0000000..4c70d6f --- /dev/null +++ b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.php @@ -0,0 +1,67 @@ +prepare('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(); + 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_new_vote(){ + $result = ''; + $vote = array(); + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/vote.tpl'), $vote); + + } + + + 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='; + return \SYSTEM\PAGE\replace::replaceFile(dirname(__FILE__).'/main.tpl', $vars);*/ + + $result = ''; +// $result.=self::sai_mod_saimod_uvote_new_vote(); + $votes = votes::getAllVotesOfGroup(1); + foreach($votes as $vote){ + $time_remain = strtotime($vote['time_end'])- microtime(true); + $time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']); + $vote['vote_class'] = self::tablerow_class(votes::getUserPollData($vote['ID'])); + $vote['bt_vote_class'] = self::tablerow_class($vote['bt_choice']); + $vote['time_left'] = round($time_remain/($time_span+1)*100,0); + $vote['time_done'] = 100-$vote['time_left']; + $vote['new_vote'] = self::sai_mod_saimod_uvote_new_vote(); + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/vote.tpl'), $vote); + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl'), array('list' => $result)); + } + + private static function tablerow_class($choice){ + switch($choice){ + case 1: + return 'pro'; + case 2: + return 'contra'; + case 3: + return 'ent'; + default: + return ''; + } + } + + public static function html_li_menu(){return '
  • Edit Votes
  • ';} + 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( + \SYSTEM\WEBPATH(new PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.js') + ));} + public static function sai_mod_saimod_uvote_vote_edit_flag_css(){return \SYSTEM\LOG\JsonResult::toString(array() + );} +} \ No newline at end of file diff --git a/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl new file mode 100644 index 0000000..d37ceab --- /dev/null +++ b/uvote/sai/saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl @@ -0,0 +1,4 @@ + +${new_vote} +${list} +
    \ No newline at end of file diff --git a/uvote/sai/saimod_uvote_vote_edit/vote.tpl b/uvote/sai/saimod_uvote_vote_edit/vote.tpl new file mode 100644 index 0000000..906565b --- /dev/null +++ b/uvote/sai/saimod_uvote_vote_edit/vote.tpl @@ -0,0 +1,48 @@ + + + + + + + Nr.${ID} + + + Edit + + + cdu + 123 + 123 + 123
    + csu123 + 123 + 123 + 123
    + spd123 + 123 + 123 + 123
    + grüne123 + 123 + 123 + 123
    + linke123 + 123 + 123 + 123
    + + + uv + 123 + 123 + 123 + + + + + + + +
    + + \ No newline at end of file diff --git a/uvote/src/documents/Konzept.docx b/uvote/src/documents/Konzept.docx new file mode 100644 index 0000000..2b3f48b Binary files /dev/null and b/uvote/src/documents/Konzept.docx differ diff --git a/uvote/src/documents/Kriterien.docx b/uvote/src/documents/Kriterien.docx new file mode 100644 index 0000000..5286482 Binary files /dev/null and b/uvote/src/documents/Kriterien.docx differ diff --git a/uvote/src/documents/Wissenschaftl. Ausarbeitung.docx b/uvote/src/documents/Wissenschaftl. Ausarbeitung.docx new file mode 100644 index 0000000..a14a9d4 Binary files /dev/null and b/uvote/src/documents/Wissenschaftl. Ausarbeitung.docx differ diff --git a/uvote/src/documents/ueber iVote.docx b/uvote/src/documents/ueber iVote.docx new file mode 100644 index 0000000..023205a Binary files /dev/null and b/uvote/src/documents/ueber iVote.docx differ diff --git a/uvote/src/pics/lgog.png b/uvote/src/pics/lgog.png new file mode 100644 index 0000000..befdd22 Binary files /dev/null and b/uvote/src/pics/lgog.png differ diff --git a/uvote/src/pics/logo2.png b/uvote/src/pics/logo2.png new file mode 100644 index 0000000..e2e514e Binary files /dev/null and b/uvote/src/pics/logo2.png differ diff --git a/uvote/src/psd/Unbenannt-1.psd b/uvote/src/psd/Unbenannt-1.psd new file mode 100644 index 0000000..3d52176 Binary files /dev/null and b/uvote/src/psd/Unbenannt-1.psd differ diff --git a/uvote/src/psd/Unbenannt-2.psd b/uvote/src/psd/Unbenannt-2.psd new file mode 100644 index 0000000..3bd01b5 Binary files /dev/null and b/uvote/src/psd/Unbenannt-2.psd differ diff --git a/uvote/src/psd/myVote.psd b/uvote/src/psd/myVote.psd new file mode 100644 index 0000000..92bfa9a Binary files /dev/null and b/uvote/src/psd/myVote.psd differ