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

📄 index.php

📁 通达OA2007SE源代码 非常好的
💻 PHP
字号:
<?
  include_once 'inc/auth.php';
  include_once 'inc/utility_all.php';
  echo '
<html>
<head>
<title>邮件箱管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript Language="JavaScript">
function CheckForm()
{
   if(document.form1.BOX_NO.value=="")
   { alert("邮箱序号不能为空!");
     return (false);
   }
   if(document.form1.BOX_NAME.value=="")
   { alert("邮箱名称不能为空!");
     return (false);
   }
}
function delete_mis(BOX_ID)
{
 msg=\'删除该邮箱将删除该邮箱下的所有邮件,确认要删除该邮箱么?\';
 if(window.confirm(msg))
 {
  ';
  echo 'URL="delete.php?BOX_ID=" + BOX_ID;
  window.location=URL;
 }
}
function setCookie(name,value) {
   var today = new Date();
   var expires = new Date();
   expires.setTime(today.getTime() + 1000*60*60*24*365);
   parent.document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
}
function checkNum(str)
{
   var re=/\\D/;
   return str.match(re);
}
functio';
  echo 'n SetEmailNums(CookieName, CookieField)
{
   var CookieValue=document.all(CookieField).value;
   if(CookieValue=="")
   {
      alert("请输入数值");
      return false;
   }
   if(checkNum(CookieValue))
   {
      alert("显示封数必须是数字");
      return false;
   }
   if(parseInt(CookieValue)<=0 || parseInt(CookieValue)>=1000)
   {
      alert("显示封数必须在1-1000之间");
      ';
  echo 'return false;
   }
   setCookie(CookieName, CookieValue);
}
</script>
</head>
<body class="bodycolor" topmargin="5" onload="document.form1.BOX_NO.focus();">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_new.gif" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> 添加邮件箱</span>
    </td>
  </tr>
</table>
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center" >
  <form action="add.php"  method="post" name="form1" onsubmit="return CheckForm();">
   <tr>
    <td nowrap class="TableData">序号:</td>
    <td nowrap class="TableData">
        <input type="text" name="BOX_NO" class="BigInp';
  echo 'ut" size="25" maxlength="25">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">名称:</td>
    <td nowrap class="TableData">
        <input type="text" name="BOX_NAME" class="BigInput" size="25" maxlength="25">&nbsp;
    </td>
   </tr>
   <tr>
    <td nowrap  class="TableControl" colspan="2" align="center">
        <input type="submit" value="添加" class="BigButton" title="添加" na';
  echo 'me="button">
    </td>
  </form>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
 <tr>
   <td background="/images/dian1.gif" width="100%"></td>
 </tr>
</table>
<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>
    </td>
  </tr>
</table>
';
  $query = (((''.'SELECT sum(SIZE) from EMAIL,EMAIL_BODY where EMAIL.BODY_ID=EMAIL_BODY.BODY_ID and BOX_ID=0 and TO_ID=\'').$LOGIN_USER_ID).'\' and SEND_FLAG=\'1\' and (DELETE_FLAG=\'\' or DELETE_FLAG=\'0\' or DELETE_FLAG=\'2\')');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $EMAIL_SIZE1 = $ROW[0];
  }
  $query = (((''.'SELECT sum(SIZE) from EMAIL,EMAIL_BODY where EMAIL.BODY_ID=EMAIL_BODY.BODY_ID and FROM_ID=\'').$LOGIN_USER_ID).'\' and SEND_FLAG=\'0\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $EMAIL_SIZE2 = $ROW[0];
  }
  $query = (((''.'SELECT sum(SIZE) from EMAIL,EMAIL_BODY where EMAIL.BODY_ID=EMAIL_BODY.BODY_ID and FROM_ID=\'').$LOGIN_USER_ID).'\' and SEND_FLAG=\'1\' and DELETE_FLAG!=\'2\' and DELETE_FLAG!=\'4\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $EMAIL_SIZE3 = $ROW[0];
  }
  $query = (((''.'SELECT sum(SIZE) from EMAIL,EMAIL_BODY where EMAIL.BODY_ID=EMAIL_BODY.BODY_ID and BOX_ID=0 and TO_ID=\'').$LOGIN_USER_ID).'\' and SEND_FLAG=\'1\' and (DELETE_FLAG=\'3\' or DELETE_FLAG=\'4\')');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $EMAIL_SIZE4 = $ROW[0];
  }
  $EMAIL_SIZE1_M = number_format ((($EMAIL_SIZE1 / 1024) / 1024), 2, '.', ',');
  ($EMAIL_SIZE += $EMAIL_SIZE1);
  $EMAIL_SIZE1 = number_format ($EMAIL_SIZE1, 0, '.', ',');
  $EMAIL_SIZE2_M = number_format ((($EMAIL_SIZE2 / 1024) / 1024), 2, '.', ',');
  ($EMAIL_SIZE += $EMAIL_SIZE2);
  $EMAIL_SIZE2 = number_format ($EMAIL_SIZE2, 0, '.', ',');
  $EMAIL_SIZE3_M = number_format ((($EMAIL_SIZE3 / 1024) / 1024), 2, '.', ',');
  ($EMAIL_SIZE += $EMAIL_SIZE3);
  $EMAIL_SIZE3 = number_format ($EMAIL_SIZE3, 0, '.', ',');
  $EMAIL_SIZE4_M = number_format ((($EMAIL_SIZE4 / 1024) / 1024), 2, '.', ',');
  ($EMAIL_SIZE += $EMAIL_SIZE4);
  $EMAIL_SIZE4 = number_format ($EMAIL_SIZE4, 0, '.', ',');
  echo '<br>
