index1.php

来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 624 行 · 第 1/2 页

PHP
624
字号
<?
  include_once 'inc/auth.php';
  include_once 'inc/utility_all.php';
  if (!isset ($TYPE))
  {
    $TYPE = '0';
  }
  $ITEMS_IN_PAGE = 10;
  if ((!isset ($start) OR ($start == '')))
  {
    $start = 0;
  }
  echo '
<html>
<head>
<title>公告通知</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript>
function open_notify(NOTIFY_ID,FORMAT)
{
 URL="../show/read_notify.php?NOTIFY_ID="+NOTIFY_ID;
 myleft=(screen.availWidth-650)/2;
 mytop=100
 mywidth=650;
 myheight=500;
 if(FORMAT=="1")
 {
    myleft=0;
    mytop=0
    mywidth=screen.availWidth-10;
    myheight=screen.availHeight-40;
 }
 window.open(URL,"read_news","height="+myheight+",width="+mywidth+",status=1,toolbar=no,me';
  echo 'nubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
}
function show_reader()
{
  count=0;
  for(i=0;i<document.all("email_select").length;i++)
  {
      el=document.all("email_select").item(i);
      if(el.checked)
      {  email_id=el.value;
         count++;
      }
  }
  if(i==0)
  {
      el=document.all("email_select");
      if(el.checked)
 ';
  echo '     {  email_id=el.value;
         count++;
      }
  }
  if(count>1)
  {
     alert("只能选择一条。");
     return;
  }
  if(count==0)
  {
     alert("请至少选择其中一条");
     return;
  }
  URL="show_reader.php?NOTIFY_ID="+email_id;
  myleft=(screen.availWidth-500)/2;
  window.open(URL,"read_notify","height=500,width=700,status=0,toolbar=no,menubar=no,location=no,scro';
  echo 'llbars=yes,top=150,left="+myleft+",resizable=yes");
}
function delete_all()
{
 msg=\'确认要删除所有公告通知么?\';
 if(window.confirm(msg))
 {
  URL="delete_all.php";
  window.location=URL;
 }
}
function order_by(field,asc_desc)
{
 window.location="index1.php?start=';
  echo $start;
  echo '&TYPE=';
  echo $TYPE;
  echo '&FIELD="+field+"&ASC_DESC="+asc_desc;
}
function change_type(type)
{
 window.location="index1.php?start=';
  echo $start;
  echo '&TYPE="+type+"&FIELD=';
  echo $FIELD;
  echo '&ASC_DESC=';
  echo $ASC_DESC;
  echo '";
}
function check_all()
{
 for (i=0;i<document.all("email_select").length;i++)
 {
   if(document.all("allbox").checked)
      document.all("email_select").item(i).checked=true;
   else
      document.all("email_select").item(i).checked=false;
 }
 if(i==0)
 {
   if(document.all("allbox").checked)
      document.all("email_select").checked=true;
   else
      document.all("email_s';
  echo 'elect").checked=false;
 }
}
function check_one(el)
{
   if(!el.checked)
      document.all("allbox").checked=false;
}
function delete_mail()
{
  delete_str="";
  for(i=0;i<document.all("email_select").length;i++)
  {
      el=document.all("email_select").item(i);
      if(el.checked)
      {  val=el.value;
         delete_str+=val + ",";
      }
  }
  if(i==0)
  {
      e';
  echo 'l=document.all("email_select");
      if(el.checked)
      {  val=el.value;
         delete_str+=val + ",";
      }
  }
  if(delete_str=="")
  {
     alert("要删除公告通知,请至少选择其中一条。");
     return;
  }
  msg=\'确认要删除所选公告通知么?\';
  if(window.confirm(msg))
  {
    url="delete.php?DELETE_STR="+ delete_str +"&start=';
  echo $start;
  echo '";
    location=url;
  }
}
</script>
</head>
<body class="bodycolor" topmargin="5">
';
  $CUR_TIME = date ('Y-m-d H:i:s', time ());
  if (($LOGIN_USER_PRIV != '1'))
  {
    $query = (((''.'SELECT count(*) from NOTIFY where FROM_ID=\'').$LOGIN_USER_ID).'\'');
  }
  else
  {
    $query = 'SELECT count(*) from NOTIFY where 1=1';
  }
  if (($TYPE != '0'))
  {
    ($query .= (((''.' and TYPE_ID=\'').$TYPE).'\''));
  }
  $cursor = exequery ($connection, $query);
  $NOTIFY_COUNT = 0;
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $NOTIFY_COUNT = $ROW[0];
  }
  if (($NOTIFY_COUNT == 0))
  {
    echo '<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_open.gif" align="absmiddle">';
    echo '<s';
    echo 'pan class="big3"> 管理公告通知</span>&nbsp;
       ';
    echo '<s';
    echo 'elect name="TYPE" class="BigSelect" onchange="change_type(this.value);">
          <option value="0"';
    if (($TYPE == '0'))
    {
      echo ' selected';
    }
    echo '>所有类型</option>
          ';
    echo code_list ('NOTIFY', $TYPE);
    echo '          <option value=""';
    if (($TYPE == ''))
    {
      echo ' selected';
    }
    echo '>无类型</option>
       </select>
    </td>
  </tr>
</table>
';
    message ('', '无已发布的公告通知');
    exit ();
  }
  echo '
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_open.gif" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> 管理公告通知</span>&nbsp;
       ';
  echo '<s';
  echo 'elect name="TYPE" class="BigSelect" onchange="change_type(this.value);">
          <option value="0"';
  if (($TYPE == '0'))
  {
    echo ' selected';
  }
  echo '>所有类型</option>
          ';
  echo code_list ('NOTIFY', $TYPE);
  echo '          <option value=""';
  if (($TYPE == ''))
  {
    echo ' selected';
  }
  echo '>无类型</option>
       </select>
    </td>
    <td align="right" valign="bottom" class="small1">';
  echo page_bar ($start, $NOTIFY_COUNT, $ITEMS_IN_PAGE);
  echo '</td>
  </tr>
</table>
';
  if (($ASC_DESC == ''))
  {
    $ASC_DESC = '1';
  }
  if (($LOGIN_USER_PRIV != '1'))
  {
    $query = (((''.'SELECT NOTIFY_ID,FROM_ID,TO_ID,SUBJECT,FORMAT,TOP,PRIV_ID,USER_ID,TYPE_ID,PUBLISH,SEND_TIME,BEGIN_DATE,END_DATE from NOTIFY where FROM_ID=\'').$LOGIN_USER_ID).'\'');
  }
  else
  {
    $query = 'SELECT NOTIFY_ID,FROM_ID,TO_ID,SUBJECT,FORMAT,TOP,PRIV_ID,USER_ID,TYPE_ID,PUBLISH,SEND_TIME,BEGIN_DATE,END_DATE from NOTIFY where 1=1';
  }
  if (($TYPE != '0'))
  {
    ($query .= (((''.' and TYPE_ID=\'').$TYPE).'\''));
  }
  if (($FIELD == ''))
  {
    ($query .= ' order by TOP desc,SEND_TIME desc');
  }
  else
  {
    ($query .= (' order by '.$FIELD));
    if (($ASC_DESC == '1'))
    {
      ($query .= ' desc');
    }
    else
    {
      ($query .= ' asc');
    }
  }
  ($query .= ((((''.' limit ').$start).',').$ITEMS_IN_PAGE));
  if (($ASC_DESC == '0'))
  {
    $ORDER_IMG = '<img border=0 src="/images/arrow_up.gif" width="11" height="10">';
  }
  else
  {
    $ORDER_IMG = '<img border=0 src="/images/arrow_down.gif" width="11" height="10">';
  }
  echo '<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3">
  <tr class="TableHeader">
      <td nowrap align="center">选择</td>
      <td nowrap align="center">发布人</td>
      <td nowrap align="center">类型</td>
      <td nowrap align="center">发布范围</td>
      <td nowrap align="center" onclick="order_by(\'SUBJECT\',\'';
  if (($FIELD == 'SUBJECT'))
  {
    echo (1 - $ASC_DESC);
  }
  else
  {
    echo '1';
  }
  echo '\');" style="cursor:hand;"><u>标题</u>';
  if (($FIELD == 'SUBJECT'))
  {
    echo $ORDER_IMG;
  }
  echo '</td>
      <td nowrap align="center" onclick="order_by(\'SEND_TIME\',\'';
  if ((($FIELD == 'SEND_TIME') OR ($FIELD == '')))
  {
    echo (1 - $ASC_DESC);
  }
  else
  {
    echo '1';

⌨️ 快捷键说明

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