Tongda OA Common code PHP commonly used detection function _php skill

Source: Internet
Author: User
Tags auth explode md5 ord pack strlen strtok
check_type.php (using the type validation function)


Copy Code code as follows:



<?php


/*********************/


/* */


* version:5.1.0 * *


* AUTHOR:RM * *


* comment:071223 * *


/* */


/*********************/


function Is_number ($STR)


{


if (substr ($str, 0, 1) = = "-")


{


$str = substr ($str, 1);


}


$length = strlen ($STR);


$i = 0;


for (; $i < $length; + + $i)


{


$ascii _value = Ord (substr ($str, $i, 1));


if (<= $ascii _value && $ascii _value <= 57)


{


Continue


}


return FALSE;


}


if ($str!= "0")


{


$str = Intval ($STR);


if ($str = = 0)


{


return FALSE;


}


}


return TRUE;


}


function Is_decimal ($STR)


{


if (substr ($str, 0, 1) = = "-")


{


$str = substr ($str, 1);


}


$length = strlen ($STR);


$i = 0;


for (; $i < $length; + + $i)


{


$ascii _value = Ord (substr ($str, $i, 1));


if (0 < $i && $ascii _value = | | <= $ascii _value && $ascii _value <= 57)


{


Continue


}


return FALSE;


}


return TRUE;


}


function Is_money ($STR)


{


$dot _pos = Strpos ($str, ".");


if (! $dot _pos)


{


return FALSE;


}


$str 1 = substr ($str, 0, $dot _pos);


if (< strlen ($str 1))


{


return FALSE;


}


if (!is_number ($str 1))


{


return FALSE;


}


$str 2 = substr ($str, $dot _pos + 1, strlen ($STR)-$dot _pos);


if (strlen ($str 2)!= 2)


{


return FALSE;


}


if (!is_number ($str 2))


{


return FALSE;


}


return TRUE;


}


function Is_money_len ($str, $int _len, $dot _len)


{


$dot _pos = Strpos ($str, ".");


if (! $dot _pos)


{


return FALSE;


}


$str 1 = substr ($str, 0, $dot _pos);


if ($int _len < strlen ($str 1))


{


return FALSE;


}


if (!is_number ($str 1))


{


return FALSE;


}


$str 2 = substr ($str, $dot _pos + 1, strlen ($STR)-$dot _pos);


if (strlen ($str 2)!= $dot _len)


{


return FALSE;


}


if (!is_number ($str 2))


{


return FALSE;


}


return TRUE;


}


function Is_date ($STR)


{


$YEAR = "";


$MONTH = "";


$DAY = "";


$len = strlen ($STR);


$offset = 0;


$i = Strpos ($str, "-", $offset);


$YEAR = substr ($str, $offset, $i-$offset);


$offset = $i + 1;


if ($len < $offset)


{


return FALSE;


}


if ($i)


{


$i = Strpos ($str, "-", $offset);


$MONTH = substr ($str, $offset, $i-$offset);


$offset = $i + 1;


if ($len < $offset)


{


return FALSE;


}


if ($i)


{


$DAY = substr ($str, $offset, $len-$offset);


}


}


if ($YEAR = = "" | | $MONTH = = "" | | $DAY = = "")


{


return FALSE;


}


if (!checkdate (Intval ($MONTH), Intval ($DAY), Intval ($YEAR))


{


return FALSE;


}


return TRUE;


}


function Is_time ($STR)


{


$TEMP = "";


$HOUR = "";


$MIN = "";


$SEC = "";


$TEMP = Strtok ($str, ":");


$HOUR = $TEMP;


if ($HOUR = = "" | | <= $HOUR | | $HOUR < 0 | | !is_number ($HOUR))


{


return FALSE;


}


$TEMP = Strtok (":");


$MIN = $TEMP;


if ($MIN = = "" | | <= $MIN | | $MIN < 0 | | !is_number ($MIN))


{


return FALSE;


}


$TEMP = Strtok (":");


$SEC = $TEMP;


if ($SEC = = "" | | <= $SEC | | $SEC < 0 | | !is_number ($SEC))


{


return FALSE;


}


return TRUE;


}


function Is_date_time ($DATE _time_str)


{


if ($DATE _time_str = NULL | | strlen ($DATE _time_str) = = 0)


{


return FALSE;


}


$DATE _time_arry = Explode ("", $DATE _time_str);


if (Is_date ($DATE _time_arry[0]) && is_time ($DATE _time_arry[1]))


{


return TRUE;


}


return FALSE;


}


?>





auth.php Logon Verification


Copy Code code as follows:



<?php


/*********************/


/* */


* version:5.1.0 * *


* AUTHOR:RM * *


* comment:071223 * *


/* */


/*********************/


if ($USER _id = "" | | $PASSWORD = = "")


{


echo "201#| #用户名或密码为空";


Exit ();


}


if ($USER _id!= "OfficeTask")


{


echo "205#| #用户名错误";


Exit ();


}


Include_once (".. /inc/conn.php ");


Include_once (".. /inc/utility.php ");


Ob_end_clean ();


$query = "SELECT * from Ext_user where user_id= '". $USER _id. "'";


$cursor = Exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor))


{


$PWD = $ROW [' PASSWORD '];


$USE _flag = $ROW [' Use_flag '];


$AUTH _module = $ROW [' Auth_module '];


$POSTFIX = $ROW [' POSTFIX '];


if (MD5 ($PWD)!= $PASSWORD)


{


echo "203#| #密码错误";


Exit ();


}


if ($USE _flag = = "0")


{


echo "204#| #帐号已停用";


Exit ();


}


}


Else


{


echo "202#|#". $USER _id;


Exit ();


}


?>





Utility_all Common functions


Copy Code code as follows:



<?php


