class admin {// begin class rou $ action = "; var $ put_val = 0; var $ pk_name =" id "; var $ select_sql; var $ array_add = array (); var $ array_update = array (); var $ array_query = array (); var $ array_oder_by = array (); var $ array_tpl = array (); var $ array_valid = array (); var $ caption = ""; var $ html_header = '; Var $ html_query ='; var $ html_cmd = '';
Var $ post; var $ me; function int_pk_val () {global $ _GET, $ _ post; if ($ this-> pk_val) return;
IF (! EMPTY ($ _ get ['Edit_ID'])) {$ this-> pk_val = $ _ get ['edit_id']; return;}
IF (! Empty ($ _ post ['id')) {$ this-> pk_val = $ _ post ['id']; return;}}
Function Admin ($ Action, $ TABLE, $ SELECT_SQL) {Global $ _POST, $ Me; / * FOREACH ($ _ Post AS $ Key => $ VAL) {$ _POST [$ Key] = TRIM (NVL ($ VAL)) } * / $ This-> post = $ _ post; $ this-> me = $ me; $ this-> action = $ action; $ this-> table = $ table; $ this-> select_sql = $ SELECT_SQL;
$ this-> INT_PK_VAL ();
Function execute () {if ($ this-> action) $ this-> display (); else {$ action = $ this-> action; $ this -> $ action ();}}
Function Display () {/ * Display Data * / Global $ CFG, $ _ POST, $ ME;
$ where = $ this-> get_where ($ this-> select_sql); $ this-> select_sql. = $ where;
$ P = new SXPAGING ($ this-> SELECT_SQL, NVL ($ _ Post ['Requirepage'), NVL ($ _ Post ['Pagesize')); if ($ this-> html_cmd) $ html_cmd = " "" $ this-> html_cmd; else $ html_cmd = "| ; incrude ("$ cfg-> Dirtpl / admin / header.html "); echo ("