⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 open.php

📁 通达OA官方提供的30源代码,感觉很实在
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>设置公开信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">

function func_find(select_obj,option_text)
{
 pos=option_text.indexOf("] ")+1;
 option_text=option_text.substr(0,pos);

 for (j=0; j<select_obj.options.length; j++)
 {
   str=select_obj.options(j).text;
   if(str.indexOf(option_text)>=0)
      return j;
 }//for

 return j;
}
function func_insert()
{
 for (i=document.form1.select2.options.length-1; i>=0; i--)
 {
   if(document.form1.select2.options(i).selected)
   {
     option_text=document.form1.select2.options(i).text;
     option_value=document.form1.select2.options(i).value;
     option_style_color=document.form1.select2.options(i).style.color;

     var my_option = document.createElement("OPTION");
     my_option.text=option_text;
     my_option.value=option_value;
     my_option.style.color=option_style_color;

     //pos=func_find(select1,option_text);
     document.form1.select1.add(my_option);
     document.form1.select2.remove(i);
  }
 }//for
}
function func_delete()
{
 for (i=document.form1.select1.options.length-1; i>=0; i--)
 {
   if(document.form1.select1.options(i).selected)
   {
     option_text=document.form1.select1.options(i).text;
     option_value=document.form1.select1.options(i).value;

     var my_option = document.createElement("OPTION");
     my_option.text=option_text;
     my_option.value=option_value;

     //pos=func_find(select2,option_text);
     document.form1.select2.add(my_option);
     document.form1.select1.remove(i);
  }
 }//for
}

function func_select_all1()
{
 for (i=document.form1.select1.options.length-1; i>=0; i--)
   document.form1.select1.options(i).selected=true;
}
function func_select_all2()
{
 for (i=document.form1.select2.options.length-1; i>=0; i--)
   document.form1.select2.options(i).selected=true;
}
function exreport()
{
	 fld_str="";
	 fld_str1="";
    for (i=0; i< document.form1.select1.options.length; i++)
    {
     options_value=document.form1.select1.options(i).value;
     options_text=document.form1.select1.options(i).text;
     fld_str+=options_value+",";
     fld_str1+=options_text+",";
    }

  document.form1.FIELDMSG.value=fld_str;
  document.form1.FIELDMSGNAME.value=fld_str1;
  document.form1.submit();
}
function func_up()
{
  sel_count=0;
  for (i=document.form1.select1.options.length-1; i>=0; i--)
  {
    if(document.form1.select1.options(i).selected)
       sel_count++;
  }

  if(sel_count==0)
  {
     alert("调整顺序时,请选择其中一项!");
     return;
  }
  else if(sel_count>1)
  {
     alert("调整顺序时,只能选择其中一项!");
     return;
  }

  i=document.form1.select1.selectedIndex;

  if(i!=0)
  {
    var my_option = document.createElement("OPTION");
    my_option.text=document.form1.select1.options(i).text;
    my_option.value=document.form1.select1.options(i).value;

    document.form1.select1.add(my_option,i-1);
    document.form1.select1.remove(i+1);
    document.form1.select1.options(i-1).selected=true;
  }
}
function func_down()
{
  sel_count=0;
  for (i=document.form1.select1.options.length-1; i>=0; i--)
  {
    if(document.form1.select1.options(i).selected)
       sel_count++;
  }

  if(sel_count==0)
  {
     alert("调整顺序时,请选择其中一项!");
     return;
  }
  else if(sel_count>1)
  {
     alert("调整顺序时,只能选择其中一项!");
     return;
  }

  i=document.form1.select1.selectedIndex;

  if(i!=document.form1.select1.options.length-1)
  {
    var my_option = document.createElement("OPTION");
    my_option.text=document.form1.select1.options(i).text;
    my_option.value=document.form1.select1.options(i).value;

    document.form1.select1.add(my_option,i+2);
    document.form1.select1.remove(i);
    document.form1.select1.options(i+1).selected=true;
  }
}
</script>
</head>
<body class="bodycolor" topmargin="5" onLoad="">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/send.gif" width="18" HEIGHT="18"><span class="big3"> 设置公开信息</span>
    	<span class="small1"> 注意:字段设置为公开后,在查看在线人员列表时,点击姓名即可看到,请谨慎设置</span>
    </td>
  </tr>
