all working for now - no data
This commit is contained in:
parent
00140a36f8
commit
db92f5bb44
@ -4,34 +4,6 @@ $(document).ready(function() {
|
||||
register_logout();
|
||||
});
|
||||
|
||||
function init_user_list(){
|
||||
$('#tabs_user_list a').click(function (e) {
|
||||
//e.preventDefault();
|
||||
$(this).tab('show');
|
||||
});
|
||||
$('.btn_vote').click(function () {
|
||||
//vote_click($(this).attr('poll_ID'));
|
||||
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
|
||||
open_vote($(this).attr('poll_ID'));
|
||||
register_registerform();
|
||||
});
|
||||
$('.btn_fade').click(function () {
|
||||
$('#vote_data_panel' + $(this).attr('poll_ID')).toggle();
|
||||
});
|
||||
}
|
||||
function init_user_main(){
|
||||
register_registerform();
|
||||
$('#feedback_submit').click(function (data){
|
||||
var test = $('textarea#feedback_text').val();
|
||||
send_feedback(test);
|
||||
});
|
||||
$('#tabs_user_main a').click(function (e) {
|
||||
e.preventDefault();
|
||||
load_user_main_tab($(this).attr('action'));
|
||||
$(this).tab('show');
|
||||
});
|
||||
}
|
||||
|
||||
function register_login(){
|
||||
$("#form_login input").not("[type=submit]").jqBootstrapValidation({
|
||||
preventSubmit: true,
|
||||
@ -56,75 +28,13 @@ function register_logout(){
|
||||
})
|
||||
}
|
||||
|
||||
function register_registerform(){
|
||||
//console.log("wegwegwegwegwegweg");
|
||||
$("#register_user_form input").not("[type=submit]").jqBootstrapValidation(
|
||||
{
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) {
|
||||
if(data == 1){
|
||||
window.location.reload();
|
||||
} else {
|
||||
$('#help-block-user-password-combi-wrong').attr('style', 'display: block;');
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function load_user_main_tab(action){
|
||||
switch(action){
|
||||
case 'user_main_uVote':
|
||||
//$('#tab_uVote').load('./?action='+ action); //causes error
|
||||
return;
|
||||
case 'user_main_urVote':
|
||||
$('#tab_urVote').load('./?action='+ action);
|
||||
return;
|
||||
case 'user_main_myVote':
|
||||
$('#tab_myVote').load('./?action='+ action, function(){
|
||||
$('.add_data_submit').click(function () {
|
||||
submit_add_data();
|
||||
alert('success');
|
||||
});
|
||||
});
|
||||
return;
|
||||
default:
|
||||
}
|
||||
}
|
||||
function init_user_list_active(){
|
||||
$('.btn_fade').click(function () {
|
||||
$('#vote_data_panel' + $(this).attr('poll_ID')).show();
|
||||
});
|
||||
$('.btn_vote').click(function () {
|
||||
//vote_click($(this).attr('poll_ID'));
|
||||
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
|
||||
open_vote($(this).attr('poll_ID'));
|
||||
register_registerform();
|
||||
|
||||
})
|
||||
}
|
||||
function init_user_list_ended(){
|
||||
$('.btn_fade').click(function () {
|
||||
$('#vote_data_panel' + $(this).attr('poll_ID')).show();
|
||||
});
|
||||
$('.btn_vote').click(function () {
|
||||
//vote_click($(this).attr('poll_ID'));
|
||||
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
|
||||
open_vote($(this).attr('poll_ID'));
|
||||
register_registerform();
|
||||
})
|
||||
}
|
||||
|
||||
function account_create(inputEmail, inputPassword){
|
||||
/*function account_create(inputEmail, inputPassword){
|
||||
$.get('./api.php?call=account&action=create&username=' + NULL + '&password_sha=' + password + '&email=' + email + '&locale=deDE', function (data) {
|
||||
dataTmp = data;
|
||||
}).complete(function() {
|
||||
|
||||
});
|
||||
}
|
||||
}*/
|
||||
|
||||
function load_openvoteinfo (poll_ID){
|
||||
var openvoteinfo;
|
||||
@ -245,6 +155,25 @@ function send_feedback (feedback) {
|
||||
});
|
||||
}
|
||||
|
||||
function register_registerform(){
|
||||
//console.log("wegwegwegwegwegweg");
|
||||
$("#register_user_form input").not("[type=submit]").jqBootstrapValidation(
|
||||
{
|
||||
preventSubmit: true,
|
||||
submitError: function($form, event, errors) {},
|
||||
submitSuccess: function($form, event){
|
||||
$.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) {
|
||||
if(data == 1){
|
||||
window.location.reload();
|
||||
} else {
|
||||
$('#help-block-user-password-combi-wrong').attr('style', 'display: block;');
|
||||
}
|
||||
});
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function open_vote (poll_ID) {
|
||||
$('#user_list').load('./api.php?call=vote&action=open_vote&poll_ID=' + poll_ID, function(){
|
||||
$('.btnvote_yes').click(function () {
|
||||
|
||||
@ -10,11 +10,22 @@ class page_uvote extends \SYSTEM\API\api_default {
|
||||
return (new default_register ())->html();}
|
||||
return (new default_bulletin($poll_ID))->html();}
|
||||
|
||||
|
||||
public static function page_user_main(){
|
||||
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
|
||||
return (new default_register ())->html();}
|
||||
return (new user_main())->html();}
|
||||
|
||||
public static function page_user_main_uVote(){
|
||||
return (new user_main_uVote())->html();}
|
||||
|
||||
public static function page_user_main_urVote(){
|
||||
return (new user_main_urVote())->html();}
|
||||
|
||||
public static function page_user_main_myVote(){
|
||||
return (new user_main_myVote())->html();}
|
||||
|
||||
|
||||
public static function page_user_list(){
|
||||
return (new user_list())->html();}
|
||||
|
||||
@ -23,10 +34,4 @@ class page_uvote extends \SYSTEM\API\api_default {
|
||||
|
||||
public static function page_user_list_ended(){
|
||||
return (new user_list_ended())->html();}
|
||||
|
||||
public static function page_user_main_urVote(){
|
||||
return (new user_main_urVote())->html();}
|
||||
|
||||
public static function page_user_main_myVote(){
|
||||
return (new user_main_myVote())->html();}
|
||||
}
|
||||
38
uvote/page/user_list/js/user_list.js
Normal file
38
uvote/page/user_list/js/user_list.js
Normal file
@ -0,0 +1,38 @@
|
||||
function init_user_list(){
|
||||
$('#tabs_user_list a').click(function (e) {
|
||||
//e.preventDefault();
|
||||
});
|
||||
$('.btn_vote').click(function () {
|
||||
//vote_click($(this).attr('poll_ID'));
|
||||
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
|
||||
open_vote($(this).attr('poll_ID'));
|
||||
register_registerform();
|
||||
});
|
||||
$('.btn_fade').click(function () {
|
||||
$('#vote_data_panel' + $(this).attr('poll_ID')).toggle();
|
||||
});
|
||||
}
|
||||
|
||||
function init_user_list_active(){
|
||||
$('.btn_fade').click(function () {
|
||||
$('#vote_data_panel' + $(this).attr('poll_ID')).show();
|
||||
});
|
||||
$('.btn_vote').click(function () {
|
||||
//vote_click($(this).attr('poll_ID'));
|
||||
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
|
||||
open_vote($(this).attr('poll_ID'));
|
||||
register_registerform();
|
||||
|
||||
})
|
||||
}
|
||||
function init_user_list_ended(){
|
||||
$('.btn_fade').click(function () {
|
||||
$('#vote_data_panel' + $(this).attr('poll_ID')).show();
|
||||
});
|
||||
$('.btn_vote').click(function () {
|
||||
//vote_click($(this).attr('poll_ID'));
|
||||
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
|
||||
open_vote($(this).attr('poll_ID'));
|
||||
register_registerform();
|
||||
})
|
||||
}
|
||||
@ -4,6 +4,8 @@ class user_list extends SYSTEM\PAGE\Page {
|
||||
|
||||
public static function css(){
|
||||
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_list/css/list_menu.css'));}
|
||||
public static function js(){
|
||||
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_list/js/user_list.js'));}
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
|
||||
17
uvote/page/user_main/js/user_main.js
Normal file
17
uvote/page/user_main/js/user_main.js
Normal file
@ -0,0 +1,17 @@
|
||||
function init_user_main(){
|
||||
register_registerform();
|
||||
$('#feedback_submit').click(function (data){
|
||||
var test = $('textarea#feedback_text').val();
|
||||
send_feedback(test);
|
||||
});
|
||||
$('#tabs_user_main a').click(function (e) {
|
||||
//e.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
function init_myvote(){
|
||||
$('.add_data_submit').click(function () {
|
||||
submit_add_data();
|
||||
alert('success');
|
||||
});
|
||||
}
|
||||
@ -1,13 +1,11 @@
|
||||
<div class="tabbable" id="tabbable_main_menu">
|
||||
<ul class="nav nav-tabs" id="tabs_user_main">
|
||||
<li class="active"><a href="#tab_uVote" action="user_main_uVote">uVote</a></li>
|
||||
<li><a href="#tab_urVote" action="user_main_urVote">urVote</a></li>
|
||||
<li><a href="#tab_myVote" action="user_main_myVote">myVote</a></li>
|
||||
<li class="active"><a href="#!start(user_main(u))">uVote</a></li>
|
||||
<li><a href="#!start(user_main(ur))">urVote</a></li>
|
||||
<li><a href="#!start(user_main(my))">myVote</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab_uVote">${uVote}</div>
|
||||
<div class="tab-pane" id="tab_urVote" style="overflow: hidden;"></div>
|
||||
<div class="tab-pane" id="tab_myVote"></div>
|
||||
<div class="tab-pane active" id="tab_main"></div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
class user_main extends SYSTEM\PAGE\Page {
|
||||
|
||||
private function css(){
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'user_main/css/main_menu.css').'" rel="stylesheet">';}
|
||||
public static function css(){
|
||||
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_main/css/main_menu.css'));}
|
||||
public static function js(){
|
||||
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_main/js/user_main.js'));}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$uv = new user_main_uVote();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars['uVote'] = $uv->html();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main/main_menu.tpl'),$vars);
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ class DATA_UVOTE extends \SYSTEM\DB\QI {
|
||||
return array( \SYSTEM\SERVERPATH(new \PSQL(),'/mysql/schema_uvote_votes.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/schema_uvote_data.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/schema_uvote_votes_per_party.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/schema_uvote_user_additional.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_text.sql'),
|
||||
\SYSTEM\SERVERPATH(new \PSQL(),'/mysql/system_page.sql'));
|
||||
}
|
||||
|
||||
11
uvote/sql/mysql/schema_uvote_user_additional.sql
Normal file
11
uvote/sql/mysql/schema_uvote_user_additional.sql
Normal file
@ -0,0 +1,11 @@
|
||||
CREATE TABLE `uvote_user_additional` (
|
||||
`user_ID` INT(10) NOT NULL DEFAULT '0',
|
||||
`location` TEXT NOT NULL,
|
||||
`birthyear` INT(10) NULL DEFAULT NULL,
|
||||
`gender` TINYTEXT NULL,
|
||||
`children` TINYTEXT NULL,
|
||||
PRIMARY KEY (`user_ID`)
|
||||
)
|
||||
COLLATE='utf8_general_ci'
|
||||
ENGINE=MyISAM
|
||||
;
|
||||
Loading…
x
Reference in New Issue
Block a user