Merge branch 'master' of mojotrollz.eu:hosting

Conflicts:
	uVote/uVote/dbd/qq/UVOTE_DATA_USER_PER_PARTY_OVERALL.php
	uVote/uVote/page/user_main_urVote/user_main_urVote.php
This commit is contained in:
Nael 2014-02-17 01:06:21 +01:00
commit 2c76fb1675
5 changed files with 32 additions and 11 deletions

View File

@ -8,7 +8,7 @@ class UVOTE_DATA_USER_PER_PARTY_OVERALL extends \SYSTEM\DB\QP {
'',
//mys
'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 0 else 1 end) class_MISSMATCH
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;'

View File

@ -0,0 +1,4 @@
<tr>
<td>${choice}</td>
<td>${count}</td>
</tr>

View File

@ -1,3 +1,10 @@
<div id="statistics_uvote_users">
${choices_user_ID}
<table>
<tr>
<th>Party</th>
<th>Match</th>
<th>Missmatch</th>
</tr>
${choices_user_ID}
</table>
</div>

View File

@ -0,0 +1,5 @@
<tr>
<td>${party}</td>
<td>${class_MATCH}</td>
<td>${class_MISSMATCH}</td>
</tr>

View File

@ -2,15 +2,20 @@
class user_main_urVote extends SYSTEM\PAGE\Page {
private function user_per_party_overall(){
$vars = votes::get_user_per_party_overall(array(\SYSTEM\SECURITY\Security::getUser()->id));
return print_r($vars, TRUE);
// if (!$vars['bt_total']){
// return 'no data yet';}
// $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);
//$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));
while($row = $res->next()){
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urvoteparties.tpl'), $row);;
}
return $result;
}
public function html(){