RL;
case "31" :
if ( strstr( $CONTENT, "批准了" ) || strstr( $CONTENT, "未批准" ) || strstr( $CONTENT, "撤销了" ) )
{
$URL = "/general/training/train/apply/";
return $URL;
}
$URL = "/general/training/manage/apply_manage/";
return $URL;
case "32" :
$URL = "/general/training/train/survey/";
return $URL;
case "33" :
$URL = "/general/training/train/information/";
return $URL;
case "34" :
$URL = "/general/training/train/assessment/";
return $URL;
case "35" :
$URL = "/general/hrms/manage/";
}
return $URL;
}
function avatar_size( $AVATAR )
{
global $ROOT_PATH;
global $connection;
global $AVATAR_WIDTH;
global $AVATAR_HEIGHT;
$FILENAME = $ROOT_PATH."images/avatar/".$AVATAR.".gif";
if ( !$AVATAR_WIDTH && !$AVATAR_HEIGHT )
{
$query = "SELECT AVATAR_WIDTH,AVATAR_HEIGHT from INTERFACE";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$AVATAR_WIDTH = $ROW[''AVATAR_WIDTH''];
$AVATAR_HEIGHT = $ROW[''AVATAR_HEIGHT''];
}
}
$IMG_ATTR = @getimagesize( $FILENAME );
if ( $AVATAR_WIDTH < $IMG_ATTR[0] )
{
$IMG_ATTR[0] = $AVATAR_WIDTH;
}
if ( $AVATAR_HEIGHT < $IMG_ATTR )
{
$IMG_ATTR = $AVATAR_HEIGHT;
}
if ( $IMG_ATTR[0] < 15 )
{
$IMG_ATTR[0] = 15;
}
if ( $IMG_ATTR < 15 )
{
$IMG_ATTR = 15;
}
return "width=\"".$IMG_ATTR[''0'']."\" height=\"{$IMG_ATTR[''1'']}\"";
}
function format_cvs( $STR )
{
$STR = str_replace( "\"", "", $STR );
$STR = str_replace( "\n", "", $STR );
$STR = str_replace( "\r", "", $STR );
$STR = str_replace( "''", "\\''", $STR );
if ( strpos( $STR, "," ) === FALSE )
{
return $STR;
}
$STR = "\"".$STR."\"";
return $STR;
}
function keyed_str( $TXT, $ENCRYPT_KEY )
{
$ENCRYPT_KEY = md5( $ENCRYPT_KEY );
$CTR = 0;
$TMP = "";
$I = 0;
for ( ; $I < strlen( $TXT ); ++$I )
{
if ( $CTR == strlen( $ENCRYPT_KEY ) )
{
$CTR = 0;
}
$TMP .= substr( $TXT, $I, 1 ) ^ substr( $ENCRYPT_KEY, $CTR, 1 );
++$CTR;
}
return $TMP;
}
function encrypt_str( $TXT, $KEY )
{
srand( ( double )microtime( ) * 1000000 );
$ENCRYPT_KEY = md5( rand( 0, 32000 ) );
$CTR = 0;
$TMP = "";
$I = 0;
for ( ; $I < strlen( $TXT ); ++$I )
{
if ( $CTR == strlen( $ENCRYPT_KEY ) )
{
$CTR = 0;
}
$TMP .= substr( $ENCRYPT_KEY, $CTR, 1 ).( substr( $TXT, $I, 1 ) ^ substr( $ENCRYPT_KEY, $CTR, 1 ) );
++$CTR;
}
return keyed_str( $TMP, $KEY );
}
function decrypt_str( $TXT, $KEY )
{
$TXT = keyed_str( $TXT, $KEY );
$TMP = "";
$I = 0;
for ( ; $I < strlen( $TXT ); ++$I )
{
$MD5 = substr( $TXT, $I, 1 );
++$I;
$TMP .= substr( $TXT, $I, 1 ) ^ $MD5;
}
return $TMP;
}
function get_client_ip( )
{
if ( getenv( "REMOTE_ADDR" ) && strcasecmp( getenv( "REMOTE_ADDR" ), "unknown" ) )
{
$onlineip = getenv( "REMOTE_ADDR" );
return $onlineip;
}
if ( isset(
通达OA公共代码 php常用检测函数_网学
浏览:
SERVER[''REMOTE_ADDR''] ) &&
通达OA公共代码 php常用检测函数_网学
浏览:
SERVER[''REMOTE_ADDR''] && strcasecmp(
通达OA公共代码 php常用检测函数_网学
浏览:
SERVER[''REMOTE_ADDR''], "unknown" ) )
{
$onlineip =
通达OA公共代码 php常用检测函数_网学
浏览:
SERVER[''REMOTE_ADDR''];
return $onlineip;
}
if ( getenv( "HTTP_CLIENT_IP" ) && strcasecmp( getenv( "HTTP_CLIENT_IP" ), "unknown" ) )
{
$onlineip = getenv( "HTTP_CLIENT_IP" );
return $onlineip;
}
if ( ge