had to make state

This commit is contained in:
Nael 2014-01-20 13:09:39 +01:00
parent 8b688882fc
commit b0822c2cfc
18 changed files with 84 additions and 26 deletions

View File

@ -11,4 +11,10 @@ class api_uvote extends \SYSTEM\API\api_login {
}
public static function call_vote_action_barsperusers($poll_ID){
return votes::get_barsperusers($poll_ID);}
}
public static function call_img($cat, $id){
return \SYSTEM\IMG\img::get($cat, $id);
}
}

View File

@ -100,7 +100,7 @@ class votes {
$vote = votes::getVoteOfGroup($poll_ID);
new INFO(print_r($vote, true));
$vars = array('vote_text' => $vote['text'], 'vote_quick' => $vote['quick'], 'vote_title' => $vote['title'], 'vote_init' => $vote['initiative'], 'poll_ID' => $vote['ID'], 'time_end' => $vote['time_end']);
$vars = array('vote_text' => $vote['text'], 'vote_title' => $vote['title'], 'vote_init' => $vote['initiative'], 'poll_ID' => $vote['ID'], 'time_end' => $vote['time_end']);
$result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/full_vote.tpl'), $vars);
return $result;
}

View File

@ -4,5 +4,5 @@
require_once dirname(__FILE__).'/path/register_path_classes.php';
require_once dirname(__FILE__).'/page/register_page_classes.php';
require_once dirname(__FILE__).'/dbd/autoload.inc.php';
require_once dirname(__FILE__).'/img/autoload.inc.php';
require_once dirname(__FILE__).'/api/autoload.inc.php';

View File

@ -0,0 +1,3 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
require_once dirname(__FILE__).'/register_img.php';

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View File

@ -0,0 +1,2 @@
<?php
\SYSTEM\IMG\img::registerFolder(dirname(__FILE__).'/frontend_logos/','frontend_logos','*.png');

View File

@ -1,10 +1,14 @@
<div style="margin-right: 10px; float: right;">
<script language="JavaScript" src="/default_bulletin/js/vote.js">
</script>
<div style="margin-right: 10px;">
<img src="${frontend_logos}logo2.png" style="float: right" width="200px"/>
<h5>Auf einen Blick</h5>
${vote_quick}
<br>
<a class="btn btn-green btnvote_yes"
style="width: 65px;"
href="#"
<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"

View File

@ -4,14 +4,16 @@ class default_bulletin extends SYSTEM\PAGE\Page {
public function __construct($poll_ID) {
$this->poll_ID=$poll_ID;
}
private function js(){
return '<script src="'.SYSTEM\WEBPATH(new PPAGE(),'default_bulletin/js/vote.js').'"></script>';
}
public function html(){
$result = array();
$result = array_merge($result,votes::get_voteinfo($this->poll_ID));
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$result);
$vars['js'] = $this->js();
$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,votes::get_voteinfo($this->poll_ID));
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$vars);
}
}

View File

@ -0,0 +1,27 @@
$('#btnvote_yes').click(function () {
alert("1");
vote_click($(this).attr('poll_ID'),1);
alert("2");
});
$('#btnvote_no').click(function () {
vote_click($(this).attr('poll_ID'),2);
});
$('#btnvote_off').click(function () {
vote_click($(this).attr('poll_ID'),3);
});
function vote_click (poll_ID, vote) {
$.getJSON('./api.php?call=vote&action=vote&poll_ID=' + poll_ID + '&vote=' + vote, function(data) {
var items = [];
if(data.status == true){
alert("sucess");
} else {
alert(data.result.message);
alert("abc")
}
});
}

View File

@ -1,5 +1,5 @@
<div style="background: lightyellow; margin-bottom: 8px; -webkit-box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.5); box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.5);">
<div class="row" style="margin: 0; margin-top: 15px;">
<div class="row" style="margin: 0; background: #f1f1f1;">
<div class="span6" style="width: 50%;">
<h4>${vote_title}</h4>
<br>
@ -12,6 +12,6 @@
${vote_text}
</div>
</div>
</div>
</div>

