Tongda OA system built up a large number of functions, simplifying the development of the program, here from the two Development manual section to select some examples, through the actual program run debugging to give you a brief introduction.
built-in function reference First, utility.php 1. Button_back Display a return button<?phpinclude_once ("inc/utility.php"); Make a function file reference first
button_back ($HTML _charset = ' GBK '); Using Functions?>Operation Result:
2, get_client_ip Get the client IP address of the user
<?phpinclude_once ("inc/utility.php");
echo get_client_ip ();?>Operation Result:
Second,utility_all.php 1, is_ip to determine whether a string is a legitimate IP address <?phpinclude_once ("inc/utility_all.php");Echo is_ip ("10.0.0.1");?>
2, Add_log ($TYPE, $REMARK, $OPERATOR) Add System log
Parameters:
$TYPE// log type Code, refer to "System log type" under System code settings
$REMARK// notes
$OPERATOR// user name of the user who generated the log, typically the current user
<?phpinclude_once ("inc/utility_all.php");
add_log (' login log ', ' Test login log ', ' admin ');?>
3, Dept_long_name ($DEPT _id) Get Department ID to be $DEPT _id the multi-level department name
Parameters: $DEPT _id// Department ID
<?phpinclude_once ("inc/utility_all.php");
Echo dept_long_name (1); ?>
In addition to some of the above-mentioned functions, OA also provides server file management related functions, upload attachment processing related functions, SMS functions, these relatively less use, you can further find two development manuals.
Examples of common built-in functions for Tongda OA