summaryrefslogtreecommitdiff
path: root/demos/sqlmap/protected/pages
diff options
context:
space:
mode:
Diffstat (limited to 'demos/sqlmap/protected/pages')
-rw-r--r--demos/sqlmap/protected/pages/Sample/Home.page7
-rw-r--r--demos/sqlmap/protected/pages/Sample/ProductList.page9
-rw-r--r--demos/sqlmap/protected/pages/Sample/ProductList.php18
-rw-r--r--demos/sqlmap/protected/pages/Sample/crud1.php6
-rw-r--r--demos/sqlmap/protected/pages/Sample/crud2.php9
5 files changed, 10 insertions, 39 deletions
diff --git a/demos/sqlmap/protected/pages/Sample/Home.page b/demos/sqlmap/protected/pages/Sample/Home.page
index 6d059c7e..37e59b42 100644
--- a/demos/sqlmap/protected/pages/Sample/Home.page
+++ b/demos/sqlmap/protected/pages/Sample/Home.page
@@ -1,5 +1,4 @@
<ul>
- <li><a href="index.php?page=crud1">Tutorial 1</a></li>
- <li><a href="index.php?page=crud2">Tutorial 2</a></li>
- <li><a href="index.php?page=ProductList">Product List</a></li>
-</ul> \ No newline at end of file
+ <li><a href="index.php?page=Sample.crud1">Tutorial 1</a></li>
+ <li><a href="index.php?page=Sample.crud2">Tutorial 2</a></li>
+</ul> \ No newline at end of file
diff --git a/demos/sqlmap/protected/pages/Sample/ProductList.page b/demos/sqlmap/protected/pages/Sample/ProductList.page
deleted file mode 100644
index 904d411d..00000000
--- a/demos/sqlmap/protected/pages/Sample/ProductList.page
+++ /dev/null
@@ -1,9 +0,0 @@
-<h1>Database Examples</h1>
-<com:TRepeater id="productList">
- <prop:ItemTemplate>
- <div>
- Code: <%# $this->DataItem['productid'] %>
- Category: <%# $this->DataItem['category'] %>
- </div>
- </prop:ItemTemplate>
-</com:TRepeater> \ No newline at end of file
diff --git a/demos/sqlmap/protected/pages/Sample/ProductList.php b/demos/sqlmap/protected/pages/Sample/ProductList.php
deleted file mode 100644
index a35c40ea..00000000
--- a/demos/sqlmap/protected/pages/Sample/ProductList.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-class ProductList extends TPage
-{
- public function onLoad($param)
- {
- parent::onLoad($param);
- if(!$this->IsPostBack)
- {
- $sqlmap = $this->Application->Modules['petshop-sqlmap'];
- $products = $sqlmap->queryForList('SelectAllProducts');
- $this->productList->setDataSource($products);
- $this->productList->dataBind();
- }
- }
-}
-
-?> \ No newline at end of file
diff --git a/demos/sqlmap/protected/pages/Sample/crud1.php b/demos/sqlmap/protected/pages/Sample/crud1.php
index 40733dc9..9ea6e05e 100644
--- a/demos/sqlmap/protected/pages/Sample/crud1.php
+++ b/demos/sqlmap/protected/pages/Sample/crud1.php
@@ -6,13 +6,13 @@ class crud1 extends TPage
{
private function loadData()
{
- $sqlmap = $this->Application->Modules['person-sample'];
+ $sqlmap = $this->Application->Modules['person-sample']->Client;
$this->personList->DataSource = $sqlmap->queryForList('SelectAll');
- $this->personList->dataBind();
+ $this->personList->dataBind();
}
public function onLoad($param)
- {
+ {
if(!$this->IsPostBack)
$this->loadData();
}
diff --git a/demos/sqlmap/protected/pages/Sample/crud2.php b/demos/sqlmap/protected/pages/Sample/crud2.php
index 46fe3893..3d2087bb 100644
--- a/demos/sqlmap/protected/pages/Sample/crud2.php
+++ b/demos/sqlmap/protected/pages/Sample/crud2.php
@@ -6,18 +6,17 @@ class crud2 extends TPage
{
private function sqlmap()
{
- return $this->Application->Modules['person-sample'];
+ return $this->Application->Modules['person-sample']->Client;
}
private function loadData()
{
- $this->personList->DataSource =
- $this->sqlmap()->queryForList('SelectAll');
+ $this->personList->DataSource = $this->sqlmap()->queryForList('SelectAll');
$this->personList->dataBind();
}
public function onLoad($param)
- {
+ {
if(!$this->IsPostBack)
$this->loadData();
}
@@ -44,7 +43,7 @@ class crud2 extends TPage
$person->HeightInMeters = $this->getText($param, 2);
$person->WeightInKilograms = $this->getText($param, 3);
$person->ID = $this->getKey($sender, $param);
-
+
$this->sqlmap()->update("Update", $person);
$this->refreshList($sender, $param);
}