diff options
author | wei <> | 2007-05-03 01:37:21 +0000 |
---|---|---|
committer | wei <> | 2007-05-03 01:37:21 +0000 |
commit | ea9e7eb535b460218b693d4e5fec80297eb3e360 (patch) | |
tree | 8dc4f4ac6d29989ba912a6013ffa6590c71e857d /demos/northwind-db/protected/pages | |
parent | 1ae09931b2572d9c3067c99f841a60cb3330b3f3 (diff) |
Add northwind db demo.
Diffstat (limited to 'demos/northwind-db/protected/pages')
-rw-r--r-- | demos/northwind-db/protected/pages/Home.page | 12 | ||||
-rw-r--r-- | demos/northwind-db/protected/pages/Home.php | 28 | ||||
-rw-r--r-- | demos/northwind-db/protected/pages/northwind.gif | bin | 0 -> 25177 bytes |
3 files changed, 40 insertions, 0 deletions
diff --git a/demos/northwind-db/protected/pages/Home.page b/demos/northwind-db/protected/pages/Home.page new file mode 100644 index 00000000..e2c3668e --- /dev/null +++ b/demos/northwind-db/protected/pages/Home.page @@ -0,0 +1,12 @@ +<html>
+<com:THead Title="Welcome to Prado" />
+<body>
+<h1>Welcome to PRADO!</h1>
+<com:TForm>
+
+ <com:TDropDownList ID="class_list" AutoPostBack="true"/>
+ <com:TScaffoldView ID="scaffold1" RecordClass="<%= $this->class_list->selectedItem->Text %>" />
+
+</com:TForm>
+</body>
+</html>
\ No newline at end of file diff --git a/demos/northwind-db/protected/pages/Home.php b/demos/northwind-db/protected/pages/Home.php new file mode 100644 index 00000000..06035069 --- /dev/null +++ b/demos/northwind-db/protected/pages/Home.php @@ -0,0 +1,28 @@ +<?php
+
+class Home extends TPage
+{
+ function onInit($param)
+ {
+ $classes = $this->getRecordClassList(Prado::getPathOfNamespace('Application.database.*'));
+ $this->class_list->dataSource = $classes;
+ $this->class_list->dataBind();
+ }
+
+ protected function getRecordClassList($directory)
+ {
+ $list=array();
+ $folder=@opendir($directory);
+ while($entry=@readdir($folder))
+ {
+ if($entry[0]==='.')
+ continue;
+ else if(is_file($directory.'/'.$entry))
+ $list[] = str_replace('.php', '', $entry);
+ }
+ closedir($folder);
+ return $list;
+ }
+}
+
+?>
\ No newline at end of file diff --git a/demos/northwind-db/protected/pages/northwind.gif b/demos/northwind-db/protected/pages/northwind.gif Binary files differnew file mode 100644 index 00000000..34e1f2ed --- /dev/null +++ b/demos/northwind-db/protected/pages/northwind.gif |