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

📄 new.php

📁 通达OA2007SE源代码 非常好的
💻 PHP
字号:
<?
  include_once 'inc/auth.php';
  include_once 'inc/utility_all.php';
  if ((($PARENT_ID != '') AND ($PARENT_ID != '0')))
  {
    $query = ((''.'SELECT * from VOTE_TITLE where VOTE_ID=').$PARENT_ID);
    $cursor = exequery ($connection, $query);
    if ($ROW = mysql_fetch_array ($cursor))
    {
      $TO_ID = $ROW['TO_ID'];
      $PRIV_ID = $ROW['PRIV_ID'];
      $COPY_TO_ID = $ROW['USER_ID'];
      $TYPE = $ROW['TYPE'];
      $MAX_NUM = $ROW['MAX_NUM'];
      $ANONYMITY = $ROW['ANONYMITY'];
      $VIEW_PRIV = $ROW['VIEW_PRIV'];
      $BEGIN_DATE = $ROW['BEGIN_DATE'];
      $END_DATE = $ROW['END_DATE'];
      if (($BEGIN_DATE == '0000-00-00'))
      {
        $BEGIN_DATE = '';
      }
      if (($END_DATE == '0000-00-00'))
      {
        $END_DATE = '';
      }
      if (($TO_ID == 'ALL_DEPT'))
      {
        $TO_NAME = '全体部门';
      }
      else
      {
        $TO_NAME = '';
        $TOK = strtok ($TO_ID, ',');
        while (($TOK != ''))
        {
          $query1 = ((''.'select DEPT_NAME from DEPARTMENT where DEPT_ID=').$TOK);
          $cursor1 = exequery ($connection, $query1);
          if ($ROW = mysql_fetch_array ($cursor1))
          {
            ($TO_NAME .= ($ROW['DEPT_NAME'].','));
          }
          $TOK = strtok (',');
        }
      }
      $PRIV_NAME = '';
      $query1 = (((''.'select PRIV_NAME from USER_PRIV where find_in_set(USER_PRIV,\'').$PRIV_ID).'\')');
      $cursor1 = exequery ($connection, $query1);
      while ($ROW = mysql_fetch_array ($cursor1))
      {
        ($PRIV_NAME .= ($ROW['PRIV_NAME'].','));
      }
      $COPY_TO_NAME = '';
      $query1 = (((''.'select USER_NAME from USER where find_in_set(USER_ID,\'').$COPY_TO_ID).'\')');
      $cursor1 = exequery ($connection, $query1);
      while ($ROW = mysql_fetch_array ($cursor1))
      {
        ($COPY_TO_NAME .= ($ROW['USER_NAME'].','));
      }
    }
  }
  if (($VOTE_ID != ''))
  {
    $query = ((''.'SELECT * from VOTE_TITLE where VOTE_ID=').$VOTE_ID);
    $cursor = exequery ($connection, $query);
    if ($ROW = mysql_fetch_array ($cursor))
    {
      $TO_ID = $ROW['TO_ID'];
      $PARENT_ID = $ROW['PARENT_ID'];
      $PRIV_ID = $ROW['PRIV_ID'];
      $COPY_TO_ID = $ROW['USER_ID'];
      $SUBJECT = $ROW['SUBJECT'];
      $CONTENT = $ROW['CONTENT'];
      $TYPE = $ROW['TYPE'];
      $MAX_NUM = $ROW['MAX_NUM'];
      $ANONYMITY = $ROW['ANONYMITY'];
      $VIEW_PRIV = $ROW['VIEW_PRIV'];
      $BEGIN_DATE = $ROW['BEGIN_DATE'];
      $END_DATE = $ROW['END_DATE'];
      $PUBLISH = $ROW['PUBLISH'];
      $VOTE_NO = $ROW['VOTE_NO'];
      if (($BEGIN_DATE == '0000-00-00'))
      {
        $BEGIN_DATE = '';
      }
      if (($END_DATE == '0000-00-00'))
      {
        $END_DATE = '';
      }
      if (($TO_ID == 'ALL_DEPT'))
      {
        $TO_NAME = '全体部门';
      }
      else
      {
        $TO_NAME = '';
        $TOK = strtok ($TO_ID, ',');
        while (($TOK != ''))
        {
          $query1 = ((''.'select DEPT_NAME from DEPARTMENT where DEPT_ID=').$TOK);
          $cursor1 = exequery ($connection, $query1);
          if ($ROW = mysql_fetch_array ($cursor1))
          {
            ($TO_NAME .= ($ROW['DEPT_NAME'].','));
          }
          $TOK = strtok (',');
        }
      }
      $PRIV_NAME = '';
      $query1 = (((''.'select PRIV_NAME from USER_PRIV where find_in_set(USER_PRIV,\'').$PRIV_ID).'\')');
      $cursor1 = exequery ($connection, $query1);
      while ($ROW = mysql_fetch_array ($cursor1))
      {
        ($PRIV_NAME .= ($ROW['PRIV_NAME'].','));
      }
      $COPY_TO_NAME = '';
      $query1 = (((''.'select USER_NAME from USER where find_in_set(USER_ID,\'').$COPY_TO_ID).'\')');
      $cursor1 = exequery ($connection, $query1);
      while ($ROW = mysql_fetch_array ($cursor1))
      {
        ($COPY_TO_NAME .= ($ROW['USER_NAME'].','));
      }
    }
  }
  echo '
