INTER-Mediator Demo Script: Masayuki Nii msyk@msyk.net 2010/1/23 (Modified 2012/6/22) Materials for demonstrating INTER-Mediator's fundamental function are in this folder. The "demo-script" folder should be located in the 'develop-im' folder. The demo database for MySQL with the distribution should be installed and working. ** DEMO 1 1. open demo1.html, show the source. And show by any browser. You can see just a table. 2. open demo1.php, show the source. It defines the information for database. 3. change the following part of demo1.html. You can see demo1.html and it contains data from database in the table. ================================= v ================================= 4. add following code in any body part. =================================
Navigation Controls by INTER-Mediator
================================= Uncomment the following lines in demo1.php ================================= 'repeat-control' => 'insert delete', 'paging' => true, ================================= ** DEMO 2 1. Open demo2.html, demo2.php. 2. Add to HEAD section below: 3. Modify BODY tag: 4. Modify the inside of table as like: 5. Open demo2.html and it can show the postal codes in so many lines. 6. Add below line in demo2.php. 'records'=>10, 'paging'=>true, 7. Add below line in demo2.html, and show the demo2.html.
Navigation Controls by INTER-Mediator
8. Add below line in demo2.php, and show the demo2.html. 'query'=>array( array('field'=>'f3','value'=>'14%','operator'=>'like') ) 'sort'=>array( array('field'=>'f3','direction'=>'desc') ), These are same as: select f3,f9,memo from postalcode where f3 like '14%' desc order by f3 limit 10; 9. Add below line in demo2.php. 'key'=>'id', 'repeat-control' => 'insert delete', 'default-values' => array( array('field'=>'f3', 'value'=>'1500000'), array('field'=>'f7', 'value'=>'東京都'), ) 10. Modify the inside of table as like: 11. Limit to Shinjuku's Data with postalcode. 'query'=>array( array('field'=>'f3','value'=>'16%','operator'=>'like') ) 12. Add new context with relationship array( 'name'=>'restaurant', 'key'=>'id', 'relation'=>array( array('foreign-key'=>'postalcode', 'join-field' => 'f3', 'operator' => 'eq'), ) ),
** Demo 3 1. Fields for Name, Age and Q1 In html, uncomment the SCRIPT tag of the header, and replace BODY tag with unload attribute. 2. Add data-im-control="post" to TBODY, and new Button tag element. Post the answer and verify the DB. 3. Add Q2 as checkbox. 4. Add Q3 for Radio Button 5. Add Q4 for Checkbox set. 6. After-post options.