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})|.{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 ) == "" )
{
$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''];