<html>
<head>
<title>投票管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript Language="JavaScript">
function CheckForm(flag)
{
';
  if ((($PARENT_ID == '') OR ($PARENT_ID == '0')))
  {
    echo '   if(document.form1.TO_ID.value=="" && document.form1.PRIV_ID.value=="" && document.form1.COPY_TO_ID.value=="")
   { alert("请至少指定一种发布范围!");
     return (false);
   }
';
  }
  echo '   if(document.form1.SUBJECT.value=="")
   { alert("投票的标题不能为空!");
     return (false);
   }
   document.form1.PUBLISH.value=flag;
   document.form1.submit();
}
function clear_dept()
{
  document.form1.TO_NAME.value="";
  document.form1.TO_ID.value="";
}
function LoadWindow()
{
  URL="/module/dept_select";
  loc_x=document.body.scrollLeft+event.clientX-event.offs';
  echo 'etX-100;
  loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
  window.showModalDialog(URL,self,"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function td_calendar(fieldname)
{
  myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
  mytop=document.body.scrollTop+event.clientY-';
  echo 'event.offsetY+140;
  window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
function change_type()
{
   if(document.form1.TYPE.value=="1")
      document.getElementById("MAX_NUM_DESC").style.display="";
   else
      document.getElement';
  echo 'ById("MAX_NUM_DESC").style.display="none";
}
function clear_priv()
{
  document.form1.PRIV_ID.value="";
  document.form1.PRIV_NAME.value="";
}
function LoadPrivWindow()
{
  URL="/module/priv_select";
  loc_x=document.body.scrollLeft+event.clientX-event.offsetX;
  loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;
  window.showModalDialog(URL,self,"edge:raised;scroll:1;s';
  echo 'tatus:0;help:0;resizable:1;dialogWidth:250px;dialogHeight:300px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_user2()
{
  document.form1.COPY_TO_NAME.value="";
  document.form1.COPY_TO_ID.value="";
}
function LoadWindow2()
{
  URL="/module/user_select?ID=2";
  loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
  loc_y=document.body.scrollTop+event.cli';
  echo 'entY-event.offsetY+170;
  //window.open(URL,"read_notify","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=150,resizable=yes");
  window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:350px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
</script>
</head>
<body class="bodycolor" topmargin=';
  echo '"5" onload="javascript:form1.SUBJECT.focus();">
';
  if (($MAX_NUM == ''))
  {
    $MAX_NUM = 0;
  }
  echo '<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_new.gif" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> ';
  if (($VOTE_ID != ''))
  {
    echo '修改';
  }
  else
  {
    echo '新建';
  }
  echo '投票</span>
    </td>
  </tr>
</table>
<table border="0" width="70%" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
  <form enctype="multipart/form-data" action="add.php"  method="post" name="form1">
';
  if ((($PARENT_ID == '') OR ($PARENT_ID == '0')))
  {
    echo '    <tr>
      <td nowrap class="TableData">发布范围(部门):</td>
      <td class="TableData">
        <input type="hidden" name="TO_ID" value="';
    echo $TO_ID;
    echo '">
        <textarea cols=40 name="TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
    echo $TO_NAME;
    echo '</textarea>
        &nbsp;<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow()" title="添加部门" name="button">
        &nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_dept()" title="清空部门" name="button">
      </td>
    </tr>
    <tr>
      <td nowrap class="TableData">发布范围(角色):</td>
      <td class="TableData">
        <input type="hi';
    echo 'dden" name="PRIV_ID" value="';
    echo $PRIV_ID;
    echo '">
        <textarea cols=40 name="PRIV_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
    echo $PRIV_NAME;
    echo '</textarea>
        &nbsp;<input type="button" value="选 择" class="SmallButton" onClick="LoadPrivWindow()" title="选择角色" name="button">
        &nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_priv()" title="清空角色" name="button">
      </td>
   </tr>
   <tr>
      <td nowrap class="TableData">发布范围(人员):</td>
      <td class="TableData">
        <input type="';
    echo 'hidden" name="COPY_TO_ID" value="';
    echo $COPY_TO_ID;
    echo '">
        <textarea cols=40 name="COPY_TO_NAME" rows=2 class="BigStatic" wrap="yes" readonly>';
    echo $COPY_TO_NAME;
    echo '</textarea>
        &nbsp;<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择人员" name="button">
        &nbsp;<input type="button" value="清 空" class="SmallButton" onClick="clear_user2()" title="清空人员" name="button">
      </td>
   </tr>
';
  }
  echo '    <tr>
      <td nowrap class="TableData"> 标题:</td>
      <td class="TableData">
        <input type="text" name="SUBJECT" size="40" maxlength="100" class="BigInput" value="';
  echo $SUBJECT;
  echo '">
      </td>
    </tr>
    <tr>
      <td nowrap class="TableData">投票描述:</td>
      <td class="TableData">
        <textarea name="CONTENT" class="BigInput" cols="50" rows="3">';
  echo $CONTENT;
  echo '</textarea>
      </td>
    </tr>
';
  if ($PARENT_ID)
  {
    echo '    <tr>
      <td nowrap class="TableData"> 排序号:</td>
      <td class="TableData">
        <input type="text" name="VOTE_NO" size="10" maxlength="20" class="BigInput" value="';
    echo $VOTE_NO;
    echo '">
      </td>
    </tr>
';
  }
  echo '    <tr>
      <td nowrap class="TableData"> 类型:</td>
      <td class="TableData">
        ';
  echo '<s';
  echo 'elect name="TYPE" class="BigSelect" onchange="change_type();">
          <option value="0" ';
  if (($TYPE == '0'))
  {
    echo 'selected';
  }
  echo '>单选</option>
          <option value="1" ';
  if (($TYPE == '1'))
  {
    echo 'selected';
  }
  echo '>多选</option>
          <option value="2" ';
  if (($TYPE == '2'))
  {
    echo 'selected';
  }
  echo '>文本输入</option>
        </select>
        ';
  echo '<s';
  echo 'pan id="MAX_NUM_DESC" style="display:';
  if (($TYPE != '1'))
  {
    echo 'none';
  }
  echo '">&nbsp;最多允许选择 <input type="input" name="MAX_NUM" value="';
  echo $MAX_NUM;
  echo '" size="4" class="SmallInput"> 项,为0则不限制</span>
      </td>
    </tr>
';
  if ((($PARENT_ID == '') OR ($PARENT_ID == '0')))
  {
    echo '    <tr>
      <td nowrap class="TableData"> 查看投票结果:</td>
      <td class="TableData">
        ';
    echo '<s';
    echo 'elect name="VIEW_PRIV" class="BigSelect">
          <option value="0" ';
    if (($VIEW_PRIV == '0'))
    {
      echo 'selected';
    }
    echo '>投票后允许查看</option>
          <option value="1" ';
    if (($VIEW_PRIV == '1'))
    {
      echo 'selected';
    }
    echo '>投票前允许查看</option>
          <option value="2" ';
    if (($VIEW_PRIV == '2'))
    {
      echo 'selected';
    }
    echo '>不允许查看</option>
        </select>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableData"> 匿名投票:</td>
      <td class="TableData">
        <input type="checkbox" name="ANONYMITY" id="ANONYMITY" ';
    if (($ANONYMITY == '1'))
    {
      echo 'checked';
    }
    echo '><label for="ANONYMITY">允许匿名投票</label>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableData"> 有效期:</td>
      <td class="TableData">
        生效日期:<input type="text" name="BEGIN_DATE" size="10" maxlength="10" class="BigInput" value="';
    echo $BEGIN_DATE;
    echo '">
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.BEGIN_DATE\');">
        为空为立即生效<br>
        终止日期:<input type="text" name="END_DATE" size="10" maxlength="10" class="BigInput" value="';
    echo $END_DATE;
    echo '">
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.END_DATE\');">
        为空为手动终止
      </td>
    </tr>
    <tr>
      <td nowrap class="TableData"> 短消息提醒:</td>
      <td class="TableData">
';
    echo sms_remind (11);
    echo '      </td>
    </tr>
';
  }
  echo '    <tr align="center" class="TableControl">
      <td colspan="2" nowrap>
        <input type="hidden" name="VOTE_ID" value="';
  echo $VOTE_ID;
  echo '">
        <input type="hidden" name="start" value="';
  echo $start;
  echo '">
        <input type="hidden" name="PARENT_ID" value="';
  echo $PARENT_ID;
  echo '">
        <input type="hidden" name="PUBLISH" value="';
  echo $PUBLISH;
  echo '">
';
  if ((($VOTE_ID != '') AND (($PARENT_ID == '') OR ($PARENT_ID == '0'))))
  {
    echo '        <input type="button" value="发布" class="BigButton" onclick="CheckForm(\'1\');">&nbsp;&nbsp;
';
  }
  echo '        <input type="button" value="保存" class="BigButton" onclick="CheckForm(\'0\');">&nbsp;&nbsp;
        <input type="reset" value="重填" class="BigButton">&nbsp;&nbsp;
';
  if ((($VOTE_ID != '') AND (($PARENT_ID == '') OR ($PARENT_ID == '0'))))
  {
    echo '        <input type="button" value="返回" class="BigButton" onclick="location=\'index1.php?start=';
    echo $start;
    echo '\'">
';
  }
  if ((($PARENT_ID != '') AND ($PARENT_ID != '0')))
  {
    echo '        <input type="button" value="返回" class="BigButton" onclick="location=\'vote.php?PARENT_ID=';
    echo $PARENT_ID;
    echo '&start=';
    echo $start;
    echo '\'">
';
  }
  echo '      </td>
    </tr>
  </table>
</form>
</body>
</html>';
?>

⌨️ 快捷键说明

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