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

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

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/20
d = $SMTP_PASS;
$mail->From = $FROM;
$mail->FromName = $FROM_NAME;
$mail->AddReplyTo( $FROM, $FROM_NAME );
$mail->WordWrap = 50;
$mail->IsHTML( $IS_HTML );
$mail->Subject = $SUBJECT;
$mail->Body = $BODY;
$mail->AltBody = strip_tags( $BODY );
$TOK = strtok( $TO, "," );
while ( $TOK != "" )
{
$mail->AddAddress( $TOK );
$TOK = strtok( "," );
}
$TOK = strtok( $CC, "," );
while ( $TOK != "" )
{
$mail->AddCC( $TOK );
$TOK = strtok( "," );
}
$TOK = strtok( $BCC, "," );
while ( $TOK != "" )
{
$mail->AddBCC( $TOK );
$TOK = strtok( "," );
}
$TOK = strtok( $ATTACHMENT, "*" );
while ( $TOK != "" )
{
$FILENAME = substr( $TOK, strrpos( $TOK, "/" ) + 1 );
if ( strtolower( substr( $TOK, 0, strlen( $ATTACH_PATH2 ) + strlen( attach_sub_dir( ) ) ) ) == strtolower( $ATTACH_PATH2 ).attach_sub_dir( ) )
{
$FILENAME = substr( $FILENAME, strpos( $FILENAME, "." ) + 1 );
}
$mail->AddAttachment( $TOK, $FILENAME );
$TOK = strtok( "*" );
}
if ( $mail->Send( ) )
{
return TRUE;
}
return $mail->ErrorInfo;
}
function send_email( $LOGIN_USER_ID, $FORM_EMAIL, $TO_EMAIL_STR, $EMAIL_CONTENT, $MAIL_TITLE )
{
global $connection;
global $LOGIN_USER_NAME;
$query = "SELECT * from WEBMAIL where EMAIL=''".$FORM_EMAIL."'' and USER_ID=''{$LOGIN_USER_ID}''";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$POP_SERVER = $ROW[''POP_SERVER''];
$SMTP_SERVER = $ROW[''SMTP_SERVER''];
$LOGIN_TYPE = $ROW[''LOGIN_TYPE''];
$SMTP_PASS = $ROW[''SMTP_PASS''];
$SMTP_PORT = $ROW[''SMTP_PORT''];
$SMTP_SSL = $ROW[''SMTP_SSL''] == "1" ? "ssl" : "";
$EMAIL_PASS = $ROW[''EMAIL_PASS''];
$EMAIL_PASS = decrypt_str( $EMAIL_PASS, "webmail" );
}
return send_mail( $FORM_EMAIL, $TO_EMAIL_STR, $MAIL_TITLE, $EMAIL_CONTENT, $SMTP_SERVER, $FORM_EMAIL, $EMAIL_PASS, TRUE, $LOGIN_USER_NAME, "", "", "", "", TRUE, $SMTP_PORT, $SMTP_SSL );
}
function unescape( $str )
{
$str = rawurldecode( $str );
preg_match_all( "/(?:%u.{4})|&#x.{4};|&#\\d+;|.+/U", $str, $r );
$ar = $r[0];
foreach ( $ar as $k => $v )
{
if ( substr( $v, 0, 2 ) == "%u" )
{
$ar[$k] = iconv( "UCS-2", ini_get( "default_charset" ), pack( "H4", substr( $v, -4 ) ) );
}
else if ( substr( $v, 0, 3 ) == "&#x" )
{
$ar[$k] = iconv( "UCS-2", ini_get( "default_charset" ), pack( "H4", substr( $v, 3, -1 ) ) );
}
else if ( substr( $v, 0, 2 ) == "&#" )
{
$ar[$k] = iconv( "UCS-2", ini_get( "default_charset" ), pack( "n", substr( $v, 2, -1 ) ) );
}
}
return str_replace( "\\\\", "\\", join( "", $ar ) );
}
function flow_sort_tree( $SORT_ID, $SORT_CHOOSE )
{
include_once( "inc/utility_org.php" );
global $connection;
global $DEEP_COUNT;
global $LOGIN_USER_PRIV;
global $LOGIN_DEPT_ID;
global $LOGIN_USER_PRIV_OTHER;
$query = "SELECT * from FLOW_SORT where SORT_PARENT=".$SORT_ID." order by SORT_NO";
$cursor = exequery( $connection, $query );
$OPTION_TEXT = "";
$DEEP_COUNT1 = $DEEP_COUNT;
$DEEP_COUNT .= "│";
$COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$COUNT;
$SORT_ID = $ROW[''SORT_ID''];

网学推荐

免费论文

原创论文

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