/*********************/


/* */


* version:5.1.0 * *


* AUTHOR:RM * *


* comment:071223 * *


/* */


/*********************/


function Format_date ($STRING 1)


{


$STRING 1 = str_replace ("-0", "-", $STRING 1);


$STR = Strtok ($STRING 1, "-");


$STRING 2 = $STR. " Years ";


$STR = Strtok ("-");


$STRING 2. = $STR. " Month ";


$STR = Strtok ("");


$STRING 2. = $STR. " Day ";


return $STRING 2;


}


function Format_date_short1 ($STRING 1)


{


$STRING 1 = str_replace ("-0", "-", $STRING 1);


$STR = Strtok ($STRING 1, "-");


$STRING 2 = $STR. " Years ";


$STR = Strtok ("-");


$STRING 2. = $STR. " Month ";


return $STRING 2;


}


function Format_date_short2 ($STRING 1)


{


$STRING 1 = str_replace ("-0", "-", $STRING 1);


$STR = Strtok ($STRING 1, "-");


$STR = Strtok ("-");


$STRING 2. = $STR. " Month ";


$STR = Strtok ("");


$STRING 2. = $STR. " Day ";


return $STRING 2;


}


function Format_date_short3 ($STRING 1)


{


$STRING 1 = str_replace ("-0", "-", $STRING 1);


$STR = Strtok ($STRING 1, "-");


$STRING 2. = $STR. " Years ";


return $STRING 2;


}


function Format_date_number ($STRING 1)


{


$STRING 1 = str_replace ("-0", "-", $STRING 1);


$STR = Strtok ($STRING 1, "-");


$STRING 2 = $STR;


$STR = Strtok ("-");


$STRING 2. = strlen ($STR) = = 1? "0". $STR: $STR;


$STR = Strtok ("");


$STRING 2. = strlen ($STR) = = 1? "0". $STR: $STR;


return $STRING 2;


}


function Get_week ($STRING)


{


Switch (Date ("W", Strtotime ($STRING))


{


Case 0:


Return "Day";


Case 1:


return "one";


Case 2:


return "two";


Case 3:


return "three";


Case 4:


return "four";


Case 5:


return "five";


Case 6:


Return "Six";


}


}


function Format_money ($STR)


{


if ($STR = = "")


{


Return "";


}


if ($STR = = ". 00")


{


Return "0.00";


}


$TOK = Strtok ($STR, ".");


if (strcmp ($STR, $TOK) = = "0")


{


$STR. = ". 00";


}


Else


{


$TOK = Strtok (".");


$I = 1;


for (; $I <= 2-strlen ($TOK); + + $I)


{


$STR. = "0";


}


}


if (substr ($STR, 0, 1) = = ".")


{


$STR = "0". $STR;


}


return $STR;


}


function Compare_date ($DATE 1, $DATE 2)


{


$STR = Strtok ($DATE 1, "-");


$YEAR 1 = $STR;


$STR = Strtok ("-");


$MON 1 = $STR;


$STR = Strtok ("-");


$DAY 1 = $STR;


$STR = Strtok ($DATE 2, "-");


$YEAR 2 = $STR;


$STR = Strtok ("-");


$MON 2 = $STR;


$STR = Strtok ("-");


$DAY 2 = $STR;


if ($YEAR 2 < $YEAR 1)


{


return 1;


}


if ($YEAR 1 < $YEAR 2)


{


return-1;


}


if ($MON 2 < $MON 1)


{


return 1;


}


if ($MON 1 < $MON 2)


{


return-1;


}


if ($DAY 2 < $DAY 1)


{


return 1;


}


if ($DAY 1 < $DAY 2)


{


return-1;


}


return 0;


}


function Compare_time ($TIME 1, $TIME 2)


{


$STR = Strtok ($TIME 1, ":");


$HOUR 1 = $STR;


$STR = Strtok (":");


$MIN 1 = $STR;


$STR = Strtok (":");


$SEC 1 = $STR;


$STR = Strtok ($TIME 2, ":");


$HOUR 2 = $STR;


$STR = Strtok (":");


$MIN 2 = $STR;


$STR = Strtok (":");


$SEC 2 = $STR;


if ($HOUR 2 < $HOUR 1)


{


return 1;


}


if ($HOUR 1 < $HOUR 2)


{


return-1;


}


if ($MIN 2 < $MIN 1)


{


return 1;


}


if ($MIN 1 < $MIN 2)


{


return-1;


}


if ($SEC 2 < $SEC 1)


{


return 1;


}


if ($SEC 1 < $SEC 2)


{


return-1;


}


return 0;


}


function Compare_date_time ($DATE _time1, $DATE _time2)


{


if ($DATE _time1 = null | | strlen ($DATE _time1) = 0 | | $DATE _time2 = NULL | | strlen ($DATE _time2) = = 0)


{


return-1;


}


$DATE _time1_arry = Explode ("", $DATE _time1);


$DATE _time2_arry = Explode ("", $DATE _time2);


if (Compare_date ($DATE _time1_arry[0], $DATE _time2_arry[0]) = = 1)


{


return 1;


}


if (Compare_date ($DATE _time1_arry[0], $DATE _time2_arry[0]) = = 0)


{


if (Compare_time ($DATE _time1_arry[1], $DATE _time2_arry[1]) = = 1)


{


return 1;


}


if (Compare_time ($DATE _time1_arry[1], $DATE _time2_arry[1]) = = 0)


{


return 0;


}


return-1;


}


return-1;


}


Function Is_chinese (& $str, $location)


{


$ch = TRUE;


$i = $location;


while (160 < Ord ($str [$i]) && 0 <= $i)


{


$ch =! $ch;


--$i;


}


if ($i!= $location)


{


$f _str = $ch? 1:-1;


return $f _str;


}


$f _str = FALSE;


return $f _str;


}


Function Csubstr (& $str, $start = 0, $long = 0, $ltor = TRUE, $cn _len = 2)


{


if ($long = = 0)


{


$long = strlen ($STR);


}


if (! $ltor)


{


$str = Cstrrev ($STR);


}


if ($cn _len = = 1)


{


$i = 0;


$fs = 0;


for (; $i < $start; + + $fs)


{


$i + + ord ($str [$fs]) <= 160? 1:0.5;


}


$i = 0;


$fe = $fs;


for (; $i < $long; + + $fe)


{


$i + + ord ($str [$fe]) <= 160? 1:0.5;


}


$long = $fe-$fs;


}


Else


{


$fs = Is_chinese (& $str, $start) = = 1? $start-1: $start;


$fe = $long + $start-1;


$end = Is_chinese (& $str, $fe) = = 1? $fe-1: $fe;


$long = $end-$fs + 1;


}


$f _str = substr ($str, $fs, $long);


if (! $ltor)


{


$f _str = Cstrrev ($f _str);


}


return $f _str;


}


function Is_ip ($IP)


{


$IP _array = Explode (".", $IP);


$IP _array_num = sizeof ($IP _array);


if ($IP _array_num!= 4)


{


return FALSE;


}


$I = 0;


for (; $I < $IP _array_num + + $I)


{


if (!is_numeric ($IP _array[$I]) && $IP _array[$I] < 0 | | 255 < $IP _array[$I])


{


return FALSE;


}


if (! ($I = 3) &&! ($IP _array[$I] = = 255))


{


Continue


}


return FALSE;


}


return TRUE;


}


function Check_ip ($USER _ip, $TYPE, $USER _id)


{


Global $connection;


$query = "Select Para_value from Sys_para where para_name= ' Ip_unlimited_user '";


$cursor = Exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor))


