cleanup
This commit is contained in:
parent
52c61c5eb4
commit
44637112ae
@ -17,15 +17,15 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
private function bars_party(){
|
||||
$partyvotes = votes::get_barsperparty($this->poll_ID);
|
||||
|
||||
$pbpp = "";
|
||||
$result = "";
|
||||
foreach($partyvotes as $vote){
|
||||
$vote['party_yes'] = round($vote['votes_pro']/$vote['total']*100,0);
|
||||
$vote['party_no'] = round($vote['votes_contra']/$vote['total']*100,0);
|
||||
$vote['party_ent'] = round(($vote['nr_attending'] - $vote['votes_pro'] - $vote['votes_contra'])/$vote['total']*100,0);
|
||||
$pbpp .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote);
|
||||
}
|
||||
|
||||
return $pbpp;
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function bars_bt(){
|
||||
@ -41,7 +41,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
private function voice_weight(){
|
||||
$vars = votes::get_count_user_votes_per_poll($this->poll_ID);
|
||||
$vars['voteweight'] = 1/$vars['count']*100;
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);;
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function vote_buttons($poll_expired,$user_poll){
|
||||
@ -99,10 +99,6 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$poll_expired = \DBD\UVOTE_POLL_EXPIRED::Q1(array($this->poll_ID));
|
||||
$user_vote = votes::getUserPollData($this->poll_ID);
|
||||
|
||||
/*$poll_data = array();
|
||||
$poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(1));
|
||||
$poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(2));
|
||||
$poll_data[] = DBD\UVOTE_DATA_CHOICE_OVERALL::Q1(array(3));*/
|
||||
$vars = array();
|
||||
$vars['bars_party'] = $vars['bars_user'] = $vars['bars_bt'] = $vars['voice_weight'] = 'Vote to see results!';
|
||||
$vars['js'] = $this->js();
|
||||
|
||||
@ -14,9 +14,21 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
|
||||
private function css(){
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page\css\default_page.css').'" rel="stylesheet">';}
|
||||
|
||||
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page\css\default_page.css').'" rel="stylesheet">';}
|
||||
|
||||
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:
|
||||
@ -91,20 +103,7 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
}
|
||||
return $result[0].$result[1];
|
||||
}
|
||||
|
||||
private function get_party_per_poll($choice){
|
||||
switch($choice){
|
||||
case 1:
|
||||
return 'PRO';
|
||||
case 2:
|
||||
return 'CON';
|
||||
case 3:
|
||||
return 'ENT';
|
||||
default:
|
||||
return 'NONE';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get_coverpage(){
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/cover.tpl'), array());}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user