当前位置: 网学 > 编程文档 > PHP > 正文

通达OA公共代码 php常用检测函数

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/20
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常用检测函数_网学
浏览:
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号
SERVER[''REMOTE_ADDR''] ) && 通达OA公共代码 php常用检测函数_网学
浏览:
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号
SERVER[''REMOTE_ADDR''] && strcasecmp( 通达OA公共代码 php常用检测函数_网学
浏览:
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号
SERVER[''REMOTE_ADDR''], "unknown" ) )
{
$onlineip = 通达OA公共代码 php常用检测函数_网学
浏览:
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号
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

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号