updated uvote + updated system reference

This commit is contained in:
Ulf Gebhardt 2013-06-14 00:59:27 +02:00
parent 34ff182b5d
commit 34fdf36231
9 changed files with 112 additions and 47 deletions

View File

@ -6,14 +6,14 @@ require_once '../system/log/register_exception_shortcut.php';
require_once '../system/log/register_errorhandler_jsonoutput.php'; //print errors as json to caller
SYSTEM\system::start(array( array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING, E_ALL | E_STRICT),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL, 'http://www.mojotrollz.eu/web/iVote/'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH, '/home/web/webdir/iVote/'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL, 'http://www.mojotrollz.eu/web/uVote/'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH, '/home/web/webdir/uVote/'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE, SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE_MYS),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST, '127.0.0.1'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT, ''),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, 'mojotrolls_mysql'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, 'dajsabeaisvd345'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME, 'host_danube')));
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, 'mojotrolls_dev'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, 'dsjgfasudzfsvad'),
array(SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME, 'host_uVote')));
$page = new \SYSTEM\PAGE\PageApi(new SYSTEM\verifyclass(), new PageApi());
echo $page->CALL(array_merge($_POST,$_GET))->html();

View File

@ -0,0 +1,6 @@
<?php
$autoload = SYSTEM\autoload::getInstance();
$autoload->registerFolder(dirname(__FILE__),'');
$autoload->registerFolder(dirname(__FILE__).'/votes','');

22
uVote/api/votes/votes.php Normal file
View File

@ -0,0 +1,22 @@
<?php
class votes {
public static function getAllVotesOfGroup($groupid){
$con = new \SYSTEM\DB\Connection(new \DBD\uVote());
$res = $con->prepare( 'selVoteByGrp',
'SELECT * FROM `uvote_votes` WHERE `group` = ?;',
array($groupid));
$result = array();
//$r = array();
while($r = $res->next()){
//print_r($r);
//$result[] = array('title' => $r['title'],'text' => $r['text']);
$result[] = $r;
//print_r($result);
//echo "</br></br>";
}
//print_r($result);
return $result;
}
}

View File

@ -3,6 +3,6 @@
//keep this
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__).'/dbd/autoload.inc.php';
//require_once dirname(__FILE__).'/api/autoload.inc.php';
require_once dirname(__FILE__).'/api/autoload.inc.php';

View File

@ -0,0 +1,9 @@
<?php
$autoload = SYSTEM\autoload::getInstance();
$autoload->registerFolder(dirname(__FILE__).'/db/','DBD');
$autoload->registerFolder(dirname(__FILE__).'/tbl/','DBD');
//$autoload->registerFolder(dirname(__FILE__).'/tbl/definitions/','DBD\DEFINITIONS');
//$autoload->registerFolder(dirname(__FILE__).'/tbl/data/','DBD\DATA');
//$autoload->registerFolder(dirname(__FILE__).'/tbl/data_processed/','DBD\DATA_PROCESSED');

8
uVote/dbd/db/uVote.php Normal file
View File

@ -0,0 +1,8 @@
<?php
namespace DBD;
class uVote extends \SYSTEM\DB\DBInfoMYS {
public function __construct() {
parent::__construct('host_uVote', 'mojotrolls_dev', 'dsjgfasudzfsvad', '127.0.0.1');}
}

View File