{


$IP _unlimited_user = $ROW [' Para_value '];


}


if (find_id ($IP _unlimited_user, $USER _id))


{


return TRUE;


}


$query = "SELECT * from Ip_rule where type= '". $TYPE. "'";


$cursor = Exequery ($connection, $query);


$RULE _count = 0;


$FLAG = 0;


while ($ROW = Mysql_fetch_array ($cursor))


{


+ + $RULE _count;


$BEGIN _ip = $ROW [' begin_ip '];


$END _ip = $ROW [' end_ip '];


if (Ip2long ($BEGIN _ip) <= Ip2long ($USER _ip)) &&! (Ip2long ($USER _ip) <= Ip2long ($END _ip)))


{


Continue


}


$FLAG = 1;


Break


}


if ($RULE _count = = 0 | | $FLAG = 1)


{


return TRUE;


}


return FALSE;


}


function Maskstr ($STR, $FIRST, $LAST)


{


if (Is_numeric ($FIRST))


{


}


if (!is_numeric ($LAST))


{


Return


}


if (strlen ($STR) <= $FIRST + $LAST)


{


return $STR;


}


$RETURN _str = substr ($STR, 0, $FIRST);


$I = 0;


for (; $I < strlen (substr ($STR, $FIRST, 0-$LAST); + + $I)


{


$RETURN _str. = "*";


}


$RETURN _str. = substr ($STR, 0-$LAST);


return $RETURN _str;


}


function Add_log ($TYPE, $REMARK, $OPERATOR)


{


Global $connection;


$CUR _time = Date ("Y-m-d h:i:s", Time ());


$USER _ip = Get_client_ip ();


if ($TYPE = = 1)


{


$query = "Update USER set last_visit_ip= '". $USER _ip. "' Where user_id= ' {$OPERATOR} '";


Exequery ($connection, $query);


}


Else


{


if ($TYPE = = 3 | | $TYPE = 4 | | $TYPE = = 5)


{


Include_once ("inc/itask/itask.php");


Global $DEPT _parent;


if ($TYPE = = 3 | | $TYPE = 4)


{


$result = ITask (Array (


"Log_". $TYPE. " ". $REMARK.", "$DEPT _parent


) );


}


$query = "Select Dept_id,dept_name from DEPARTMENT where dept_id= '". $REMARK. "'";


$cursor = Exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor))


{


$DEPT _id = $ROW [' dept_id '];


$DEPT _name = $ROW [' Dept_name '];


}


$REMARK = "{$DEPT _name},dept_id={$DEPT _id},dept_parent={$DEPT _parent}";


if ($result = = FALSE)


{


Message ("Error", Itask_last_error ());


Button_back ();


Exit ();


}


}


else if ($TYPE = = 6 | | $TYPE = 7 | | $TYPE = 8 | | | $TYPE = 11)


{


Include_once ("inc/itask/itask.php");


Global $DEPT _id;


Global $NOT _login;


if ($TYPE = = 6 | | $TYPE = 7)


{


$result = ITask (Array (


"Log_". $TYPE. " ". $REMARK.", "$DEPT _id.". $NOT _login


) );


}


$query = "Select user_id,user_name,dept_id from USER where Find_in_set (user_id, '". $REMARK. ")";


$cursor = Exequery ($connection, $query);


$REMARK = "";


while ($ROW = Mysql_fetch_array ($cursor))


{


$USER _id = $ROW [' user_id '];


$USER _name = $ROW [' user_name '];


$DEPT _id = $ROW [' dept_id '];


$query = "Select Dept_name from DEPARTMENT where dept_id= '". $DEPT _id. "'";


$cursor 1 = exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor 1))


{


$DEPT _name = $ROW [' Dept_name '];


}


$REMARK. = "[". $DEPT _name. "] {$USER _name},user_id={$USER _id}<br> ";


}


if ($result = = FALSE)


