📄 history.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
$ITEMS_IN_PAGE=15;
if(!isset($start))
$start=0;
?>
<html>
<head>
<title>已终止的投票</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function open_vote(VOTE_ID)
{
URL="read_vote.php?VOTE_ID="+VOTE_ID;
myleft=(screen.availWidth-780)/2;
window.open(URL,"read_vote","height=500,width=780,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
function view_result(VOTE_ID)
{
URL="show_reader.php?VOTE_ID="+VOTE_ID;
myleft=(screen.availWidth-780)/2;
window.open(URL,"read_vote","height=500,width=780,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
</script>
</head>
<body class="bodycolor" topmargin="5">
<?
$CUR_DATE=date("Y-m-d",time());
$query = "SELECT * from VOTE_TITLE where PUBLISH='1' and PARENT_ID=0 and (TO_ID='ALL_DEPT' or find_in_set('$LOGIN_DEPT_ID',TO_ID)".dept_other_sql("TO_ID")." or find_in_set('$LOGIN_USER_ID',USER_ID) or find_in_set('$LOGIN_USER_PRIV',PRIV_ID)".priv_other_sql("PRIV_ID").") and END_DATE!='' and END_DATE<'$CUR_DATE' order by BEGIN_DATE";
$cursor= exequery($connection,$query);
$VOTE_COUNT=mysql_num_rows($cursor);
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;
}
?>
<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"> <?=$VOTE_COUNT?></span> 条
</td>
<td align="right" valign="bottom" class="small1"><?=page_bar($start,$VOTE_COUNT,$ITEMS_IN_PAGE)?></td>
</tr>
</table>
<table class="TableList" width="100%">
<tr class="TableHeader">
<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>
</tr>
<?
//============================ 显示已终止公告 =======================================
$VOTE_COUNT=0;
$query = "SELECT * from VOTE_TITLE where PUBLISH='1' and PARENT_ID=0 and (TO_ID='ALL_DEPT' or find_in_set('$LOGIN_DEPT_ID',TO_ID)".dept_other_sql("TO_ID")." or find_in_set('$LOGIN_USER_ID',USER_ID) or find_in_set('$LOGIN_USER_PRIV',PRIV_ID)) and END_DATE!='' and END_DATE<'$CUR_DATE' order by BEGIN_DATE limit $start,$ITEMS_IN_PAGE";
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
$VOTE_COUNT++;
$VOTE_ID=$ROW["VOTE_ID"];
$FROM_ID=$ROW["FROM_ID"];
$TO_ID=$ROW["TO_ID"];
$SUBJECT=$ROW["SUBJECT"];
$TYPE=$ROW["TYPE"];
$VIEW_PRIV=$ROW["VIEW_PRIV"];
$ANONYMITY=$ROW["ANONYMITY"];
$SEND_TIME=$ROW["SEND_TIME"];
$BEGIN_DATE=$ROW["BEGIN_DATE"];
$END_DATE=$ROW["END_DATE"];
$READERS=$ROW["READERS"];
$SUBJECT=htmlspecialchars($SUBJECT);
if($ANONYMITY=="0")
$ANONYMITY_DESC="不允许";
else
$ANONYMITY_DESC="允许";
if($END_DATE=="0000-00-00")
$END_DATE="";
$query1="select USER_NAME,DEPT_ID 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($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>
<?
if($VIEW_PRIV!="2" && find_id($READERS,$LOGIN_USER_ID))
{
?>
<a href="javascript:view_result('<?=$VOTE_ID?>');" title="点击查看投票情况"><?=$SUBJECT?></a>
<?
}
else
{
?>
<a href="javascript:open_vote('<?=$VOTE_ID?>');" title="点击查看投票情况"><?=$SUBJECT?></a>
<?
}
?>
</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">
<?
if($VIEW_PRIV!="2")
{
?>
<a href="javascript:<?if($VIEW_PRIV=="0"&&!find_id($READERS,$LOGIN_USER_ID)){?>alert('投票后才能查看投票结果!')<?}else{?>view_result('<?=$VOTE_ID?>')<?}?>;">查看结果</a>
<?
}
?>
</td>
</tr>
<?
}
?>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -