Examples of common built-in functions (text) and oa examples
The Tongda OA system has a large number of built-in functions, which simplifies program development. Here we will select some examples from the section in the secondary development manual and give you a brief introduction through the actual program running and debugging.
For built-in functions, see utility. php1 and Button_Back to display a return button <? Phpinclude_once ("inc/utility. php"); // reference the function file first.
Button_Back ($ HTML_CHARSET = 'gbk'); // use a function?> Running result:
2. get_client_ip obtains the Client IP address of the user.
<? Phpinclude_once ("inc/utility. php ");
Echo get_client_ip ();?> Running result:
Ii. utility_all.php1 and is_ip determine whether a string is a legal IP address <? Phpinclude_once ("inc/utility_all.php"); echo is_ip ("10.0.0.1");?>
2. add_log ($ TYPE, $ REMARK, $ OPERATOR) add system logs
Parameters:
$ TYPE // Log TYPE Code. For details, refer to "System Log TYPE" in system code settings"
$ REMARK // remarks
$ OPERATOR // The username of the user who generates logs, usually the current user
<? Phpinclude_once ("inc/utility_all.php ");
Add_log ('login log', 'test login log', 'admin');?>
3. dept_long_name ($ DEPT_ID) obtains the name of a multi-level department whose department ID is $ DEPT_ID.
Parameter: $ DEPT_ID // department ID
<? Phpinclude_once ("inc/utility_all.php ");
Echo dept_long_name (1);?>
In addition to the common functions above, OA also provides server file management functions, attachment upload processing functions, and SMS functions, which are relatively less used, if necessary, you can further find the secondary development manual.