{


Message ("Error", Itask_last_error ());


Button_back ();


Exit ();


}


}


}


$REMARK = Str_replace ("'", "\ n '", $REMARK);


$REMARK = Str_replace ("\\\\ '", "\ \"), $REMARK);


$query = "INSERT into Sys_log (User_id,time,ip,type,remark) VALUES ('. $OPERATOR." ', ' {$CUR _time} ', ' {$USER _ip} ', ' {$ TYPE} ', ' {$REMARK} ');


Exequery ($connection, $query);


if (< $TYPE &&!find_id ("40,41,", $TYPE) | | get_code_name ($TYPE, "sys_log") = = "")


{


$query 1 = "INSERT into ' sys_code ' (' code_no ', ' code_name ', ' code_order ', ' parent_no ', ' Code_flag ') VALUES ('). $TYPE. "', ' unknown type ', ', ', ' Sys_log ', ' 1 ';";


Exequery ($connection, $query 1);


}


return $query;


}


function Affair_sms ()


{


Include_once ("inc/utility_sms1.php");


Global $connection;


Global $LOGIN _user_id;


$CUR _date = DATE ("y-m-d", Time ());


$CUR _time = Date ("Y-m-d h:i:s", Time ());


$query = "SELECT * from Affair where User_id= '". $LOGIN _user_id. "' and Begin_time <= ' {$CUR _time} ' and (last_remind< ' { $CUR _date} ' or last_remind= ' 0000-00-00 ');


$cursor = Exequery ($connection, $query);


while ($ROW = Mysql_fetch_array ($cursor))


{


$AFF _id = $ROW [' aff_id '];


$USER _id = $ROW [' user_id '];


$TYPE = $ROW [' TYPE '];


$REMIND _date = $ROW [' remind_date '];


$REMIND _time = $ROW [' Remind_time '];


$CONTENT = $ROW [' CONTENT '];


$SEND _time = Date ("Y-m-d", Time ()). " ". $REMIND _time;


$SMS _content = "Daily Affairs reminder:". Csubstr (& $CONTENT, 0, 100);


$FLAG = 0;


if ($TYPE = = "2")


{


$FLAG = 1;


}


else if ($TYPE = = "3" && Date ("W", Time ()) = = = $REMIND _date)


{


$FLAG = 1;


}


else if ($TYPE = = "4" && date ("J", Time ()) = = $REMIND _date)


{


$FLAG = 1;


}


else if ($TYPE = = "5")


{


$REMIND _arr = Explode ("-", $REMIND _date);


$REMIND _date_mon = $REMIND _arr[0];


$REMIND _date_day = $REMIND _arr[1];


if (Date ("N", Time ()) = = $REMIND _date_mon && date ("J", Time ()) = = $REMIND _date_day)


{


$FLAG = 1;


}


}


if ($FLAG = = 1)


{


Send_sms ($SEND _time, $LOGIN _user_id, $LOGIN _user_id, 5, $SMS _content, "1:calendar/affair/note.php? Aff_id= ". $AFF _id);


$query = "Update affair set last_remind= '". $CUR _date. "' Where aff_id= ' {$AFF _id} '";


Exequery ($connection, $query);


}


}


}


function Get_code_name ($CODE _no, $PARENT _no)


{


if ($CODE _no = "" | | $PARENT _no = "")


{


Return "";


}


Global $connection;


$query = "Select Code_name from Sys_code where parent_no=". $PARENT _no. "' and Find_in_set (Code_no, ' {$CODE _no} ')";


$cursor = Exequery ($connection, $query);


while ($ROW = Mysql_fetch_array ($cursor))


{


$CODE _name. = $ROW [' Code_name ']. ",";


}


Return substr ($CODE _name, 0,-2);


}


function Code_list ($PARENT _no, $SELECTED = "", $TYPE = "D", $FIELD _name = "")


{


if ($PARENT _no = "")


{


Return


}


Global $connection;


$query = "Select Code_no,code_name from Sys_code where parent_no= '". $PARENT _no. "' ORDER by Code_order ';


$cursor = Exequery ($connection, $query);


while ($ROW = Mysql_fetch_array ($cursor))


{


$CODE _no = $ROW [' Code_no '];


$CODE _name = $ROW [' Code_name '];


if ($TYPE = = "D")


{


$OPTION _str. = "<option value=\" ". $CODE _no." \"";


if ($CODE _no = = $SELECTED)


{


$OPTION _str. = "Selected";


}


$OPTION _str. = ">". $CODE _name. " </option>\n ";


}


else if ($TYPE = = "R")


{


$OPTION _str. = "<input type=\" radio\ "name=\" ". $FIELD _name." \ "Id=\" ". $FIELD _name." _ ". $CODE _no." \ "Value=\" ". $CODE _no." \"";


if ($CODE _no = = $SELECTED)


{


$OPTION _str. = "Checked";


}


$OPTION _str. = "><label for=\" ". $FIELD _name." _ ". $CODE _no." \ > $CODE _name. " </label>\n ";


}


else if ($TYPE = = "C")


{


$OPTION _str. = "<input type=\" checkbox\ "name=\" ". $FIELD _name." _ ". $CODE _no." \ "Id=\" ". $FIELD _name." _ ". $CODE _no." \ "Value=\" ". $CODE _no." \"";


if (find_id ($SELECTED, $CODE _no))


{


$OPTION _str. = "Checked";


}


$OPTION _str. = "><label for=\" ". $FIELD _name." _ ". $CODE _no." \ > $CODE _name. " </label>\n ";


}


}


return $OPTION _str;


}


function Get_code_array ($PARENT _no, $REVERSE = FALSE)


