aboutsummaryrefslogtreecommitdiff
path: root/h-source/Examples
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Examples')
-rw-r--r--h-source/Examples/Controllers/TestController.php9
-rwxr-xr-xh-source/Examples/Tables/mysql/admin_session.txt52
-rwxr-xr-xh-source/Examples/Tables/mysql/reg_session.txt63
-rwxr-xr-xh-source/Examples/Views/footer.php3
-rwxr-xr-xh-source/Examples/Views/post/form.php28
-rw-r--r--h-source/Examples/Views/post/form_associate.php19
-rwxr-xr-xh-source/Examples/Views/post/header.php16
-rwxr-xr-xh-source/Examples/Views/post/modify.php1
-rwxr-xr-xh-source/Examples/Views/post/popup.php3
-rwxr-xr-xh-source/Examples/Views/post/view.php1
-rwxr-xr-xh-source/Examples/Views/post2/form.php28
-rwxr-xr-xh-source/Examples/Views/post2/header.php30
-rwxr-xr-xh-source/Examples/Views/post2/modify.php1
-rwxr-xr-xh-source/Examples/Views/post2/view.php1
-rwxr-xr-xh-source/Examples/articles.txt8
-rw-r--r--h-source/Examples/boxes.txt5
-rw-r--r--h-source/Examples/index.html1
17 files changed, 269 insertions, 0 deletions
diff --git a/h-source/Examples/Controllers/TestController.php b/h-source/Examples/Controllers/TestController.php
new file mode 100644
index 0000000..9372e71
--- /dev/null
+++ b/h-source/Examples/Controllers/TestController.php
@@ -0,0 +1,9 @@
+<?php
+
+class TestController extends Controller {
+
+ function index() {
+ echo '<h2>It works!</h2>';
+ }
+
+} \ No newline at end of file
diff --git a/h-source/Examples/Tables/mysql/admin_session.txt b/h-source/Examples/Tables/mysql/admin_session.txt
new file mode 100755
index 0000000..8e5f604
--- /dev/null
+++ b/h-source/Examples/Tables/mysql/admin_session.txt
@@ -0,0 +1,52 @@
+tables:
+
+#default admin session tables
+
+create table adminusers (
+ id_user INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ username VARCHAR(80) binary NOT NULL,
+ password CHAR(40) binary NOT NULL,
+ last_failure INT UNSIGNED NOT NULL,
+ has_confirmed INT UNSIGNED NOT NULL,
+ unique(username),
+ index(username, password)
+)engine=innodb;
+
+create table admingroups (
+ id_group INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(30) binary NOT NULL,
+ unique(name)
+)engine=innodb;
+
+create table adminusers_groups (
+ id_user int(11) UNSIGNED not null,
+ id_group int(11) UNSIGNED not null,
+ index group_indx(id_group),
+ index user_indx(id_user),
+ foreign key group_fky(id_group) references admingroups (id_group),
+ foreign key user_fky(id_user) references adminusers (id_user),
+ unique (id_group,id_user)
+)engine=innodb;
+
+
+insert into adminusers (username,password) values ('admin',sha1('admin'));
+
+
+CREATE TABLE adminsessions (
+ uid CHAR(32) NOT NULL,
+ token CHAR(32) NOT NULL,
+ id_user INT UNSIGNED NOT NULL,
+ creation_date INT UNSIGNED NOT NULL,
+ user_agent CHAR(32) NOT NULL,
+ INDEX(uid)
+)engine=innodb;
+
+
+create table accesses (
+ id int(12) not null auto_increment primary key,
+ ip char(20) not null,data char(10) not null,
+ ora char(8) not null,
+ username varchar(30) not null
+);
+
+
diff --git a/h-source/Examples/Tables/mysql/reg_session.txt b/h-source/Examples/Tables/mysql/reg_session.txt
new file mode 100755
index 0000000..f5c4713
--- /dev/null
+++ b/h-source/Examples/Tables/mysql/reg_session.txt
@@ -0,0 +1,63 @@
+tables:
+
+#default registered session tables
+
+create table regusers (
+ id_user INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ username VARCHAR(80) binary NOT NULL,
+ password CHAR(40) binary NOT NULL,
+ last_failure INT UNSIGNED NOT NULL,
+ has_confirmed INT UNSIGNED NOT NULL,
+
+ e_mail VARCHAR(60) binary NOT NULL,
+ confirmation_token CHAR(32) NOT NULL,
+ creation_date timestamp default CURRENT_TIMESTAMP,
+ creation_time INT UNSIGNED NOT NULL,
+ temp_field CHAR(32) NOT NULL,
+ deleted CHAR(4) NOT NULL default 'no',
+
+ forgot_token CHAR(32) NOT NULL,
+ forgot_time INT UNSIGNED NOT NULL,
+
+ unique(username),
+ index(username, password)
+)engine=innodb;
+
+create table reggroups (
+ id_group INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ name VARCHAR(30) binary NOT NULL,
+ unique(name)
+)engine=innodb;
+
+create table regusers_groups (
+ id_user int(11) UNSIGNED not null,
+ id_group int(11) UNSIGNED not null,
+ index group_indx(id_group),
+ index user_indx(id_user),
+ foreign key group_fky(id_group) references reggroups (id_group),
+ foreign key user_fky(id_user) references regusers (id_user),
+ unique (id_group,id_user)
+)engine=innodb;
+
+
+insert into regusers (username,password) values ('user',sha1('user'));
+
+
+CREATE TABLE regsessions (
+ uid CHAR(32) NOT NULL,
+ token CHAR(32) NOT NULL,
+ id_user INT UNSIGNED NOT NULL,
+ creation_date INT UNSIGNED NOT NULL,
+ user_agent CHAR(32) NOT NULL,
+ INDEX(uid)
+)engine=innodb;
+
+
+create table regaccesses (
+ id int(12) not null auto_increment primary key,
+ ip char(20) not null,data char(10) not null,
+ ora char(8) not null,
+ username varchar(30) not null
+);
+
+
diff --git a/h-source/Examples/Views/footer.php b/h-source/Examples/Views/footer.php
new file mode 100755
index 0000000..42e09f0
--- /dev/null
+++ b/h-source/Examples/Views/footer.php
@@ -0,0 +1,3 @@
+</div> <!--container-->
+</body>
+</html>
diff --git a/h-source/Examples/Views/post/form.php b/h-source/Examples/Views/post/form.php
new file mode 100755
index 0000000..5ef5aff
--- /dev/null
+++ b/h-source/Examples/Views/post/form.php
@@ -0,0 +1,28 @@
+<div class='mainMenu'>
+ <?php echo $topMenu;?>
+</div>
+
+<?php echo $notice; ?>
+
+<div>
+ <form action='<?php echo $action;?>' method='POST'>
+ <table>
+ <tr>
+ <td>Titolo:</td>
+ <td><input type='text' name='titolo' value='<?php echo $values['titolo'];?>'></td>
+ </tr>
+ <tr>
+ <td>Autore:</td>
+ <td><input type='text' name='autore' value='<?php echo $values['autore'];?>'></td>
+ </tr>
+ <tr>
+ <td>Titolo:</td>
+ <td><textarea name='testo'><?php echo $values['testo'];?></textarea></td>
+ </tr>
+ <?php echo $hidden;?>
+ <tr>
+ <td><input type='submit' name='<?php echo $submit;?>' value='salva'></td>
+ </tr>
+ </table>
+ </form>
+</div>
diff --git a/h-source/Examples/Views/post/form_associate.php b/h-source/Examples/Views/post/form_associate.php
new file mode 100644
index 0000000..5794153
--- /dev/null
+++ b/h-source/Examples/Views/post/form_associate.php
@@ -0,0 +1,19 @@
+<div class='mainMenu'>
+ <?php echo $menu;?>
+</div>
+
+<?php echo $notice;?>
+
+<div>
+ <form action = '<?php echo $action;?>' method = 'POST'>
+
+ <select name='id_arg'>
+ <?php foreach ($argomenti as $name => $value) {?>
+ <option value='<?php echo $value;?>'><?php echo $name;?></option>
+ <?php } ?>
+ </select>
+ <br />
+ <input type='submit' name='associate' value='associate'>
+ <input type='submit' name='dissociate' value='dissociate'>
+ </form>
+</div> \ No newline at end of file
diff --git a/h-source/Examples/Views/post/header.php b/h-source/Examples/Views/post/header.php
new file mode 100755
index 0000000..606de2e
--- /dev/null
+++ b/h-source/Examples/Views/post/header.php
@@ -0,0 +1,16 @@
+<html>
+
+<header>
+
+<title>prova</title>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/style.css');?>"></style>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/mainmenu.css');?>"></style>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/popupmenu.css');?>"></style>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/form.css');?>"></style>
+
+</header>
+
+<body>
+
+<div id="container">
+
diff --git a/h-source/Examples/Views/post/modify.php b/h-source/Examples/Views/post/modify.php
new file mode 100755
index 0000000..dc948e1
--- /dev/null
+++ b/h-source/Examples/Views/post/modify.php
@@ -0,0 +1 @@
+<?php echo $form;?> \ No newline at end of file
diff --git a/h-source/Examples/Views/post/popup.php b/h-source/Examples/Views/post/popup.php
new file mode 100755
index 0000000..ba543a4
--- /dev/null
+++ b/h-source/Examples/Views/post/popup.php
@@ -0,0 +1,3 @@
+<div class='verticalMenu'>
+ <?php echo $popup; ?>
+</div> \ No newline at end of file
diff --git a/h-source/Examples/Views/post/view.php b/h-source/Examples/Views/post/view.php
new file mode 100755
index 0000000..3f67f2f
--- /dev/null
+++ b/h-source/Examples/Views/post/view.php
@@ -0,0 +1 @@
+<?php echo $scaffold;?>
diff --git a/h-source/Examples/Views/post2/form.php b/h-source/Examples/Views/post2/form.php
new file mode 100755
index 0000000..5ef5aff
--- /dev/null
+++ b/h-source/Examples/Views/post2/form.php
@@ -0,0 +1,28 @@
+<div class='mainMenu'>
+ <?php echo $topMenu;?>
+</div>
+
+<?php echo $notice; ?>
+
+<div>
+ <form action='<?php echo $action;?>' method='POST'>
+ <table>
+ <tr>
+ <td>Titolo:</td>
+ <td><input type='text' name='titolo' value='<?php echo $values['titolo'];?>'></td>
+ </tr>
+ <tr>
+ <td>Autore:</td>
+ <td><input type='text' name='autore' value='<?php echo $values['autore'];?>'></td>
+ </tr>
+ <tr>
+ <td>Titolo:</td>
+ <td><textarea name='testo'><?php echo $values['testo'];?></textarea></td>
+ </tr>
+ <?php echo $hidden;?>
+ <tr>
+ <td><input type='submit' name='<?php echo $submit;?>' value='salva'></td>
+ </tr>
+ </table>
+ </form>
+</div>
diff --git a/h-source/Examples/Views/post2/header.php b/h-source/Examples/Views/post2/header.php
new file mode 100755
index 0000000..0d9a131
--- /dev/null
+++ b/h-source/Examples/Views/post2/header.php
@@ -0,0 +1,30 @@
+<html>
+
+<header>
+
+<title>prova</title>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/style.css');?>"></style>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/mainmenu.css');?>"></style>
+<link rel="stylesheet" type="text/css" href="<?php echo url::getRoot('public/css/form.css');?>"></style>
+<script type="text/javascript" src="<?php echo url::getRoot('external/jquery/jquery-1.3.2.js');?>"></script>
+
+<script>
+$(document).ready(function(){
+
+ $("ul#menuBlock li").mouseover(function () {
+ $(this).children().css({'display' : 'block'});
+ });
+
+ $("ul#menuBlock li").mouseout(function () {
+ $('ul#menuBlock li ul').css({'display' : 'none'});
+ });
+
+});
+</script>
+
+</header>
+
+<body>
+
+<div id="container">
+
diff --git a/h-source/Examples/Views/post2/modify.php b/h-source/Examples/Views/post2/modify.php
new file mode 100755
index 0000000..dc948e1
--- /dev/null
+++ b/h-source/Examples/Views/post2/modify.php
@@ -0,0 +1 @@
+<?php echo $form;?> \ No newline at end of file
diff --git a/h-source/Examples/Views/post2/view.php b/h-source/Examples/Views/post2/view.php
new file mode 100755
index 0000000..3f67f2f
--- /dev/null
+++ b/h-source/Examples/Views/post2/view.php
@@ -0,0 +1 @@
+<?php echo $scaffold;?>
diff --git a/h-source/Examples/articles.txt b/h-source/Examples/articles.txt
new file mode 100755
index 0000000..db3f022
--- /dev/null
+++ b/h-source/Examples/articles.txt
@@ -0,0 +1,8 @@
+create table articles (
+ id int(5) not null auto_increment primary key,
+ title varchar(100) not null,
+ author varchar(100) not null,
+ category varchar(100) not null,
+ abstract text CHARACTER SET utf8 not null,
+ content text CHARACTER SET utf8 not null
+); \ No newline at end of file
diff --git a/h-source/Examples/boxes.txt b/h-source/Examples/boxes.txt
new file mode 100644
index 0000000..f27d7b1
--- /dev/null
+++ b/h-source/Examples/boxes.txt
@@ -0,0 +1,5 @@
+create table boxes (
+ id int(5) not null auto_increment primary key,
+ title varchar(100) not null,
+ xml text CHARACTER SET utf8 not null
+);
diff --git a/h-source/Examples/index.html b/h-source/Examples/index.html
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/h-source/Examples/index.html
@@ -0,0 +1 @@
+