bt data input
This commit is contained in:
parent
5a8c846c84
commit
10372c53b8
@ -3,6 +3,9 @@
|
||||
class votes {
|
||||
public static function getAllVotesOfGroup($groupid){
|
||||
return \DBD\UVOTE_GENERATE_VOTELIST::QA(array($groupid));}
|
||||
|
||||
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){
|
||||
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
|
||||
@ -70,7 +73,8 @@ class votes {
|
||||
return \DBD\UVOTE_DATA_BT_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));}
|
||||
return \DBD\UVOTE_DATA_USER_PER_PARTY_OVERALL::QA(array($user_ID));
|
||||
}
|
||||
|
||||
|
||||
public static function get_voteinfo($poll_ID){
|
||||
|
||||
@ -8,8 +8,8 @@ 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 1 else 0 end) class_MISSMATCH
|
||||
FROM uvote_data LEFT JOIN uvote_votes_per_party
|
||||
sum(case when uvote_data.choice = uvote_votes_per_party.choice then 0 else 1 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;'
|
||||
);}}
|
||||
Binary file not shown.
@ -6,7 +6,7 @@ class user_main extends SYSTEM\PAGE\Page {
|
||||
|
||||
$uv = new user_main_uVote();
|
||||
$vars['uVote'] = $uv->html();
|
||||
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
@ -1 +1,7 @@
|
||||
${votes_all}
|
||||
<table>
|
||||
<tr>
|
||||
<th>Choice</th>
|
||||
<th>Vote Count</th>
|
||||
</tr>
|
||||
${votes_all}
|
||||
</table>
|
||||
@ -1,12 +1,31 @@
|
||||
<?php
|
||||
class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
private function votes_all(){
|
||||
return print_r(votes::get_all_votes(),true);}
|
||||
$votes = votes::get_all_votes();
|
||||
$result = '';
|
||||
foreach($votes as $vote){
|
||||
switch($vote['choice']){
|
||||
case 1:
|
||||
$vote['choice'] = 'PRO';
|
||||
break;
|
||||
case 2:
|
||||
$vote['choice'] = 'CONTRA';
|
||||
break;
|
||||
case 3:
|
||||
$vote['choice'] = 'ENTH';
|
||||
break;
|
||||
}
|
||||
//$vote['count'];
|
||||
//$vote['choice'];
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/votecountchoice.tpl'),$vote);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['votes_all'] = $this->votes_all();
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,7 +3,6 @@ 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']){
|
||||
@ -16,8 +15,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['choices_user_ID'] = $this->user_per_party_overall();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['choices_user_ID'] = $this->user_per_party_overall();
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urVote.tpl'),$vars);
|
||||
}
|
||||
|
||||
|
||||
@ -1,75 +1,27 @@
|
||||
<div>
|
||||
<input type="text" id="vote_title" placeholder="${vote_title}"/>
|
||||
<input type="text" id="iframe_link" placeholder="${iframe_link}"/>
|
||||
<input type="text" id="poll_ID" placeholder="${poll_ID}"/>
|
||||
<br>
|
||||
<br>
|
||||
<!-- <h4>Eingebracht durch</h4>
|
||||
<label><input type="checkbox" id="checkbox_breg" style="margin-top: -1px;">BReg</label>
|
||||
<label><input type="checkbox" id="checkbox_cdu" style="margin-top: -1px;">CDU</label>
|
||||
<label><input type="checkbox" id="checkbox_csu" style="margin-top: -1px;">CSU</label>
|
||||
<label><input type="checkbox" id="checkbox_spd" style="margin-top: -1px;">SPD</label>
|
||||
<label><input type="checkbox" id="checkbox_b90" style="margin-top: -1px;">B90</label>
|
||||
<label><input type="checkbox" id="checkbox_linke" style="margin-top: -1px;">LINKE</label>
|
||||
<input type="text" placeholder="sonstige, hier eintragen"/>
|
||||
<br>
|
||||
|
||||
<h4>Politikfelder</h4>
|
||||
<div style="float: left; padding-right: 5px;">
|
||||
<label><input type="checkbox" id="checkbox_Agrarpolitik" style="margin-top: -1px;">Agrarpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Außenpolitik" style="margin-top: -1px;">Außenpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Bildungspolitik" style="margin-top: -1px;">Bildungspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Energiepolitik" style="margin-top: -1px;">Energiepolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Ernaehrungspolitik" style="margin-top: -1px;">Ernaehrungspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Gesundheitspolitik" style="margin-top: -1px;">Gesundheitspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Innenpolitik" style="margin-top: -1px;">Innenpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Kulturpolitik" style="margin-top: -1px;">Kulturpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Medienpolitik" style="margin-top: -1px;">Medienpolitik</label>
|
||||
</div>
|
||||
<label><input type="checkbox" id="checkbox_Migrationspolitik" style="margin-top: -1px;">Migrationspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Sicherheitspolitik" style="margin-top: -1px;">Sicherheitspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Sozialpolitik" style="margin-top: -1px;">Sozialpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Sportpolitik" style="margin-top: -1px;">Sportpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Umweltpolitik" style="margin-top: -1px;">Umweltpolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Verkehrspolitik" style="margin-top: -1px;">Verkehrspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Verteidigungspolitik" style="margin-top: -1px;">Verteidigungspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Wirtschaftspolitik" style="margin-top: -1px;">Wirtschaftspolitik</label>
|
||||
<label><input type="checkbox" id="checkbox_Europapolitik" style="margin-top: -1px;">Europapolitik</label>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<h4>poll start</h4>
|
||||
<input type="text" placeholder="JJJJ-TT-MM"/> - 00:00
|
||||
<h4>poll end</h4>
|
||||
<input type="text" placeholder="JJJJ-TT-MM"/> - 00:00
|
||||
|
||||
<!-- <div id="user_main" style="border: 2px solid #ccc; right: 0px; position: fixed; padding: 0px; padding-right: 10px; width: 35%; top: 50px; bottom: 50px; overflow-y: scroll;">
|
||||
<div style="margin-right: 10px;">
|
||||
<img src="${frontend_logos}logo2.png" style="float: right" height="100%" width="200px"/>
|
||||
<h5>Auf einen Blick</h5>
|
||||
<form action="/html/tags/html_form_tag_action.cfm" method="post">
|
||||
<br />
|
||||
<textarea name="vote_quick" id="vote_text">Insert Info into here!</textarea>
|
||||
<br />
|
||||
<input type="submit" value="Submit" />
|
||||
</form>
|
||||
<br>
|
||||
<a class="btn btn-green btnvote_yes"
|
||||
id="btnvote_yes"
|
||||
style="width: 65px;"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Pro</font></a>
|
||||
<a class="btn btn-red btnvote_no"
|
||||
style="width: 65px;"
|
||||
href="#"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Contra</font></a>
|
||||
<a class="btn btn-grey btnvote_off"
|
||||
style="width: 65px;"
|
||||
href="#"
|
||||
poll_ID="${poll_ID}"><font
|
||||
size="3">Enthaltung</font></a>
|
||||
</div>
|
||||
</div> -->
|
||||
<br>
|
||||
<a class="btn btn-primary" id="vote_data_submit">Submit</a>
|
||||
<a class="btn btn-primary" id="vote_data_submit">Submit</a>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<h4>BT DATEN</h4>
|
||||
<input type="text" id="poll_ID" placeholder="${poll_ID}"/>
|
||||
<br>
|
||||
<input type="text" id="poll_ID" placeholder="${party}"/>
|
||||
<input type="text" id="poll_ID" placeholder="${votes_pro}"/>
|
||||
<input type="text" id="poll_ID" placeholder="${votes_contra}"/>
|
||||
<input type="text" id="poll_ID" placeholder="${nr_attending}"/>
|
||||
<input type="text" id="poll_ID" placeholder="${total}"/>
|
||||
<input type="text" id="poll_ID" placeholder="${choice}"/>
|
||||
<br>
|
||||
<a class="btn btn-primary" id="bt_data_submit">Submit</a>
|
||||
</div>
|
||||
@ -1,7 +1,6 @@
|
||||
function init_saimod_uvote_vote_edit(){
|
||||
|
||||
$('#vote_data_submit').click(function() {
|
||||
alert ('bla');
|
||||
vote_data_edit(array(
|
||||
$('#vote_title').val(title),
|
||||
$('#iframe_link').val(iframe_link),
|
||||
|
||||
@ -9,6 +9,10 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
|
||||
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_vote_edit(){
|
||||
$vars = array();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user