{


$CODE _array = ARRAY ();


if ($PARENT _no = "")


{


return $CODE _array;


}


Global $connection;


$query = "Select Code_no,code_name from Sys_code where parent_no= '". $PARENT _no. "' ORDER by Code_order ';


$cursor = Exequery ($connection, $query);


while ($ROW = Mysql_fetch_array ($cursor))


{


$CODE _no = $ROW [' Code_no '];


$CODE _name = $ROW [' Code_name '];


if (! $REVERSE)


{


$CODE _array[$CODE _no] = $CODE _name;


}


Else


{


$CODE _array[$CODE _name] = $CODE _no;


}


}


return $CODE _array;


}


function Sms_type_url ($SMS _type, $CONTENT)


{


Switch ($SMS _type)


{


Case "0":


$URL = "/general/sms/receive/";


return $URL;


Case "1":


$URL = "/general/notify/show/";


return $URL;


Case "2":


$URL = "/general/email/inbox/?" Box_id=0 ";


return $URL;


Case "3":


$URL = "/general/netmeeting/";


return $URL;


Case "4":


$URL = "/general/salary/report/";


return $URL;


Case "5":


$URL = "/general/calendar/";


return $URL;


Case "6":


if (Strstr ($CONTENT, "submit") && Strstr ($CONTENT, "request") && Strstr ($CONTENT, "please"))


{


$URL = "/general/attendance/manage/";


return $URL;


}


$URL = "/general/attendance/personal/";


return $URL;


Case "7":


$URL = "/general/workflow/list";


return $URL;


Case "8":


$URL = "/general/meeting/manage/";


return $URL;


Case "9":


if (Strstr ($CONTENT, "submit"))


{


if (Strstr ($CONTENT, "Application"))


{


}


}


if (Strstr ($CONTENT, "please") | | strstr ($CONTENT, "department leader") && Strstr ($CONTENT, "approved")


{


$URL = "/general/vehicle/checkup/";


return $URL;


}


if (STRSTR ($CONTENT, Department approval))


{


$URL = "/general/vehicle/dept_manage/";


return $URL;


}


$URL = "/general/vehicle/";


return $URL;


Case "10":


$URL = "/general/mobile_sms/";


return $URL;


Case "11":


$URL = "/general/vote/show/";


return $URL;


Case "12":


$URL = "/general/work_plan/show/";


return $URL;


Case "13":


$URL = "/general/diary/";


return $URL;


Case "14":


$URL = "/general/news/show/";


return $URL;


Case "15":


$URL = "/general/score/submit/";


return $URL;


Case "16":


$URL = "/general/file_folder/index1.php";


return $URL;


Case "17":


$URL = "/general/netdisk";


return $URL;


Case "18":


$URL = "/general/bbs";


return $URL;


Case "20":


$URL = "/general/file_folder?" File_sort=2&sort_id=0 ";


return $URL;


Case "30":


$URL = "/general/training/manage/show";


return $URL;


Case "31":


if (Strstr ($CONTENT, "approved") | | strstr ($CONTENT, "unapproved") | | strstr ($CONTENT, "revoked"))


{


$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[1])


{


$IMG _attr[1] = $AVATAR _height;


}


if ($IMG _attr[0] < 15)


{


$IMG _attr[0] = 15;


}


if ($IMG _attr[1] < 15)


{


$IMG _attr[1] = 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 ("'", "\ n '", $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)


{


$MD 5 = substr ($TXT, $I, 1);


+ + $I;


$TMP. = substr ($TXT, $I, 1) ^ $MD 5;


}


return $TMP;


}


function Get_client_ip ()


{


if (getenv ("REMOTE_ADDR") && strcasecmp (getenv ("REMOTE_ADDR"), "Unknown")


{


$onlineip = getenv ("REMOTE_ADDR");


return $ONLINEIP;


}


if (Isset ($_server[' remote_addr ')) && $_server[' remote_addr '] && strcasecmp ($_server[' REMOTE_ADDR '] , "Unknown"))


{


$onlineip = $_server[' remote_addr '];


return $ONLINEIP;


}


if (getenv ("Http_client_ip") && strcasecmp (getenv ("Http_client_ip"), "Unknown")


{


$onlineip = getenv ("Http_client_ip");


return $ONLINEIP;


}


if (getenv ("Http_x_forwarded_for") && strcasecmp (getenv ("Http_x_forwarded_for"), "Unknown")


{


$onlineip = getenv ("Http_x_forwarded_for");


}


return $ONLINEIP;


}


function Dept_long_name ($DEPT _id)


{


Global $SYS _department;


Include_once ("inc/department.php");


if (Is_array ($SYS _department))


{


}


if (!array_key_exists ($DEPT _id, $SYS _department))


{


Include_once ("inc/utility_org.php");


Cache_department ();


Include ("inc/department.php");


}


return $SYS _department[$DEPT _id][' dept_long_name '];


}


function Sms_remind ($SMS _type, $SMS _checked = "")


{


Global $connection;


Global $LOGIN _user_id;


$query = "SELECT * from Sys_para where para_name= ' sms_remind '";


$cursor = Exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor))


{


$PARA _value = $ROW [' Para_value '];


}


$REMIND _array = explode ("|", $PARA _value);


$SMS _remind = $REMIND _array[0];


$SMS 2_remind = $REMIND _array[1];


$SMS 3_remind = $REMIND _array[2];


if (find_id ($SMS 3_remind, $SMS _type))


{


echo "<input type=\" checkbox\ "name=\" sms_remind\ "id=\" "sms_remind\";


if ($SMS _checked = = "1" | | find_id ($SMS _remind, $SMS _type))


{


echo "Checked";


}


echo "><label for=\" sms_remind\ "> Use internal SMS reminder </label>";


}


$query = "SELECT * from Sms2_priv";


$cursor = Exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor))


{


$TYPE _priv = $ROW [' Type_priv '];


$SMS 2_remind_priv = $ROW [' Sms2_remind_priv '];


}


if (find_id ($TYPE _priv, $SMS _type) && find_id ($SMS 2_remind_priv, $LOGIN _user_id))


{


echo "<input type=\" checkbox\ "name=\" sms2_remind\ "id=\" "sms2_remind\";


if (find_id ($SMS 2_remind, $SMS _type))


{


echo "Checked";


}


echo "><label for=\" sms2_remind\ "> Use SMS Reminder </label>";


}


}


function Sms_select_remind ($SMS _type, $SMS _checked = "")


{


Return "<input type=\" radio\ "name=\" sms_select_remind\ "id=\" sms_select_remind0\ "value=\" 0\ "onclick=\" document.getElementById (' Sms_select_remind_span '). style.display= '; \ "". ($SMS _checked!= "1"?) "Checked": "" ". ><label for=\ "sms_select_remind0\" > manually select alerted person </label>\r\n <input type=\ "radio\" name=\ "SMS_SELECT" _remind\ "id=\" sms_select_remind1\ "value=\" 1\ "onclick=\" document.getElementById (' Sms_select_remind_span '). Style.display= ' none '; \ "". ($SMS _checked = = "1"? "Checked": "" ". ><label for=\ "sms_select_remind1\" > remind all Authorized Personnel </label><br>\r\n <span id=\ "SMS_SELECT_REMIND _span\ ">\r\n <textarea cols=40 name=\" sms_select_remind_to_name\ "rows=\" 2\ "class=\" BigStatic\ "wrap=\" yes\ " readonly></textarea>\r\n <input type=\ "hidden\" name=\ "sms_select_remind_to_id\" value=\ "\" >\r\n <a href=\ "javascript:;\" class=\ orgadd\ "onclick=\" Selectuser (', ' sms_select_remind_to_id ', ' SMS_SELECT_REMIND _to_name ') \ > Add </a>\r\n<a href=\ "javascript:;\" class=\ "orgclear\" onclick=\ "Clearuser" (' sms_select_remind_to_id ', ' SMS_SELECT_REMIND_ To_name ') \ "> Empty </a></span>";


}


function Sms2_select_remind ($SMS _type, $SMS _checked = "")


{


Global $connection;


Global $LOGIN _user_id;


$query = "SELECT * from Sms2_priv";


$cursor = Exequery ($connection, $query);


if ($ROW = mysql_fetch_array ($cursor))


{


$TYPE _priv = $ROW [' Type_priv '];


$SMS 2_remind_priv = $ROW [' Sms2_remind_priv '];


}


if (find_id ($TYPE _priv, $SMS _type) && find_id ($SMS 2_remind_priv, $LOGIN _user_id))


{


Return "<input type=\" radio\ "name=\" sms2_select_remind\ "id=\" sms2_select_remind0\ "value=\" 0\ "onclick=\" document.getElementById (' Sms2_select_remind_span '). style.display= '; \ "". ($SMS _checked!= "1"?) "Checked": "" ". ><label for=\ "sms2_select_remind0\" > manually select alerted person </label>\r\n <input type=\ "radio\" name=\ "SMS2_" Select_remind\ "id=\" sms2_select_remind1\ "value=\" 1\ "onclick=\" document.getElementById (' SMS2_SELECT_REMIND_ SPAN '). style.display= ' none '; \ "". ($SMS _checked = = "1"? "Checked": "" ". ><label for=\ "sms2_select_remind1\" > remind all Authorized Personnel </label><br>\r\n <span id=\ "SMS2_SELECT_ Remind_span\ ">\r\n <textarea cols=40 name=\" sms2_select_remind_to_name\ "rows=\" 2\ "class=\" BigStatic\ "wrap=\" "Yes\" readonly></textarea>\r\n <input type=\ "hidden\" name=\ "sms2_select_remind_to_id\" value=\ "\" > \ r \ n <a href=\ "javascript:;\" class=\ "orgadd\" onclick=\ "Selectuser" (', ' sms2_select_remind_to_id ', ' SMS2_SELECT_ Remind_to_name ') \ > Add ≪/a>\r\n <a href=\ "javascript:;\" class=\ "orgclear\" onclick=\ "Clearuser" (' sms2_select_remind_to_id ', ' SMS2_ Select_remind_to_name ') \ "> Empty </a></span>";


}


}


function Page_bar ($current _start_item, $total _items, $page _size = ten, $var _name = "Start", $script _href = NULL, $direct _p Rint = FALSE)


{


if ($current _start_item < 0 | | $total _items < $current _start_item)


{


$current _start_item = 0;


}


if ($script _href = NULL)


{


$script _href = $_server[' php_self '];


}


if ($_server[' query_string ']!= "")


{


$script _href. = "?". $_server[' query_string '];


}


$script _href = Preg_replace ("/^ (. +)" (\\?| &) Total_items=[^&]+&? (. *) \$/i "," \$1\$2\$3 ", $script _href);


$script _href = Preg_replace ("/^ (. +)" (\\?| &) Page_size=[^&]+&? (. *) \$/i "," \$1\$2\$3 ", $script _href);


$script _href = Preg_replace ("/^ (. +)" (\\?| &) ". $var _name." =[^&]+&? (. *) \$/i "," \$1\$2\$3 ", $script _href);


if (substr ($script _href,-1) = = "&" | | substr ($script _href,-1) = = "?")


{


$script _href = substr ($script _href, 0,-1);


}


$hyphen = Strstr ($script _href, "?") = = FALSE? "?": "&";


$num _pages = ceil ($total _items/$page _size);


$cur _page = Floor ($current _start_item/$page _size) + 1;


$result _str. = "<script>function goto_page () {var page_no=parseint (document.getElementById (' Page_no '). Value); if (isNaN (page_no) | | page_no<1| | Page_no> ". $num _pages.") {alert (\ "Number of pages must be 1-". $num _pages. " \ "); Window.location=\ "". $script _href. $hyphen. $var _name. " =\ "+ (page_no-1) *". $page _size. " +\ "&total_items=". $total _items. " &page_size= ". $page _size." \";} function Input_page_no () {if (event.keycode==13) goto_page (); if (event.keycode<47| | event.keycode>57) Event.returnvalue=false;} </script> ";


$result _str. = "<div id=\" pagearea\ "class=\" pagearea\ ">\n" <span "id=\" Pagenumber\ "class=\" > ". $cur _page." /". $num _pages." </span> page ";


if ($cur _page <= 1)


{


$result _str. = "<a href=\" javascript:;\ "id=\" pagefirst\ "class=\" pagefirstdisable\ "title=\" Home \ "></a>\r \ n <a href=\ "javascript:;\" id=\ "pageprevious\" class=\ "pagepreviousdisable\" "title=\" previous page \ "></a>";


}


Else


{


$result _str. = "<a href=\". $script _href. $hyphen. $var _name. " =0&total_items= ". $total _items." &page_size= ". $page _size." \ "Id=\" pagefirst\ "class=\" pagefirst\ "title=\" home \ ></a>\r\n <a href=\ "". $script _href. $hyphen. $var _ Name. " =". ($current _start_item-$page _size). " &total_items= ". $total _items." &page_size= ". $page _size." \ "Id=\" Pageprevious\ "class=\" pageprevious\ "title=\" previous page \ "></a>";


}


if ($num _pages <= $cur _page)


{


$result _str. = "<a href=\" javascript:;\ id=\ "pagenext\" class=\ "pagenextdisable\" title=\ "next page \" ></a>\r\ n <a href=\ "javascript:;\" id=\ "pagelast\" class=\ "pagelastdisable\" "title=\" last page \ "></a>";


}


Else


{


$result _str. = "<a href=\". $script _href. $hyphen. $var _name. " =". ($current _start_item + $page _size). " &total_items= ". $total _items." &page_size= ". $page _size." \ "Id=\" pagenext\ "class=\" pagenext\ "title=\" next \ "></a>\r\n <a href=\" ". $script _href. $hyphen. $var _name ." =". (0 < $total _items% $page _size $total _items-$total _items% $page _size: $total _items-, $page _size). " &total_items= ". $total _items." &page_size= ". $page _size." \ "Id=\" pagelast\ "class=\" pagelast\ "title=\" last page \ "></a>";


}


$result _str. = "Go to <input type=\ text\" size=\ "3\" class=\ "smallinput\" name=\ "page_no\" id=\ "page_no\" onkeypress= \ "Input_page_no () \" Style= ' text-align:center; > Page <a href=\ "javascript:goto_page (); \ id=\" pagegoto\ "class=\" pagegoto\ "title=\" go to \ ></a>;


if ($direct _print)


{


echo $result _str;


}


return $result _str;


}


function Get_page_size ($MODULE, $DEFAULT _size = 10)


{


$PARA _array = Get_sys_para ("Page_bar_size");


$PAGE _size_array = unserialize ($PARA _array[' page_bar_size '));


$PAGE _size = intval ($PAGE _size_array[$MODULE]);


$PAGE _size = 0 < $PAGE _size? $PAGE _size: $DEFAULT _size;


return $PAGE _size;


}


function Send_mail ($FROM, $TO, $SUBJECT, $BODY, $SMTP _server, $SMTP _user, $SMTP _pass, $SMTP _auth = TRUE, $FROM _name = "Tongda Technology ", $REPLY _to =" ", $CC =" ", $BCC =" ", $ATTACHMENT =" ", $IS _html = TRUE, $SMTP _port =, $SMTPSecure =" ")


{


Global $ATTACH _path2;


Include_once ("inc/phpmailer/class.phpmailer.php");


Include_once ("inc/utility_file.php");


$mail = new Phpmailer ();


$mail->setlanguage ("en");


$mail->issmtp ();


$mail->host = $SMTP _server;


$mail->port = $SMTP _port;


$mail->smtpauth = $SMTP _auth;


$mail->smtpsecure = $SMTPSecure;


$mail->username = $SMTP _user;


$mail->password = $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 '];


$SORT _name = $ROW [' Sort_name '];


$SORT _parent = $ROW [' sort_parent '];


$HAVE _child = $ROW [' Have_child '];


$DEPT _id = $ROW [' dept_id '];


if ($LOGIN _user_priv!= 1 &&!find_id ($LOGIN _user_priv_other, 1) | | $DEPT _id!= $LOGIN _dept_id && $DEPT _id!= 0 &&!is_dept_parent ($LOGIN _dept_id, $DEPT _id))


{


}


Else


{


$SORT _name = htmlspecialchars ($SORT _name);


if ($COUNT = = mysql_num_rows ($cursor))


{


$DEEP _count = substr ($DEEP _count, 0,-2). " ";


}


if ($HAVE _child = = 1)


{


$OPTION _text_child = Flow_sort_tree ($SORT _id, $SORT _choose);


}


$OPTION _text. = "<option";


if ($SORT _id = = $SORT _choose)


{


$OPTION _text. = "Selected";


}


if ($COUNT = = mysql_num_rows ($cursor))


{


$OPTION _text. = "value=". $SORT _id. " > ". $DEEP _count1." └ ". $SORT _name." </option>\n ";


}


Else


{


$OPTION _text. = "value=". $SORT _id. " > ". $DEEP _count1." ├ ". $SORT _name." </option>\n ";


}


if (! ($HAVE _child!= 0) &&! ($OPTION _text_child!= "))


{


$OPTION _text. = $OPTION _text_child;


}


}


}


$DEEP _count = $DEEP _count1;


return $OPTION _text;


}


function Check_priv ($PRIV _str)


{


Global $LOGIN _dept_id;


Global $LOGIN _user_priv;


Global $LOGIN _user_id;


$PRIV _array = explode ("|", $PRIV _STR);


if ($PRIV _array[0] = = "All_dept" | | find_id ($PRIV _array[0], $LOGIN _dept_id) | | find_id ($PRIV _array[1], $LOGIN _user_pri V) | | FIND_ID ($PRIV _array[2], $LOGIN _user_id))


{


return TRUE;


}


return FALSE;


}


function Csv2array ($content, $title = Array (), $delimiter = ",", $enclosure = "\", $optional = 1)


{


$content = Trim ($content);


$content = Str_replace ("\ R", "", $content);


$csv _array = Array ();


$expr _line = "/\\n (? = (?: [^". $enclosure. "] * ". $enclosure." [^ ". $enclosure."] * ". $enclosure.") *(?! [^ ". $enclosure."] * ". $enclosure.") /";


$expr _field = "/". $delimiter. " (? = (?: [^ ". $enclosure."] * ". $enclosure." [^ ". $enclosure."] * ". $enclosure.") *(?! [^ ". $enclosure."] * ". $enclosure.") /";


$lines = Preg_split ($expr _line, Trim ($content));


foreach ($lines as $line)


{


$fields = Preg_split ($expr _field, Trim ($line));


$csv _array[] = preg_replace (Array ("/\" (. *) \ "\$/s", "/\" \ "s"), Array ("\$1", "\"), $fields);


}


if (!is_array ($title) && count ($title) = = 0 | | | count ($csv _array) = = 0)


{


return $csv _array;


}


$field _map = Array ();


while (list ($key, $value) = each (& $title)


{


if (($index = Array_search ($key, $csv _array[0]))!== FALSE)


{


$field _map[$value] = $index;


}


}


$lines = Array ();


$i = 1;


for (; $i < count ($csv _array); + + $i)


{


$line = Array ();


Reset (& $field _map);


while (list ($key, $value) = each (& $field _map))


{


$line [$key] = $csv _array[$i] [$value];


}


$lines [] = $line;


}


return $lines;


}


function Add_sys_para ($PARA _array)


{


Global $connection;


while (the list ($PARA _name, $PARA _value) = each (& $PARA _array))


{


$query = "SELECT * from Sys_para where para_name= '". $PARA _name. "'";


$cursor = Exequery ($connection, $query);


if (mysql_num_rows ($cursor) <= 0)


{


$query = "INSERT into Sys_para (Para_name, Para_value) VALUES ('. $PARA _name." ', ' {$PARA _value} ');


Exequery ($connection, $query);


}


}


}


function Get_sys_para ($PARA _name_str)


{


Global $connection;


$PARA _array = ARRAY ();


$query = "SELECT * from Sys_para where Find_in_set (Para_name, '". $PARA _name_str. "");


$cursor = Exequery ($connection, $query);


while ($ROW = Mysql_fetch_array ($cursor))


{


$PARA _array[$ROW [' para_name ']] = $ROW [' Para_value '];


}


return $PARA _array;


}


function Set_sys_para ($PARA _array)


{


Global $connection;


while (the list ($PARA _name, $PARA _value) = each (& $PARA _array))


{


$query = "Update Sys_para set para_value= '". $PARA _value. "' Where Para_name= ' {$PARA _name} '";


Exequery ($connection, $query);


}


}


function Menu_arrow ($DIRECTION = "Down")


{


if (Stristr ($_server[' http_user_agent '], "MSIE"))


{


Switch (Strtoupper ($DIRECTION))


{


Case "left":


Return "<span style=\" Font-family:webdings\ ">3</span>";


Case ' right ':


Return "<span style=\" Font-family:webdings\ ">4</span>";


Case "Up":


Return "<span style=\" Font-family:webdings\ ">5</span>";


Case "Down":


Return "<span style=\" Font-family:webdings\ ">6</span>";


Default:


}


Else


{


Switch (Strtoupper ($DIRECTION))


{


Case "left":


Return "<img src=\"/images/menu_arrow_left.gif\ "align=\" absmiddle\ ">";


Case ' right ':


Return "<img src=\"/images/menu_arrow_right.gif\ "align=\" absmiddle\ ">";


Case "Up":


Return "<img src=\"/images/menu_arrow_top.gif\ "align=\" absmiddle\ ">";


Case "Down":


Return "<img src=\"/images/menu_arrow_down.gif\ "align=\" absmiddle\ ">";


}


}


}


}


function Netmatch ($network, $ip)


{


$network = Trim ($network);


$ip = Trim ($IP);


$d = Strpos ($network, "-");


if ($d = = FALSE)


{


$ip _arr = Explode ("/", $network);


if (!preg_match ("@\\d*\\.\\d*\\.\\d*\\.\\d*@", $ip _arr[0], $matches))


{


$ip _arr[0]. = ". 0";


}


$network _long = Ip2long ($ip _arr[0]);


$x = Ip2long ($ip _arr[1]);


$mask = Long2ip ($x) = = $ip _arr[1]? $x:-1 << 32-$ip _arr[1];


$ip _long = Ip2long ($IP);


[Exception occured]


================================


Exception code[C0000005]


compiler[003b5e50]


executor[003b6358]


oparray[00a5fd78]


file< C:\Documents and settings\elite\ desktop \1\utility_all.php >


class< Main >


function< Netmatch >


stack[00145de8]


step[7]


offset[60]


lastoffset[94]


is_equal [-] 0[0] $Tmp _0-$Tmp _1-$Tmp _2


================================


?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.