View File

@ -11,8 +11,10 @@ $(document).ready(function() {
open_vote($(this).attr('poll_ID'));
$('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID'));
});
/*$('.btnvote_yes').click(function () {
$('.btnvote_yes').click(function () {
alert("1");
vote_click($(this).attr('poll_ID'),1);
alert("2");
});
$('.btnvote_no').click(function () {
vote_click($(this).attr('poll_ID'),2);
@ -21,7 +23,7 @@ $(document).ready(function() {
vote_click($(this).attr('poll_ID'),3);
});
$('.btn_openvoteinfo').click(function () {
/*$('.btn_openvoteinfo').click(function () {
if($("#openvoteinfo"+$(this).attr('poll_ID')).is(':visible')){
$('#openvoteinfo'+$(this).attr('poll_ID')).slideUp('slow');
}else{
@ -139,6 +141,7 @@ function vote_click (poll_ID, vote) {
alert("sucess");
} else {
alert(data.result.message);
alert("abc")
}
});
}

View File

@ -47,7 +47,7 @@
</div>
<div class="container" id="site-content-wrapper" style="margin-top: 0;">
<div id="site-content" style="padding: 0; margin: 0;">
<div id="list" style="position: fixed; padding: 0px; width: 800px; top: 50px; bottom: 50px; overflow-y: scroll; float: left;">
<div id="list" style="border: 2px solid #ccc; position: fixed; padding: 0px; width: 800px; top: 50px; bottom: 50px; overflow-y: scroll; float: left;">
${votelist}
</div>
<div id="user_main" style="right: 0px; position: fixed; padding: 0px; padding-right: 10px; width: 35%; top: 50px; bottom: 50px; overflow-y: scroll;">
@ -56,4 +56,4 @@
</div>
</div>
</body>
</html>
</html>

View File

@ -1,4 +1,4 @@
<div style="padding: 5px; background: #f1f1f1; margin-bottom: 8px; border: 2px solid #ccc;">
<div style="padding: 5px; background: #f1f1f1; margin-bottom: 8px;">
<div class="row" style="width: 100%; margin: 0; margin-top: 5px; margin-bottom: 8px;">
<div class="span6">
<h4>${vote_title}</h4>
@ -6,7 +6,7 @@
<br>
Politikfeld(er):
</div>
<a class="btn btn_vote" poll_ID="${poll_ID}" style="float: right; margin-top: 10px;">Abstimmen</a>
<a class="btn btn_primary btn_vote" poll_ID="${poll_ID}" style="float: right; margin-top: 10px;">Abstimmen</a>
<!--<div class="span5" style="margin-top: 15px;">
<a class="btn btn-large btn-green btnvote_yes" style="width: 110px;" poll_ID="$">Pro &raquo;</a>
<a class="btn btn-large btn-red btnvote_no" style="width: 110px; background-color: red;" href="#" poll_ID="$">Contra &raquo;</a>

View File

@ -4,8 +4,9 @@ class default_register extends SYSTEM\PAGE\Page {
public function html(){
$vars = array();
$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=';
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_register/register.tpl'), $vars);
$vars['PIC_PATH'] = SYSTEM\WEBPATH(new PPAGE(),'default_register/pics/');
}
}

View File

@ -1,4 +1,4 @@
<h1>${register}</h1>
<img src="${frontend_logos}logo2.png"/>
<br />
<br />
<form class="textbox" id="register_user_form">

5
uVote/path/JQQTIP.php Normal file
View File

@ -0,0 +1,5 @@
<?php
class JQQTIP extends \SYSTEM\PATH {
public static function getPath(){
return \SYSTEM\C_ROOT.'lib/jqueryqtip/'.\SYSTEM\C_SUBPATH;}
}

5
uVote/path/PSAI.php Normal file
View File

@ -0,0 +1,5 @@
<?php
class PSAI extends \SYSTEM\PATH {
public static function getPath(){
return \SYSTEM\C_ROOT.'mojotrollz/sai/'.\SYSTEM\C_SUBPATH;}
}