<div align="center">
<table border="0" cellspacing="1" width="90%" class="small" bgcolor="#000000" cellpadding="3">
     <tr class="TableHeader">
      <td nowrap align="center" width="50">编号</td>
      <td nowrap align="center" width="230">名称</td>
      <td nowrap align="center">占用空间</td>
      <td nowrap align="center">每页显示邮件数</td>
      <td nowrap align="center" width="60">操作</t';
  echo 'd>
    </tr>
    <tr class="TableData">
      <td nowrap>
      </td>
      <td nowrap align="center">收件箱</td>
      <td> ';
  echo $EMAIL_SIZE1;
  echo ' 字节 (约合';
  echo $EMAIL_SIZE1_M;
  echo 'M)</td>
      <td nowrap><input type="text" value="';
  echo $_COOKIE[($LOGIN_USER_ID.'_email_ps_in0')];
  echo '" name="PAGESIZE_IN0" class="SmallInput" size="3"> <input type="button" value="设置" class="SmallButton" onclick="SetEmailNums(\'';
  echo $LOGIN_USER_ID;
  echo '_email_ps_in0\',\'PAGESIZE_IN0\');"></td>
      <td nowrap align="center"></td>
    </tr>
    <tr class="TableData">
      <td nowrap></td>
      <td nowrap align="center">发件箱</td>
      <td> ';
  echo $EMAIL_SIZE2;
  echo ' 字节 (约合';
  echo $EMAIL_SIZE2_M;
  echo 'M)</td>
      <td nowrap><input type="text" value="';
  echo $_COOKIE[($LOGIN_USER_ID.'_email_ps_out')];
  echo '" name="PAGESIZE_OUT" class="SmallInput" size="3"> <input type="button" value="设置" class="SmallButton" onclick="SetEmailNums(\'';
  echo $LOGIN_USER_ID;
  echo '_email_ps_out\',\'PAGESIZE_OUT\');"></td>
      <td nowrap align="center"></td>
    </tr>
    <tr class="TableData">
      <td nowrap></td>
      <td nowrap align="center">已发送邮件箱</td>
      <td> ';
  echo $EMAIL_SIZE3;
  echo ' 字节 (约合';
  echo $EMAIL_SIZE3_M;
  echo 'M)</td>
      <td nowrap><input type="text" value="';
  echo $_COOKIE[($LOGIN_USER_ID.'_email_ps_sent')];
  echo '" name="PAGESIZE_SENT" class="SmallInput" size="3"> <input type="button" value="设置" class="SmallButton" onclick="SetEmailNums(\'';
  echo $LOGIN_USER_ID;
  echo '_email_ps_sent\',\'PAGESIZE_SENT\');"></td>
      <td nowrap align="center"></td>
    </tr>
    <tr class="TableData">
      <td nowrap></td>
      <td nowrap align="center">废件箱</td>
      <td> ';
  echo $EMAIL_SIZE4;
  echo ' 字节 (约合';
  echo $EMAIL_SIZE4_M;
  echo 'M)</td>
      <td nowrap><input type="text" value="';
  echo $_COOKIE[($LOGIN_USER_ID.'_email_ps_del')];
  echo '" name="PAGESIZE_DEL" class="SmallInput" size="3"> <input type="button" value="设置" class="SmallButton" onclick="SetEmailNums(\'';
  echo $LOGIN_USER_ID;
  echo '_email_ps_del\',\'PAGESIZE_DEL\');"></td>
      <td nowrap align="center"></td>
    </tr>
