stable
This commit is contained in:
parent
9957b7198b
commit
42e4d47d22
@ -28,9 +28,15 @@ class graphs {
|
||||
$result = array();
|
||||
$res = \SQL\UVOTE_DATA_GRAPH_PARTY_TO_USER_OVERALL_BY_TIME::QQ(array($timespan, \SYSTEM\SECURITY\Security::getUser()->id, $party, \SYSTEM\SECURITY\Security::getUser()->id));
|
||||
$total = \SQL\UVOTE_DATA_GRAPH_PARTY_TO_USER_OVERALL_BY_TIME_OVERMATCH::Q1(array($party, \SYSTEM\SECURITY\Security::getUser()->id));
|
||||
$matchhandler = 0;
|
||||
$missmatchhandler = 0;
|
||||
while ($row = $res->next()){
|
||||
$match = $row['class_match']+$matchhandler;
|
||||
$missmatch = $row['class_mismatch']+$missmatchhandler;
|
||||
$result[] = array( 0 => $row['day'],
|
||||
'class_match' => $row['class_match'] / $total['total']*100);
|
||||
'class_match' => ($match) / ($match+$missmatch)*100);
|
||||
$matchhandler = $match;
|
||||
$missmatchhandler = $missmatch;
|
||||
}
|
||||
return $returnasjson ? SYSTEM\LOG\JsonResult::toString($result) : $result;
|
||||
}
|
||||
|
||||
BIN
uvote/files/frontend_logos/logo.gif
Normal file
BIN
uvote/files/frontend_logos/logo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
uvote/files/frontend_logos/logo.psd
Normal file
BIN
uvote/files/frontend_logos/logo.psd
Normal file
Binary file not shown.
@ -3,6 +3,7 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_register','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_comment','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_impressum','');
|
||||
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_start','');
|
||||
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_main_votelist','');
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
body {
|
||||
padding-top: 60px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
|
||||
BIN
uvote/page/default_page/pics/logo.gif
Normal file
BIN
uvote/page/default_page/pics/logo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@ -1,12 +1,10 @@
|
||||
<div class="col-md-7">
|
||||
<div class="col-md-12">
|
||||
<form class="" id="form_login">
|
||||
<div class="form-group">
|
||||
<div id="help-block"></div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<button class="btn btn-primary" type="submit" id="login_submit"><span class="glyphicon glyphicon-log-in"></span> ${login}</button>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input type="text"
|
||||
size="20"
|
||||
style=""
|
||||
@ -16,7 +14,7 @@
|
||||
maxlength="16" data-validation-maxlength-message="${register_user_name_too_long}"
|
||||
required data-validation-required-message="${register_user_name_required}"/>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="col-md-3">
|
||||
<input type="password"
|
||||
size="20"
|
||||
style=""
|
||||
@ -26,6 +24,10 @@
|
||||
maxlength="16" data-validation-maxlength-message="${register_user_password_too_long}"
|
||||
required data-validation-required-message="${register_user_password_required}"/>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button class="btn btn-primary" type="submit" id="login_submit"><span class="glyphicon glyphicon-log-in"></span> ${login}</button>
|
||||
</div>
|
||||
<div class="col-md-4"><a href="#!start(user_main(imp))"><button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-tags"></span> Impressum</button></a></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<li class="active"><a href="#!start(user_main(start))"><span class="glyphicon glyphicon-home"></span> Start</a></li>
|
||||
<li><a href="#!start(user_main(u))"><span class="glyphicon glyphicon-edit"></span> Abstimmen</a></li>
|
||||
<li><a href="#!start(user_main(ur))"><span class="glyphicon glyphicon-stats"></span> Auswerten</a></li>
|
||||
<li><a href="#!start(user_main(my))"><span class="glyphicon glyphicon-cog"></span> Mithelfen</a></li>
|
||||
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><span class="glyphicon glyphicon-tags"></span> Impressum</a></li>
|
||||
<!--<li><a href="#!start(user_main(my))"><span class="glyphicon glyphicon-cog"></span> Mithelfen</a></li>-->
|
||||
<li><a href="#!start(user_main(imp))"><span class="glyphicon glyphicon-tags"></span> Impressum</a></li>
|
||||
<li style="float: right">${loginform}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<div class="row">
|
||||
<ul>
|
||||
<li>${loginform}</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -11,36 +11,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="main_container">
|
||||
<div class="modal fade" id="impressum">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Impressum</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div style="background: white;">
|
||||
${impressum_header}
|
||||
${impressum_1}
|
||||
${impressum_2}
|
||||
${impressum_3}
|
||||
${impressum_4}
|
||||
${impressum_5}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<div class="container" id="site-content" style="">
|
||||
<div class="container" id="site-content">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<img class="img-responsive" src="${frontend_logos}logo2.png"/>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<img class="img-responsive" src="${frontend_logos}cover.png"/>
|
||||
<div class="col-md-12">
|
||||
<img class="img-responsive" src="${frontend_logos}logo.gif"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row"><hr></div>
|
||||
|
||||
@ -30,5 +30,8 @@ class page_uvote extends \SYSTEM\API\api_default {
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return (new default_register ())->html();}
|
||||
return (new user_main_votelist())->html();}
|
||||
|
||||
public static function page_user_main_impressum(){
|
||||
return (new user_main_impressum())->html();}
|
||||
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
function init_user_main_analysis(){
|
||||
|
||||
|
||||
load_visualisation_urvote('graph_user_to_party_overall_bt', 84600);
|
||||
load_visualisation_user_to_party_overall('graph_user_to_party_overall_cdu', 'cdu', 84600);
|
||||
load_visualisation_user_to_party_overall('graph_user_to_party_overall_csu', 'csu', 84600);
|
||||
load_visualisation_user_to_party_overall('graph_user_to_party_overall_spd', 'spd', 84600);
|
||||
@ -60,7 +60,16 @@ function load_visualisation_urvote(id, timespan){
|
||||
first = true;
|
||||
data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [parseFloat(v)];}}));});
|
||||
|
||||
var options = {title: id, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{}, vAxis:{logScale: false}, interpolateNulls: false, width: "300", height: "250"};
|
||||
var options = {title: id,
|
||||
aggregationTarget: 'category',
|
||||
selectionMode: 'multiple',
|
||||
legend: 'none',
|
||||
curveType: 'function', /*focusTarget: 'category',*/ chartArea:{},
|
||||
vAxis:{logScale: false},
|
||||
legend: 'none',
|
||||
interpolateNulls: false,
|
||||
width: "800",
|
||||
height: "250"};
|
||||
new google.visualization.LineChart(document.getElementById(id)).draw(data, options);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Aktueller Status</h5>
|
||||
<h4>Aktueller Status</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@ -15,10 +15,15 @@
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_2" style="padding-top: 30px;">
|
||||
<div class="panel panel-default panel-success">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#acc_2" href="#acc_2_body">
|
||||
<div class="panel-heading" style="padding: 0" >
|
||||
<a data-toggle="collapse" data-parent="#acc_2" href="#acc_2_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-user"></span> Deine Daten
|
||||
</h4>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_2_body" class="row panel-body panel-collapse collapse">
|
||||
<div class="row">
|
||||
@ -26,10 +31,11 @@
|
||||
${basic_stats}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
${analysis_help_basic stats}
|
||||
${analysis_math_basic stats}
|
||||
${analysis_help_basic_stats}
|
||||
${analysis_math_basic_stats}
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row" style="padding-top: 20px;">
|
||||
<div class="col-md-6">
|
||||
<div>${user_temp_votes}</div>
|
||||
@ -47,10 +53,14 @@
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_4" style="padding-top: 10px;">
|
||||
<div class="panel panel-default panel-warning">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#acc_4" href="#acc_4_body">
|
||||
<div class="panel-heading" style="padding: 0">
|
||||
<a data-toggle="collapse" data-parent="#acc_4" href="#acc_4_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-th-large"></span> Bilanz: Fraktionen
|
||||
</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_4_body" class="row panel-body panel-collapse collapse">
|
||||
<div class="col-md-6">
|
||||
@ -81,10 +91,14 @@
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_5" style="padding-top: 10px;">
|
||||
<div class="panel panel-default panel-warning">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#acc_5" href="#acc_5_body">
|
||||
<div class="panel-heading" style="padding: 0">
|
||||
<a data-toggle="collapse" data-parent="#acc_5" href="#acc_5_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-th"></span> Bilanz: Fraktionen nach Stimmverhalten
|
||||
</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_5_body" class="row panel-collapse collapse panel-body" style="padding-top: 20px;">
|
||||
<div class="row">
|
||||
@ -125,10 +139,14 @@
|
||||
</div>
|
||||
<div class="panel-group row" id="acc_7" style="padding-top: 10px;">
|
||||
<div class="panel panel-default panel-warning">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#acc_7" href="#acc_7_body">
|
||||
<div class="panel-heading" style="padding: 0">
|
||||
<a data-toggle="collapse" data-parent="#acc_7" href="#acc_7_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-list-alt"></span> Bilanz: Bundestag
|
||||
</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_7_body" class="row panel-body panel-collapse collapse">
|
||||
<div class="col-md-6">
|
||||
@ -150,10 +168,14 @@
|
||||
|
||||
<div class="row panel-group" id="acc_6" style="padding-top: 10px;">
|
||||
<div class="panel panel-default panel-danger">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#acc_6" href="#acc_6_body">
|
||||
<div class="panel-heading" style="padding: 0">
|
||||
<a data-toggle="collapse" data-parent="#acc_6" href="#acc_6_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-random"></span> Entwicklung: Fraktionen
|
||||
</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_6_body" class="panel-body panel-collapse collapse">
|
||||
<div class="row">
|
||||
@ -183,12 +205,36 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row panel-group" id="acc_8" style="padding-top: 10px;">
|
||||
<div class="panel panel-default panel-danger">
|
||||
<div class="panel-heading" style="padding: 0">
|
||||
<a data-toggle="collapse" data-parent="#acc_8" href="#acc_8_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-random"></span> Entwicklung: Bundestag
|
||||
</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_8_body" class="panel-body panel-collapse collapse">
|
||||
<div class="row">
|
||||
<img class="img-responsive" src="${frontend_logos}icon_bt.png"/>
|
||||
</div>
|
||||
<div id="graph_user_to_party_overall_bt" class="row"></div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row panel-group" id="acc_3" style="padding-top: 10px;">
|
||||
<div class="panel panel-default panel-primary">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#acc_3" href="#acc_3_body">
|
||||
<h4 class="panel-title">
|
||||
<div class="panel-heading" style="padding: 0">
|
||||
<a data-toggle="collapse" data-parent="#acc_3" href="#acc_3_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title" style="color: white">
|
||||
<span class="glyphicon glyphicon-globe"></span> community Statistik
|
||||
</h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="acc_3_body" class="panel-body panel-collapse collapse">
|
||||
<div class="col-md-6">
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h5>Deine Stimmverteilung</h5>
|
||||
<h4>Deine Stimmverteilung</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@ -79,6 +79,8 @@ class user_main_analysis extends SYSTEM\PAGE\Page {
|
||||
$vars['votes_all_bt'] = $this->votes_all_bt();
|
||||
$vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('help'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('math'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/user_main_analysis.tpl'),$vars);
|
||||
}
|
||||
|
||||
19
uvote/page/user_main_impressum/tpl/user_main_impressum.tpl
Normal file
19
uvote/page/user_main_impressum/tpl/user_main_impressum.tpl
Normal file
@ -0,0 +1,19 @@
|
||||
<div class="panel-group row" id="acc_1">
|
||||
<div class="panel panel-default panel-info">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Impressum
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body" id="acc_1_body">
|
||||
<div class="col-md-12">
|
||||
${impressum_header}
|
||||
${impressum_1}
|
||||
${impressum_2}
|
||||
${impressum_3}
|
||||
${impressum_4}
|
||||
${impressum_5}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
10
uvote/page/user_main_impressum/user_main_impressum.php
Normal file
10
uvote/page/user_main_impressum/user_main_impressum.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
class user_main_impressum {
|
||||
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 = 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(),'user_main_impressum/tpl/user_main_impressum.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="row panel-group">
|
||||
<div class="row panel-group row">
|
||||
<div class="panel panel-default panel-info">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
|
||||
@ -1,16 +1,38 @@
|
||||
<div>
|
||||
<input type="text" id="${ID}_vote_title" value="${title}"/>
|
||||
<input type="text" id="${ID}_iframe_link" value="${iframe_link}"/>
|
||||
<br>
|
||||
<br>
|
||||
<h4>poll start</h4>
|
||||
<input type="text" id="${ID}_time_start" value="${time_start}"/> - 00:00
|
||||
<h4>poll end</h4>
|
||||
<input type="text" id="${ID}_time_end" value="${time_end}"/> - 00:00
|
||||
<h4>tags</h4>
|
||||
<input type="text" id="${ID}_tags" value="tags" style="width: 100%"/>
|
||||
<div class="panel-group row" id="panel_${ID}" style="padding-top: 5px;">
|
||||
<div class="panel panel-default panel-success">
|
||||
<div class="panel-heading" style="padding: 0" >
|
||||
<a data-toggle="collapse" data-parent="#panel_${ID}" href="#panel_${ID}_body">
|
||||
<div style="width: 100%; height: 100%; padding: 10px;">
|
||||
<h4 class="panel-title">
|
||||
<span class="glyphicon glyphicon-user"></span> ${title}
|
||||
</h4>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div id="panel_${ID}_body" class="row panel-body panel-collapse collapse">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>title</h4>
|
||||
<input style="width: 100%" type="text" id="${ID}_vote_title" value="${title}"/><br><br>
|
||||
<h4>src</h4>
|
||||
<input style="width: 100%" type="text" id="${ID}_iframe_link" value="${iframe_link}"/>
|
||||
<h4>tags</h4>
|
||||
<input type="text" id="${ID}_tags" value="tags" style="width: 100%"/>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>poll start</h4>
|
||||
<input type="text" id="${ID}_time_start" value="${time_start}"/> - 00:00
|
||||
<h4>poll end</h4>
|
||||
<input type="text" id="${ID}_time_end" value="${time_end}"/> - 00:00
|
||||
<h4>bt choice</h4>
|
||||
<input type="text" id="${ID}_bt_choice" value="${bt_choice}"/><br><br>
|
||||
<a id="${ID}_data_submit" class="btn btn-primary bt_data_submit" poll_ID="${ID}">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
${parties}
|
||||
<a id="${ID}_partydata_submit" class="btn btn-primary bt_partydata_submit" poll_ID="${ID}">Submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<a id="${ID}_data_submit" class="btn btn-primary bt_data_submit" poll_ID="${ID}">Submit</a>
|
||||
</div>
|
||||
16
uvote/sai/saimod_uvote_vote_edit/new.tpl
Normal file
16
uvote/sai/saimod_uvote_vote_edit/new.tpl
Normal file
@ -0,0 +1,16 @@
|
||||
<div>
|
||||
<input type="text" id="${ID}_vote_title" value="${title}"/>
|
||||
<input type="text" id="${ID}_iframe_link" value="${iframe_link}"/>
|
||||
<br>
|
||||
<br>
|
||||
<h4>poll start</h4>
|
||||
<input type="text" id="${ID}_time_start" value="${time_start}"/> - 00:00
|
||||
<h4>poll end</h4>
|
||||
<input type="text" id="${ID}_time_end" value="${time_end}"/> - 00:00
|
||||
<h4>tags</h4>
|
||||
<input type="text" id="${ID}_tags" value="tags" style="width: 100%"/>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<a id="${ID}_data_submit" class="btn btn-primary bt_data_submit" poll_ID="${ID}">Submit</a>
|
||||
</div>
|
||||
1
uvote/sai/saimod_uvote_vote_edit/parties.tpl
Normal file
1
uvote/sai/saimod_uvote_vote_edit/parties.tpl
Normal file
@ -0,0 +1 @@
|
||||
${partylist}
|
||||
12
uvote/sai/saimod_uvote_vote_edit/party.tpl
Normal file
12
uvote/sai/saimod_uvote_vote_edit/party.tpl
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<input id="${party}_input_party" type="text" value="${party}"/>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<input id="${party}_input_pro" type="number" value="${votes_pro}"/>
|
||||
<input id="${party}_input_con" type="number" value="${votes_contra}"/>
|
||||
<input id="${party}_input_att" type="number" value="${nr_attending}"/>
|
||||
<input id="${party}_input_total" type="number" value="${total}"/>
|
||||
<input id="${party}_input_choice" type="number" value="${choice}"/>
|
||||
</div>
|
||||
</div>
|
||||
12
uvote/sai/saimod_uvote_vote_edit/partynew.tpl
Normal file
12
uvote/sai/saimod_uvote_vote_edit/partynew.tpl
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<input id="input_party" type="text" placeholder="party" value=""/>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<input id="input_pro" type="number" placeholder="votes_pro" value=""/>
|
||||
<input id="input_con" type="number" placeholder="votes_contra" value=""/>
|
||||
<input id="input_att" type="number" placeholder="nr_attending" value=""/>
|
||||
<input id="input_total" type="number" placeholder="total" value=""/>
|
||||
<input id="input_choice" type="number" placeholder="choice" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
@ -4,8 +4,9 @@ $('.bt_data_submit').click(function() {
|
||||
var title = $('#' + poll_ID + '_vote_title').val();
|
||||
var time_end = $('#' + poll_ID + '_time_end').val();
|
||||
var iframe_link = $('#' + poll_ID + '_iframe_link').val();
|
||||
var tags = JSON.stringify($('#' + poll_ID + '_tags').val().split(',').map(function(s) { return s.trim() }));
|
||||
var data = {poll_ID: poll_ID, title: title, time_end: time_end, iframe_link: iframe_link};
|
||||
$.getJSON('./sai.php?sai_mod=.SAI.saimod_uvote_vote_edit&action=edit_vote&data=' + JSON.stringify(data), function(data) {
|
||||
$.getJSON('./sai.php?sai_mod=.SAI.saimod_uvote_vote_edit&action=edit_vote&data=' + JSON.stringify(data) + '&tags=' + tags, function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
@ -15,6 +16,24 @@ $('.bt_data_submit').click(function() {
|
||||
});
|
||||
});
|
||||
};
|
||||
$('.bt_partydata_submit').click(function() {
|
||||
var poll_ID = $(this).attr('poll_ID');
|
||||
var party = $('#input_party').val();
|
||||
var votes_pro = $('#input_pro').val();
|
||||
var votes_contra = $('#input_con').val();
|
||||
var nr_attending = $('#input_att').val();
|
||||
var total = $('#input_total').val();
|
||||
var choice = $('#input_choice').val();
|
||||
var data = {poll_ID: poll_ID, party: party, votes_pro: votes_pro, votes_contra: votes_contra, nr_attending: nr_attending, total: total, choice: choice};
|
||||
$.getJSON('./sai.php?sai_mod=.SAI.saimod_uvote_vote_edit&action=edit_partydata&data=' + JSON.stringify(data), function(data) {
|
||||
var items = [];
|
||||
if(data.status == true){
|
||||
alert("success");
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@ -14,9 +14,17 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod_saimod_uvote_new_vote(){
|
||||
$ID = array();
|
||||
$ID['ID'] = '';
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/main.tpl'), $ID);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/new.tpl'), $ID);
|
||||
}
|
||||
public static function party_stats($poll_ID){
|
||||
$result = '';
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/partynew.tpl'));
|
||||
$parties = \SQL\UVOTE_DATA_PARTY_PER_POLL::QA(array($poll_ID));
|
||||
foreach($parties as $poll){
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/party.tpl'), $poll);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public static function sai_mod__SAI_saimod_uvote_vote_edit(){
|
||||
/*$vars = array();
|
||||
@ -28,29 +36,44 @@ class saimod_uvote_vote_edit extends \SYSTEM\SAI\SaiModule {
|
||||
$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'] = \switchers::tablerow_class(\votes::getUserPollData($vote['ID']));
|
||||
$vote['bt_vote_class'] = \switchers::tablerow_class($vote['bt_choice']);
|
||||
$time_span = strtotime($vote['time_end']) - strtotime($vote['time_start']);
|
||||
$vote['time_left'] = round($time_remain/($time_span+1)*100,0);
|
||||
$vote['time_done'] = 100-$vote['time_left'];
|
||||
|
||||
$vote['parties'] = self::party_stats($vote['ID']);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/main.tpl'), $vote);
|
||||
}
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \PSAI(),'saimod_uvote_vote_edit/saimod_uvote_vote_edit.tpl'), array('list' => $result));
|
||||
}
|
||||
|
||||
public static function sai_mod__SAI_saimod_uvote_vote_edit_action_edit_vote($data_json){
|
||||
public static function sai_mod__SAI_saimod_uvote_vote_edit_action_edit_vote($data_json, $tags_json){
|
||||
$tags = \json_decode($tags_json);
|
||||
$data_stdClass = \json_decode($data_json);
|
||||
$data = (array)$data_stdClass;
|
||||
if(!$data['poll_ID']){
|
||||
new \SYSTEM\LOG\WARNING(print_r($data, TRUE));
|
||||
\SYSTEM\DBD\SYS_TEXT_SAVE::QI(array($stamp,'deDE',$data['title'], 'wed', ''));
|
||||
\SYSTEM\DBD\SYS_TEXT_SAVE_TAG::QI(array($stamp,$tag));
|
||||
\SYSTEM\PAGE\text::save($data['title'], $data['title'], 'deDE', $tags, 'blanc');
|
||||
return \SQL\UVOTE_DATA_NEW_POLL::QA(array($data['title'], $data['time_end'], $data['iframe_link']));
|
||||
}
|
||||
return \SQL\UVOTE_DATA_EDIT_POLL::QA(array($data['poll_ID'], $data['title'], $data['time_end'], $data['iframe_link']));
|
||||
|
||||
}
|
||||
public static function sai_mod__SAI_saimod_uvote_vote_edit_action_edit_partydata($data_json){
|
||||
$datastd = \json_decode($data_json);
|
||||
$data = (array)$datastd;
|
||||
new \SYSTEM\LOG\WARNING(print_r($data, TRUE));
|
||||
return \SQL\UVOTE_DATA_EDIT_PARTYDATA::QA(array($data['poll_ID'],
|
||||
$data['party'],
|
||||
$data['votes_pro'],
|
||||
$data['votes_contra'],
|
||||
$data['nr_attending'],
|
||||
$data['total'],
|
||||
$data['choice'],
|
||||
$data['votes_pro'],
|
||||
$data['votes_contra'],
|
||||
$data['nr_attending'],
|
||||
$data['total'],
|
||||
$data['choice']));
|
||||
}
|
||||
public static function html_li_menu(){return '<li><a href="#!vote">Edit Votes</a></li>';}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
|
||||
@ -10,46 +10,7 @@
|
||||
<a class="btn btn-primary btn-small btn_editvote" style="float:right" poll_ID="${ID}">Edit</a>
|
||||
</div>
|
||||
<div class="col-md-4 ${bt_vote_class}" style="margin-top: 10px; border-left: 1px solid lightgray;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
cdu
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input type="number"/><input type="number"/><input type="number"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
csu
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input type="number"/><input type="number"/><input type="number"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
spd
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input type="number"/><input type="number"/><input type="number"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
grüne
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input type="number"/><input type="number"/><input type="number"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
linke
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input type="number"/><input type="number"/><input type="number"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-1" style="margin-top: 10px; border-left: 1px solid lightgray;">
|
||||
uv
|
||||
|
||||
8
uvote/sql/qq/UVOTE_DATA_EDIT_NEW_POLL.php
Normal file
8
uvote/sql/qq/UVOTE_DATA_EDIT_NEW_POLL.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UVOTE_EDIT_NEW_POLL extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE uvote_votes SET title = "testtest", iframe_link = "testtestttest" WHERE ID = 40;'
|
||||
;}}
|
||||
24
uvote/sql/qq/UVOTE_DATA_EDIT_PARTYDATA.php
Normal file
24
uvote/sql/qq/UVOTE_DATA_EDIT_PARTYDATA.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UVOTE_DATA_EDIT_PARTYDATA extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'INSERT INTO uvote_votes_per_party (
|
||||
`poll_ID`,
|
||||
`party`,
|
||||
`votes_pro`,
|
||||
`votes_contra`,
|
||||
`nr_attending`,
|
||||
`total`,
|
||||
`choice`,
|
||||
`bt_choice`)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, 0)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
votes_pro = ?,
|
||||
votes_contra = ?,
|
||||
nr_attending = ?,
|
||||
total = ?,
|
||||
choice = ?;
|
||||
'
|
||||
;}}
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace SQL;
|
||||
|
||||
class UVOTE_EDIT_NEW_POLL extends \SYSTEM\DB\QP {
|
||||
class UVOTE_DATA_EDIT_POLL extends \SYSTEM\DB\QP {
|
||||
public static function get_class(){return \get_class();}
|
||||
public static function mysql(){return
|
||||
'UPDATE uvote_votes SET title = "testtest", iframe_link = "testtestttest" WHERE ID = 40;'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user