</table>
<?
$ALL_FIELD=array(array("SEX","性别"),array("NO","编号"),array("CARD_NO","身份证号码"),array("MARRY","婚姻状况"),
array("NATION","民族"),array("NATIVE_PLACE","籍贯"),array("HR_BIRTHDAY","出生日期"),array("HUKOU_PLACE","户口所在地"),array("WORK_DATE","参加工作时间"),
array("JOIN_DATE","加入本单位时间"),array("EDUCATION","学历"),array("SPECIALITY","专业"),array("SCHOOL","毕业院校"),array("POLITICS","政治面貌"),
array("POST","职务"),array("TECH_POST","职称"),array("CONTRACTTYPE","员工类型"),array("HOME_ADDR","家庭住址"),array("HOME_TEL","家庭电话"),
array("EMAIL","电子邮件"),array("CERTIFICATE","职务情况"),array("REWARD","奖惩记录"),array("TRAIN","培训记录"),array("EDU","教育背景"),
array("WORK","工作简历"),array("SOCIATY","社会关系"),array("POST_CHANGE","岗位变动情况"),array("SURETY","担保记录"),array("CONTRACT","劳动合同签订情况"),
array("INSURE","社保缴纳情况"),array("BODY_EXAMIM","体检记录"),array("RESUME","备 注"));

$query = "select * from FIELDSETTING where TABLENAME='HRMS' ORDER BY ORDERNO ASC ";
$cursor1=exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor1))
{
 $temparray=array($ROW["FIELDNO"],$ROW["FIELDNAME"]);
 array_push ($ALL_FIELD,$temparray);
}


$query = "SELECT * from SYS_PARA where PARA_NAME='HRMS_OPEN_FIELDS'";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
   $HRMS_OPEN_FIELDS=$ROW["PARA_VALUE"];

$OPEN_ARRAY=explode("|",$HRMS_OPEN_FIELDS);
$FIELD_ARRAY=explode(",",$OPEN_ARRAY[0]);
$NAME_ARRAY=explode(",",$OPEN_ARRAY[1]);
?>
<form action="open_submit.php" method="post" name="form1">
  	<table width="200" align="center" border="1" cellspacing="0" cellpadding="3"  bordercolorlight="#000000" bordercolordark="#FFFFFF" class="TableBlock">
      <tr bgcolor="#CCCCCC">
     <td align="center">排序</td>
    <td align="center"><b>公开字段</b></td>
    <td align="center">&nbsp;</td>
    <td align="center" valign="top"><b>可选字段</b></td>
  </tr>
  <tr>
  	<td align="center" bgcolor="#999999">
      <input type="button" class="SmallInput" value=" ↑ " onClick="func_up();">
      <br><br>
      <input type="button" class="SmallInput" value=" ↓ " onClick="func_down();">
    </td>
    <td valign="top" align="center" bgcolor="#CCCCCC">
    <select  name="select1" ondblclick="func_delete();" MULTIPLE style="width:200;height:320">
<?
for($I=0;$I<count($FIELD_ARRAY);$I++)
{
   if($FIELD_ARRAY[$I]=="" || $NAME_ARRAY[$I]=="")
      continue;
   echo "<option value=\"".$FIELD_ARRAY[$I]."\">".$NAME_ARRAY[$I]."</option>";
}
?>
    </select>
    <input type="button" value=" 全 选 " onClick="func_select_all1();" class="SmallInput">
    </td>
    <td align="center" bgcolor="#999999">
      <input type="button" class="SmallInput" value=" ← " onClick="func_insert();">
      <br><br>
      <input type="button" class="SmallInput" value=" → " onClick="func_delete();">
    </td>
    <td align="center" valign="top" bgcolor="#CCCCCC">
    <select  name="select2" ondblclick="func_insert();" MULTIPLE style="width:200;height:320">
<?
for($I=0;$I<count($ALL_FIELD);$I++)
{
   if($ALL_FIELD[$I][0]=="" || $ALL_FIELD[$I][1]=="" || in_array($ALL_FIELD[$I][0],$FIELD_ARRAY))
      continue;

   echo "<option value=\"".$ALL_FIELD[$I][0]."\">".$ALL_FIELD[$I][1]."</option>";
}
?>
    </select>
    <input type="button" value=" 全 选 " onClick="func_select_all2();" class="SmallInput">
    </td>
  </tr>
    <tfoot align="center" class="TableFooter">
      <td nowrap colspan="4" align="center">
        <input type="button" value="确定" class="BigButton" onClick="exreport()">&nbsp;&nbsp;
        <input type="reset" value="返回" class="BigButton" onClick="history.back();">
        <input type="hidden" name="FIELDMSG">
        <input type="hidden" name="FIELDMSGNAME">
      </td>
    </tfoot>
    </table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -