📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
echo "\r\n<html>\r\n<head>\r\n<title>设置公开信息</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n<script>\r\n\r\nfunction func_find(select_obj,option_text)\r\n{\r\n pos=option_text.indexOf(\"] \")+1;\r\n option_text=option_text.substr(0,pos);\r\n\r\n for (j=0; j<select_obj.options.length; j++)\r\n {\r\n str=select_obj.options(j).text;\r\n if(str.indexOf(option_text)>=0)\r\n return j;\r\n }//for\r\n\r\n return j;\r\n}\r\n\r\nfunction func_color(select_obj)\r\n{\r\n font_color=\"000000\";\r\n option_text=\"\";\r\n for (j=0; j<select_obj.options.length; j++)\r\n {\r\n str=select_obj.options(j).text;\r\n if(str.indexOf(option_text)<0)\r\n {\r\n if(font_color==\"red\")\r\n font_color=\"blue\";\r\n else\r\n font_color=\"red\";\r\n }\r\n select_obj.options(j).style.color=font_color;\r\n\r\n pos=str.indexOf(\"] \")+1;\r\n option_text=str.substr(0,pos);\r\n }//for\r\n\r\n return j;\r\n}\r\n\r\nfunction func_insert()\r\n{\r\n for (i=select2.options.length-1; i>=0; i--)\r\n {\r\n if(select2.options(i).selected)\r\n {\r\n option_text=select2.options(i).text;\r\n option_value=select2.options(i).value;\r\n option_style_color=select2.options(i).style.color;\r\n\r\n var my_option = document.createElement(\"OPTION\");\r\n my_option.text=option_text;\r\n my_option.value=option_value;\r\n my_option.style.color=option_style_color;\r\n\r\n pos=func_find(select1,option_text);\r\n select1.add(my_option,pos);\r\n select2.remove(i);\r\n }\r\n }//for\r\n \r\n func_init();\r\n}\r\n\r\nfunction func_delete()\r\n{\r\n for (i=select1.options.length-1; i>=0; i--)\r\n {\r\n if(select1.options(i).selected)\r\n {\r\n option_text=select1.options(i).text;\r\n option_value=select1.options(i).value;\r\n\r\n var my_option = document.createElement(\"OPTION\");\r\n my_option.text=option_text;\r\n my_option.value=option_value;\r\n\r\n pos=func_find(select2,option_text);\r\n select2.add(my_option,pos);\r\n select1.remove(i);\r\n }\r\n }//for\r\n \r\n func_init();\r\n}\r\n\r\nfunction func_select_all1()\r\n{\r\n for (i=select1.options.length-1; i>=0; i--)\r\n select1.options(i).selected=true;\r\n}\r\n\r\nfunction func_select_all2()\r\n{\r\n for (i=select2.options.length-1; i>=0; i--)\r\n select2.options(i).selected=true;\r\n}\r\n\r\nfunction func_init()\r\n{\r\n func_color(select2);\r\n func_color(select1);\r\n}\r\n\r\nfunction mysubmit()\r\n{\r\n fld_str=\"\";\r\n for (i=0; i< select1.options.length; i++)\r\n {\r\n options_value=select1.options(i).value;\r\n fld_str+=options_value+\",\";\r\n }\r\n document.form1.ADDRESS_PRIVATE_FIELDS.value=fld_str;\r\n document.form1.submit();\r\n}\r\n\r\n\r\nfunction func_up()\r\n{\r\n sel_count=0;\r\n for (i=select1.options.length-1; i>=0; i--)\r\n {\r\n if(select1.options(i).selected)\r\n sel_count++;\r\n }\r\n\r\n if(sel_count==0)\r\n {\r\n alert(\"调整公开信息的顺序时,请选择其中一项!\");\r\n return;\r\n }\r\n else if(sel_count>1)\r\n {\r\n alert(\"调整公开信息的顺序时,只能选择其中一项!\");\r\n return;\r\n }\r\n\r\n i=select1.selectedIndex;\r\n\r\n if(i!=0)\r\n {\r\n var my_option = document.createElement(\"OPTION\");\r\n my_option.text=select1.options(i).text;\r\n my_option.value=select1.options(i).value;\r\n\r\n select1.add(my_option,i-1);\r\n select1.remove(i+1);\r\n select1.options(i-1).selected=true;\r\n }\r\n}\r\n\r\nfunction func_down()\r\n{\r\n sel_count=0;\r\n for (i=select1.options.length-1; i>=0; i--)\r\n {\r\n if(select1.options(i).selected)\r\n sel_count++;\r\n }\r\n\r\n if(sel_count==0)\r\n {\r\n alert(\"调整公开信息的顺序时,请选择其中一项!\");\r\n return;\r\n }\r\n else if(sel_count>1)\r\n {\r\n alert(\"调整公开信息的顺序时,只能选择其中一项!\");\r\n return;\r\n }\r\n\r\n i=select1.selectedIndex;\r\n\r\n if(i!=select1.options.length-1)\r\n {\r\n var my_option = document.createElement(\"OPTION\");\r\n my_option.text=select1.options(i).text;\r\n my_option.value=select1.options(i).value;\r\n\r\n select1.add(my_option,i+2);\r\n select1.remove(i);\r\n select1.options(i+1).selected=true;\r\n }\r\n}\r\n\r\n";
if ( $VIEW_TYPE == "" )
{
$VIEW_TYPE = 0;
}
echo "function set_view_type()\r\n{\r\n location=\"index.php?VIEW_TYPE=";
echo 1 - $VIEW_TYPE;
echo "\";\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\" onload=\"func_init();\">\r\n\r\n";
$query = "select * from SYS_PARA where PARA_NAME='ADDRESS_PRIVATE_FIELDS'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$ADDRESS_PRIVATE_FIELDS = $ROW['PARA_VALUE'];
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\">\r\n\t<img src=\"/images/edit.gif\" WIDTH=\"22\" HEIGHT=\"20\" align=\"absmiddle\"><span class=\"big3\"> 设置个人通讯簿信息</span>\r\n\t</td>\r\n </tr>\r\n</table>\r\n<br>\r\n\r\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\" align=\"center\" bordercolorlight=\"#000000\" bordercolordark=\"#FFFFFF\" class=\"big\">\r\n <tr bgcolor=\"#CCCCCC\">\r\n <td align=\"center\">排序</td>\r\n <td align=\"center\"><b>公开字段</b></td>\r\n <td align=\"center\"> </td>\r\n <td align=\"center\" valign=\"top\"><b>备选字段</b></td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" bgcolor=\"#999999\">\r\n <input type=\"button\" class=\"SmallInput\" value=\" ↑ \" onclick=\"func_up();\">\r\n <br><br>\r\n <input type=\"button\" class=\"SmallInput\" value=\" ↓ \" onclick=\"func_down();\">\r\n </td>\r\n <td valign=\"top\" align=\"center\" bgcolor=\"#CCCCCC\">\r\n <select name=\"select1\" ondblclick=\"func_delete();\" MULTIPLE style=\"width:200;height:280\">\r\n ";
$HRM_FLD = "PSN_NAME,SEX,BIRTHDAY,NICK_NAME,MINISTRATION,MATE,CHILD,DEPT_NAME,ADD_DEPT,POST_NO_DEPT,TEL_NO_DEPT,FAX_NO_DEPT,ADD_HOME,POST_NO_HOME,TEL_NO_HOME,MOBIL_NO,BP_NO,EMAIL,OICQ_NO,ICQ_NO,NOTES";
$HRM_FLD_NAME = "姓名,性别,生日,昵称,职务,配偶,子女,单位名称,单位地址,单位邮编,单位电话,单位传真,家庭住址,家庭邮编,家庭电话,手机,小灵通,电子邮件,QQ号码,MSN,备注";
$query = "select * from FIELDSETTING where TABLENAME='ADDRESS' ORDER BY ORDERNO ASC ";
$cursor1 = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$HRM_FLD .= ",".$ROW['FIELDNO'];
$HRM_FLD_NAME .= ",".$ROW['FIELDNAME'];
}
$HRM_FLD_ARRAY = explode( ",", $HRM_FLD );
$HRM_FLD_NAME_ARRAY = explode( ",", $HRM_FLD_NAME );
$ADDRESS_PRIVATE_FIELDS_ARRAY = explode( ",", $ADDRESS_PRIVATE_FIELDS );
$ARRAY_COUNT = sizeof( $ADDRESS_PRIVATE_FIELDS_ARRAY );
$I = 0;
for ( ; $I < $ARRAY_COUNT - 1; ++$I )
{
$ARRAY_COUNT0 = sizeof( $HRM_FLD_ARRAY );
$J = 0;
while ( $J < $ARRAY_COUNT0 )
{
if ( $ADDRESS_PRIVATE_FIELDS_ARRAY[$I] == $HRM_FLD_ARRAY[$J] )
{
echo " <option value=\"";
echo $HRM_FLD_ARRAY[$J];
echo "\">";
echo $HRM_FLD_NAME_ARRAY[$J];
echo "</option>\r\n ";
}
++$J;
}
}
echo " </select>\r\n <input type=\"button\" value=\" 全 选 \" onclick=\"func_select_all1();\" class=\"SmallInput\">\r\n </td>\r\n\r\n <td align=\"center\" bgcolor=\"#999999\">\r\n <input type=\"button\" class=\"SmallInput\" value=\" ← \" onclick=\"func_insert();\">\r\n <br><br>\r\n <input type=\"button\" class=\"SmallInput\" value=\" → \" onclick=\"func_delete();\">\r\n </td>\r\n\r\n <td align=\"center\" valign=\"top\" bgcolor=\"#CCCCCC\">\r\n <select name=\"select2\" ondblclick=\"func_insert();\" MULTIPLE style=\"width:200;height:280\">\r\n";
$ARRAY_COUNT = sizeof( $HRM_FLD_ARRAY );
$I = 0;
for ( ; $I < $ARRAY_COUNT - 1; ++$I )
{
if ( !find_id( $ADDRESS_PRIVATE_FIELDS, $HRM_FLD_ARRAY[$I] ) )
{
echo " <option value=\"";
echo $HRM_FLD_ARRAY[$I];
echo "\">";
echo $HRM_FLD_NAME_ARRAY[$I];
echo "</option>\r\n ";
}
}
echo " </select>\r\n <input type=\"button\" value=\" 全 选 \" onclick=\"func_select_all2();\" class=\"SmallInput\">\r\n </td>\r\n </tr>\r\n\r\n <tr bgcolor=\"#CCCCCC\">\r\n <td align=\"center\" valign=\"top\" colspan=\"4\">\r\n <form action=\"open_submit.php\" method=\"post\" name=\"form1\">\r\n 点击条目时,可以组合CTRL或SHIFT键进行多选<br>\r\n <input type=\"button\" class=\"BigButton\" value=\"保 存\" onclick=\"mysubmit();\"> \r\n <input type=\"hidden\" name=\"ADDRESS_PRIVATE_FIELDS\" value=\"\">\r\n </form>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -