AJAX toolkit was created to auto complete other elements into a html document.
It was firstly designed for situations when you have some fields that must be filled when
the user types something in some field ( like a primary key field ) and
this field lost the focus ( onblur event ).
in your View.html the sql is a md5 key. why? it's used to not allow client to see
your sql code and do modifications to obtain some privilleges.
To get your MD5 key, you must get your SQL defined at AjaxQueries.class.php and
apply php md5( "select f1, f2, ..., fn from table" ).
Each SQL defined at AjaxQueries.class.php must have an index like follows:
$v[ 1 ] = "select nm_contato, telefone from contato";
For javascript you must use:
sql = "1:afe8133bd534f4a04e1222c913b735f7";
This AJAX toolkit is defined to be used with Oracle Databases.
But to change it, is easy. The steps to change it follows below:
1 - create a valid connection with your database in your Controller script ( Controller
does not need to be named like this. It's only used for examples )
2 - modify your SQL statement at AjaxQueries.class.php to match to your DB
3 - change lines greater than 82 and stop using oci functions.
This Ajax toolkit was implemented with Oracle and oci php functions. This is the first
version and other releases must use some more generic such as PDO or ADODB or something like that.
If someone wants to contribute, there is no problem.
Fixed Classes that does not need modifications
---------------------------------------------------
AjaxControlFiltler.class.php
AjaxFilter.class.php
AjaxFormat.class.php
AjaxOptionsValidator.interface.php
AjaxQueries.class.php must be modified to acomodate your queries
Examples:
-----------------------
View.html - document with html fields and needed javascript to send requests and manage response from server
Controller.php - server side script to deal with View requests/responses
BusValidator.example.php - example of customized validator
Dependencies
----------------------
JSON - JavaScript Object Notation extension
Javascript scritps
------------------------
tkajax.js defines 3 global variables that must be used by your customized javascripts
like used in View.html
- these variables must be references to some JS "objects"
- you will create instances for it
_ajaxobject => TKAjax
_ajaxresultjsontext => the result from server - JSON encoded
_ajaxcallbackresult => your function to treat responses from server
website: aeloy.blogspot.com
|