From 34fdf362317069d98038cb281a5447d09ebc9787 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 14 Jun 2013 00:59:27 +0200 Subject: [PATCH] updated uvote + updated system reference --- index.php | 10 ++--- uVote/api/autoload.inc.php | 6 +++ uVote/api/votes/votes.php | 22 +++++++++++ uVote/autoload.inc.php | 4 +- uVote/dbd/autoload.inc.php | 9 +++++ uVote/dbd/db/uVote.php | 8 ++++ uVote/dbd/tbl/locale_string.php | 31 ++++++++++++++++ uVote/page/default_page/default_page.php | 47 ++++-------------------- uVote/page/default_page/vote.tpl | 22 +++++++++++ 9 files changed, 112 insertions(+), 47 deletions(-) create mode 100644 uVote/api/autoload.inc.php create mode 100644 uVote/api/votes/votes.php create mode 100644 uVote/dbd/autoload.inc.php create mode 100644 uVote/dbd/db/uVote.php create mode 100644 uVote/dbd/tbl/locale_string.php create mode 100644 uVote/page/default_page/vote.tpl diff --git a/index.php b/index.php index 7e4945c..7f34abc 100644 --- a/index.php +++ b/index.php @@ -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(); \ No newline at end of file diff --git a/uVote/api/autoload.inc.php b/uVote/api/autoload.inc.php new file mode 100644 index 0000000..4246ac3 --- /dev/null +++ b/uVote/api/autoload.inc.php @@ -0,0 +1,6 @@ +registerFolder(dirname(__FILE__),''); +$autoload->registerFolder(dirname(__FILE__).'/votes',''); diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php new file mode 100644 index 0000000..9009469 --- /dev/null +++ b/uVote/api/votes/votes.php @@ -0,0 +1,22 @@ +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 "

"; + } + //print_r($result); + return $result; + } +} diff --git a/uVote/autoload.inc.php b/uVote/autoload.inc.php index 91c759e..c974a96 100644 --- a/uVote/autoload.inc.php +++ b/uVote/autoload.inc.php @@ -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'; \ No newline at end of file +require_once dirname(__FILE__).'/api/autoload.inc.php'; \ No newline at end of file diff --git a/uVote/dbd/autoload.inc.php b/uVote/dbd/autoload.inc.php new file mode 100644 index 0000000..d87380a --- /dev/null +++ b/uVote/dbd/autoload.inc.php @@ -0,0 +1,9 @@ +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'); \ No newline at end of file diff --git a/uVote/dbd/db/uVote.php b/uVote/dbd/db/uVote.php new file mode 100644 index 0000000..936ec7b --- /dev/null +++ b/uVote/dbd/db/uVote.php @@ -0,0 +1,8 @@ + -
-
-

Title

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.

- -
- -
-

Abstimmung

- Pro » - Contra » - Enthaltung » - - -
-

- - -

- -
-
- -
-
-
-

Title

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.

- -
-
-

Abstimmung

- Pro » - Contra » - Enthaltung » -
-
-
- '; + $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(){ diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl new file mode 100644 index 0000000..866db9c --- /dev/null +++ b/uVote/page/default_page/vote.tpl @@ -0,0 +1,22 @@ +
+
+
+

${vote_title}

+

${vote_text}

+ +
+ +
+

Abstimmung

+ Pro » + Contra » + Enthaltung » + + +
+ +
+ +
+
+
\ No newline at end of file