Open Source & stuff 

Salix.gr

User login

sc_updater reference

SC_updater is a small updater class. Retrieves a record from the database by primary key and updates html tags with the retrieved values. For sure it works with text boxes and div, td, span tags. Placement of those tags and correct ids for them is in your hands.

It has two methods:

set_updater_items($table, $key_field, $key_value, $field_tags)

where
$table is db table name
$key_field is table's primary or unique key
$key_value is the default value
$field_tags is an array with field-tag id pairs in associative form eg. array( 'field1' => 'tag_id1', 'field2' => 'tag_id2') which means the value of field1 will update tag_id1 and value of field2 will update tag_id2.

place_jscripts($event_func_name)

places the needed javascripts to the page.

$event_func_name is a part of name defined by you in order to avoid name conflicts. If is set to 'test' then updater function will be named sc_test(). It will place some other functions also. But in order to retrieve record you must call the sc_your name function. That function takes one parameter the record key. See example.


All Rights Reserved 2006-2010 Salix.gr | Hosting by e-emporio