@ -0,0 +1,31 @@
<?php
namespace DBD;
class locale_string extends \SYSTEM\DBD\locale_string {
const VALUE_CATEGORY_DASENSE = 100;
const VALUE_CATEGORY_DASENSE_DEFAULTPAGE = 110;
const VALUE_CATEGORY_DASENSE_GEOPOINT = 111;
const VALUE_CATEGORY_DASENSE_IMPRESSUM = 112;
const VALUE_CATEGORY_DASENSE_PROJECT = 113;
const VALUE_CATEGORY_DASENSE_SENSOR = 114;
const VALUE_CATEGORY_DASENSE_USERLOGIN = 115;
const VALUE_CATEGORY_DASENSE_USERLOGOUT = 116;
const VALUE_CATEGORY_DASENSE_USER = 117;
const VALUE_CATEGORY_DASENSE_PRESS = 118;
const VALUE_CATEGORY_DASENSE_CONTACT = 119;
const VALUE_CATEGORY_DASENSE_USERSTATISTICS = 120;
const VALUE_CATEGORY_DASENSE_HIGHSCORE = 121;
const VALUE_CATEGORY_DASENSE_DEVS = 122;
const VALUE_CATEGORY_DB_ADMIN_LEVEL = 200;
const VALUE_CATEGORY_DB_BADGE_CATEGORY = 201;
const VALUE_CATEGORY_DB_BADGE = 202;
const VALUE_CATEGORY_DB_TITLE = 203;
const VALUE_CATEGORY_DB_LOCALITY = 204;
const VALUE_CATEGORY_APP_ALL = 300;
const VALUE_CATEGORY_APP_ANDROID = 301;
const VALUE_CATEGORY_APP_IOS = 302;
}

View File

@ -7,46 +7,13 @@ class default_page extends SYSTEM\PAGE\Page {
}
public function generate_votelist(){
return '<div class="hero-unit" style="padding: 5px; background: white;">
<div class="row" style="width: 100%; margin: auto;">
<div class="span6">
<h2>Title</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.</p>
<i class="icon-chevron-sign-down"></i>
</div>
<div class="span5" style="">
<h2>Abstimmung</h2>
<a class="btn btn-large btn-green" style="width: 110px;" href="#">Pro &raquo;</a>
<a class="btn btn-large btn-red" style="width: 110px; background-color: red;" href="#">Contra &raquo;</a>
<a class="btn btn-large btn-grey" style="width: 110px; background-color: grey;" href="#">Enthaltung &raquo;</a>
<!-- Countdown-Generator by www.coolplace.cc -->
<form name="coolcccount">
<p>
<input size="75" name="coolcc">
</form>
</div>
</div>
</div>
<div class="hero-unit" style="padding: 5px; background: white; margin-top: -20px;">
<div class="row" style="width: 100%; margin: auto;">
<div class="span6">
<h2>Title</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.</p>
<i class="icon-chevron-sign-down"></i>
</div>
<div class="span5" style="">
<h2>Abstimmung</h2>
<a class="btn btn-large btn-green" style="width: 110px;" href="#">Pro &raquo;</a>
<a class="btn btn-large btn-red" style="width: 110px; background-color: red;" href="#">Contra &raquo;</a>
<a class="btn btn-large btn-grey" style="width: 110px; background-color: grey;" href="#">Enthaltung &raquo;</a>
</div>
</div>
</div>
</div>';
$result = "";
$votes = votes::getAllVotesOfGroup(1);
foreach($votes as $vote){
$vars = array('vote_title' => $vote['title'], 'vote_text' => $vote['text']);
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vars);
}
return $result;
}
public function html(){

View File

@ -0,0 +1,22 @@
<div class="hero-unit" style="padding: 5px; background: white;">
<div class="row" style="width: 100%; margin: auto;">
<div class="span6">
<h2>${vote_title}</h2>
<p>${vote_text}</p>
<i class="icon-chevron-sign-down"></i>
</div>
<div class="span5" style="">
<h2>Abstimmung</h2>
<a class="btn btn-large btn-green" style="width: 110px;" href="#">Pro &raquo;</a>
<a class="btn btn-large btn-red" style="width: 110px; background-color: red;" href="#">Contra &raquo;</a>
<a class="btn btn-large btn-grey" style="width: 110px; background-color: grey;" href="#">Enthaltung &raquo;</a>
<!-- Countdown-Generator by www.coolplace.cc -->
<form name="coolcccount">
<input size="120" name="coolcc">
</form>
</div>
</div>
</div>