';
  $query = (((''.'SELECT * from EMAIL_BOX where USER_ID=\'').$LOGIN_USER_ID).'\' order by BOX_NO');
  $cursor = exequery ($connection, $query);
  while ($ROW = mysql_fetch_array ($cursor))
  {
    $BOX_ID = $ROW['BOX_ID'];
    $BOX_NO = $ROW['BOX_NO'];
    $BOX_NAME = $ROW['BOX_NAME'];
    $EMAIL_SIZE1 = 0;
    $query = (((((''.'SELECT sum(SIZE) from EMAIL,EMAIL_BODY where EMAIL.BODY_ID=EMAIL_BODY.BODY_ID and BOX_ID=').$BOX_ID).' and TO_ID=\'').$LOGIN_USER_ID).'\' and SEND_FLAG=\'1\' and DELETE_FLAG!=\'1\'');
    $cursor1 = exequery ($connection, $query);
    if ($ROW = mysql_fetch_array ($cursor1))
    {
      $EMAIL_SIZE1 = $ROW[0];
    }
    $EMAIL_SIZE1_M = number_format ((($EMAIL_SIZE1 / 1024) / 1024), 2, '.', ',');
    ($EMAIL_SIZE += $EMAIL_SIZE1);
    $EMAIL_SIZE1 = number_format ($EMAIL_SIZE1, 0, '.', ',');
    echo '    <tr class="TableData">
      <td nowrap align="center">';
    echo $BOX_NO;
    echo '</td>
      <td nowrap align="center">';
    echo $BOX_NAME;
    echo '</td>
      <td nowrap> ';
    echo $EMAIL_SIZE1;
    echo ' 字节 (约合';
    echo $EMAIL_SIZE1_M;
    echo 'M)</td>
      <td nowrap><input type="text" value="';
    echo $_COOKIE[(($LOGIN_USER_ID.'_email_ps_in').$BOX_ID)];
    echo '" name="PAGESIZE_IN';
    echo $BOX_ID;
    echo '" class="SmallInput" size="3"> <input type="button" value="设置" class="SmallButton" onclick="SetEmailNums(\'';
    echo $LOGIN_USER_ID;
    echo '_email_ps_in';
    echo $BOX_ID;
    echo '\',\'PAGESIZE_IN';
    echo $BOX_ID;
    echo '\');"></td>
      <td nowrap align="center">
      <a href="edit.php?BOX_ID=';
    echo $BOX_ID;
    echo '"> 编辑</a>
      <a href="javascript:delete_mis(\'';
    echo $BOX_ID;
    echo '\');"> 删除</a>
      </td>
    </tr>
';
  }
  $EMAIL_SIZE_M = number_format ((($EMAIL_SIZE / 1024) / 1024), 2, '.', ',');
  $EMAIL_SIZE = number_format ($EMAIL_SIZE, 0, '.', ',');
  $query = (((''.'SELECT * from USER where USER_ID=\'').$LOGIN_USER_ID).'\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $EMAIL_CAPACITY = $ROW['EMAIL_CAPACITY'];
  }
  if (($EMAIL_CAPACITY != 0))
  {
    $PERCENT = floor ((((($EMAIL_SIZE / 1024) / 1024) / $EMAIL_CAPACITY) * 100));
    if ((100 < $PERCENT))
    {
      $PERCENT = 100;
    }
    if (($PERCENT <= 60))
    {
      $BAR_COLOR = '#00FF40';
    }
    else
    {
      if (($PERCENT <= 80))
      {
        $BAR_COLOR = '#FF6600';
      }
      else
      {
        $BAR_COLOR = '#FF0000';
      }
    }
    $PROGRESS_BAR = (((((((((('<div class="percent" style="width:400px;"><div style="background-color:'.$BAR_COLOR).';width: ').$PERCENT).'%;float:left;"></div></div></div><div class="percenttxt">&nbsp;').$PERCENT).'% (已用').$EMAIL_SIZE_M).'MB,共').$EMAIL_CAPACITY).'MB)</div>');
  }
  echo '    <tr class="TableContent">
      <td nowrap align="center" colspan="2"><b>合计:</b></td>
      <td nowrap colspan="3">';
  if (($EMAIL_CAPACITY != 0))
  {
    echo $PROGRESS_BAR;
  }
  echo '</td>
    </tr>
    <tr class="TableControl">
      <td nowrap align="center" colspan="5">
      <input type="button" class="BigButton" OnClick="location=\'../../\'" value="返回">
      </td>
    </tr>
</table>
</div>
</body>
</html>';
?>

⌨️ 快捷键说明

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