small fixes @ uVote

This commit is contained in:
Ulf Gebhardt 2014-02-18 22:18:18 +01:00
parent 34f1ab81c8
commit 56b9cf834d
2 changed files with 15 additions and 18 deletions

View File

@ -7,7 +7,7 @@ class votes {
public static function insertPartyChoice($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice){
return \DBD\UVOTE_GENERATE_VOTELIST::QI(array($poll_ID, $party, $votes_pro, $votes_contra, $nr_attending, $total, $choice));}
public static function getVoteOfGroup($poll_ID){
public static function getVoteOfGroup($poll_ID){
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
$res = $con->prepare( 'selVoteByGrp',
'SELECT * FROM `uvote_votes` WHERE `ID` = ? LIMIT 1;',
@ -24,8 +24,7 @@ class votes {
'SELECT * FROM `uvote_data` WHERE `user_ID` = ? AND poll_ID = ?;',
array(\SYSTEM\SECURITY\Security::getUser()->id,$poll_ID));
$result = $res->next();
return $result['choice'];
return $result['choice'];
}
public static function get_barsperusers($poll_ID,$return_as_json = true){
@ -76,7 +75,6 @@ class votes {
return \DBD\UVOTE_DATA_USER_PER_PARTY_OVERALL::QA(array($user_ID));
}
public static function get_voteinfo($poll_ID){
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
$res = $con->prepare( 'selVoteByID',
@ -128,11 +126,8 @@ class votes {
return JsonResult::ok();
}
public static function open_vote($poll_ID){
$vote = votes::getVoteOfGroup($poll_ID);
// $vars = array('vote_text' => $vote['text'], 'vote_title' => $vote['title'], 'vote_init' => $vote['initiative'], 'poll_ID' => $vote['ID'], 'time_end' => $vote['time_end']);
$result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/full_vote.tpl'), $vote);
return $result;
}

View File

@ -1,20 +1,22 @@
<script language="JavaScript" src="/default_bulletin/js/vote.js">
</script>
<div>
${bars_user}
</div>
<div>
</div>
<div>
<h4>Ergebnis Bundestag</h4>
${bars_bt}
</div>
</div>
<div style="margin-right: 10px;">
<img src="${frontend_logos}logo2.png" style="float: left; margin-right: 70px;" width="200px"/>
${vote_buttons}
</div>
<br>
<br>
<div>
${bars_party}
</div>
<div style="clear: both"></div>
<br><br>
<div>
${bars_party}
</div>
<div style="clear: both"></div>