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

📄 index1.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 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>
function show_reader(VOTE_ID)
{
 URL="show_reader.php?VOTE_ID="+VOTE_ID;
 myleft=(screen.availWidth-500)/2;
 window.open(URL,"read_vote","height=500,width=700,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}

function delete_vote(VOTE_ID,CUR_PAGE)
{
 msg='确认要删除该投票么?';
 if(window.confirm(msg))
 {
  URL="delete.php?VOTE_ID=" + VOTE_ID + "&CUR_PAGE=" + CUR_PAGE;
  window.location=URL;
 }
}


function delete_all()
{
 msg='确认要删除所有投票么?';
 if(window.confirm(msg))
 {
  URL="delete_all.php";
  window.location=URL;
 }
}

</script>

</head>
<body class="bodycolor" topmargin="5">

<?
 $connection=OpenConnection();
 $CUR_TIME=date("Y-m-d H:i:s",time());

 if($LOGIN_USER_PRIV!="1")
    $query = "SELECT count(*) from VOTE_TITLE where FROM_ID='$LOGIN_USER_ID'";
 else
    $query = "SELECT count(*) from VOTE_TITLE";

 $cursor= exequery($connection,$query);
 $VOTE_COUNT=0;
 if($ROW=mysql_fetch_array($cursor))
    $VOTE_COUNT=$ROW[0];

 if($VOTE_COUNT==0)
 {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/menu/vote.gif" align="absmiddle"><span class="big3"> 管理已发布的投票</span><br>
    </td>
  </tr>
</table>
<br>

<?
   Message("","无已发布的投票");
   exit;
 }

 $PER_PAGE=10;
 $PAGES=10;
 $PAGE_COUNT=ceil($VOTE_COUNT/$PER_PAGE);

 if($CUR_PAGE<=0 || $CUR_PAGE=="")
    $CUR_PAGE=1;
 if($CUR_PAGE>$PAGE_COUNT)
    $CUR_PAGE=$PAGE_COUNT;
?>

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/menu/vote.gif" align="absmiddle"><span class="big3"> 管理已发布的投票</span><br>
    </td>
    <td align="right" valign="bottom" class="small1">共<span class="big4">&nbsp;<?=$VOTE_COUNT?></span>&nbsp;条
    </td>
    <td align="right" valign="bottom" class="small1">
       <a class="A1" href="index1.php?CUR_PAGE=1">首页</a>&nbsp;
       <a class="A1" href="index1.php?CUR_PAGE=<?=$PAGE_COUNT?>">末页</a>&nbsp;&nbsp;
<?
if($CUR_PAGE%$PAGES==0)
   $J=$PAGES;
else
   $J=$CUR_PAGE%$PAGES;

if($CUR_PAGE> $PAGES)
{
?>
       <a class="A1" href="index1.php?CUR_PAGE=<?=$CUR_PAGE-$J-$PAGES+1?>">上<?=$PAGES?>页</a>&nbsp;&nbsp;
<?
}

for($I=$CUR_PAGE-$J+1;$I<=$CUR_PAGE-$J+$PAGES;$I++)
{
   if($I>$PAGE_COUNT)
      break;

   if($I==$CUR_PAGE)
   {
?>
       [<?=$I?>]&nbsp;
<?
   }
   else
   {
?>
       [<a class="A1" href="index1.php?CUR_PAGE=<?=$I?>"><?=$I?></a>]&nbsp;
<?
   }
}
?>
      &nbsp;
<?
if($I-1< $PAGE_COUNT)
{
?>
       <a class="A1" href="index1.php?CUR_PAGE=<?=$I?>">下<?=$PAGES?>页</a>&nbsp;&nbsp;
<?
}
if($CUR_PAGE-1>=1)
{
?>
       <a class="A1" href="index1.php?CUR_PAGE=<?=$CUR_PAGE-1?>">上一页</a>&nbsp;
<?
}
else
{
?>
       上一页&nbsp;
<?
}

if($CUR_PAGE+1<= $PAGE_COUNT)
{
?>
       <a class="A1" href="index1.php?CUR_PAGE=<?=$CUR_PAGE+1?>">下一页</a>&nbsp;
<?
}
else
{
?>
       下一页&nbsp;
<?
}
?>
       &nbsp;
    </td>
    </tr>
</table>

<br>
<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">匿名</td>
      <td nowrap align="center">生效日期 <img border=0 src="/images/arrow_down.gif" width="11" height="10"></td>
      <td nowrap align="center">终止日期</td>
      <td nowrap align="center">状态</td>
      <td nowrap align="center">操作</td>
    </tr>

<?
 //============================ 显示已发布公告 =======================================
 $CUR_DATE=date("Y-m-d",time());

 if($LOGIN_USER_PRIV!="1")
    $query = "SELECT * from VOTE_TITLE where FROM_ID='$LOGIN_USER_ID' order by BEGIN_DATE,SEND_TIME desc";
 else
    $query = "SELECT * from VOTE_TITLE order by SEND_TIME desc";

 $cursor= exequery($connection,$query);
 $VOTE_COUNT=0;
 while($ROW=mysql_fetch_array($cursor))
 {
    $VOTE_COUNT++;

    if($VOTE_COUNT<$CUR_PAGE*$PER_PAGE-$PER_PAGE+1)
       continue;
    if($VOTE_COUNT>$CUR_PAGE*$PER_PAGE)
       break;

    $VOTE_ID=$ROW["VOTE_ID"];
    $FROM_ID=$ROW["FROM_ID"];
    $TO_ID=$ROW["TO_ID"];
    $PRIV_ID=$ROW["PRIV_ID"];
    $USER_ID=$ROW["USER_ID"];
    $SUBJECT=$ROW["SUBJECT"];
    $TYPE=$ROW["TYPE"];
    $ANONYMITY=$ROW["ANONYMITY"];
    $SEND_TIME=$ROW["SEND_TIME"];
    $BEGIN_DATE=$ROW["BEGIN_DATE"];
    $END_DATE=$ROW["END_DATE"];
    $READERS=$ROW["READERS"];

    $SUBJECT=str_replace("<","&lt",$SUBJECT);
    $SUBJECT=str_replace(">","&gt",$SUBJECT);
    $SUBJECT=stripslashes($SUBJECT);

    if($TYPE=="0")
       $TYPE_DESC="单选";
    else
       $TYPE_DESC="多选";
    if($ANONYMITY=="0")
       $ANONYMITY_DESC="不允许";
    else
       $ANONYMITY_DESC="允许";

    if($END_DATE=="0000-00-00")
       $END_DATE="";

    $query1="select * from USER where USER_ID='$FROM_ID'";
    $cursor1= exequery($connection,$query1);
    if($ROW=mysql_fetch_array($cursor1))
    {
       $FROM_NAME=$ROW["USER_NAME"];
       $DEPT_ID=$ROW["DEPT_ID"];
    }

    $DEPT_NAME=dept_long_name($DEPT_ID);

    if($TO_ID=="ALL_DEPT")
       $TO_NAME="全体部门";
    else
    {
      $TO_NAME="";
      $TOK=strtok($TO_ID,",");
      while($TOK!="")
      {
        if($TO_NAME!="")
           $TO_NAME.=",";
        $query1="select * 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 * 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"].",";

    $USER_NAME="";
    $query1="select * from USER where find_in_set(USER_ID,'$USER_ID')";
    $cursor1= exequery($connection,$query1);
    while($ROW=mysql_fetch_array($cursor1))
       $USER_NAME.=$ROW["USER_NAME"].",";

    $TO_NAME_STR="";
    if($TO_NAME!="")
    {
       $TO_NAME_TITLE.="部门:".$TO_NAME;
       $TO_NAME_STR.="<font color=#0000FF><b>部门:</b></font>".csubstr(strip_tags($TO_NAME),0,20).(strlen($TO_NAME)>20?"...":"");
    }
    if($PRIV_NAME!="")
    {
       $PRIV_NAME=substr($PRIV_NAME,0,-2);
       if($TO_NAME_TITLE!="")
          $TO_NAME_TITLE.="\n\n";
       $TO_NAME_TITLE.="角色:".$PRIV_NAME;
       $TO_NAME_STR.="<br><font color=#0000FF><b>角色:</b></font>".csubstr(strip_tags($PRIV_NAME),0,20).(strlen($PRIV_NAME)>20?"...":"");
    }
    if($USER_NAME!="")
    {
       $USER_NAME=substr($USER_NAME,0,-2);
       if($TO_NAME_TITLE!="")
          $TO_NAME_TITLE.="\n\n";
       $TO_NAME_TITLE.="人员:".$USER_NAME;
       $TO_NAME_STR.="<br><font color=#0000FF><b>人员:</b></font>".csubstr(strip_tags($USER_NAME),0,20).(strlen($USER_NAME)>20?"...":"");
    }

    if(compare_date($CUR_DATE,$BEGIN_DATE)<0)
    {
       $VOTE_STATUS=1;
       $VOTE_STATUS_STR="待生效";
    }
    else
    {
       $VOTE_STATUS=2;
       $VOTE_STATUS_STR="<font color='#00AA00'><b>生效</font>";
    }


    if($END_DATE!="")
    {
      if(compare_date($CUR_DATE,$END_DATE)>0)
      {
         $VOTE_STATUS=3;
         $VOTE_STATUS_STR="<font color='#FF0000'><b>终止</font>";
      }
    }

    if($VOTE_COUNT%2==1)
       $TableLine="TableLine1";
    else
       $TableLine="TableLine2";
?>
    <tr class="<?=$TableLine?>">
      <td nowrap align="center"><u title="部门:<?=$DEPT_NAME?>" style="cursor:hand"><?=$FROM_NAME?></u></td>
      <td title="<?=$TO_NAME_TITLE?>"><?=$TO_NAME_STR?></td>
      <td>
      <a href="javascript:show_reader('<?=$VOTE_ID?>');" title="点击查看投票情况"><?=$SUBJECT?></a>
      </td>
      <td nowrap align="center"><?=$TYPE_DESC?></td>
      <td nowrap align="center"><?=$ANONYMITY_DESC?></td>
      <td nowrap align="center"><?=$BEGIN_DATE?></td>
      <td nowrap align="center"><?=$END_DATE?></td>
      <td nowrap align="center"><?=$VOTE_STATUS_STR?></td>
      <td nowrap align="center">
      <a href="item?VOTE_ID=<?=$VOTE_ID?>&CUR_PAGE=<?=$CUR_PAGE?>"> 投票项目</a>
      <a href="new.php?VOTE_ID=<?=$VOTE_ID?>&CUR_PAGE=<?=$CUR_PAGE?>"> 修改</a>
      <a href="javascript:delete_vote('<?=$VOTE_ID?>','<?=$CUR_PAGE?>');"> 删除</a>
      <?
      if($VOTE_STATUS==1)
      {
      ?>
      <a href="manage.php?VOTE_ID=<?=$VOTE_ID?>&OPERATION=1&CUR_PAGE=<?=$CUR_PAGE?>"> 立即生效</a>
      <?
      }
      else if($VOTE_STATUS==2)
      {
      ?>
      <a href="manage.php?VOTE_ID=<?=$VOTE_ID?>&OPERATION=2&CUR_PAGE=<?=$CUR_PAGE?>"> 立即终止</a>
      <?
      }
      else if($VOTE_STATUS==3)
      {
      ?>
      <a href="manage.php?VOTE_ID=<?=$VOTE_ID?>&OPERATION=3&CUR_PAGE=<?=$CUR_PAGE?>"> 恢复生效</a>
      <?
      }
      ?>
      </td>
    </tr>
<?
 }
?>

<tr class="TableControl">
<td colspan="9" align="center">
    <input type="button"  value="全部删除" class="SmallButton" onClick="delete_all()" title="删除所有自己发布的公告通知">
</td>
</tr>

</table>
</body>

</html>

⌨️ 快捷键说明

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