📄 show_reader.php
字号:
<?
function parseitemname ($ITEM_NAME, $ITEM_ID, $COUNT = 1)
{
global $VOTE_ID;
$POS = strpos ($ITEM_NAME, '{');
if (($POS === false))
{
return $ITEM_NAME;
}
if ((substr ($ITEM_NAME, $POS, 6) == '{text}'))
{
return ((((((((substr ($ITEM_NAME, 0, $POS).'<a href="javascript:vote_data(').$VOTE_ID).',\'INPUT_ITEM_').$ITEM_ID).'_').$COUNT++).'\')" style="text-decoration: underline;">???</a>').parseitemname (substr ($ITEM_NAME, ($POS + 6)), $ITEM_ID, $COUNT));
}
if ((substr ($ITEM_NAME, $POS, 8) == '{number}'))
{
return ((((((((substr ($ITEM_NAME, 0, $POS).'<a href="javascript:vote_data(').$VOTE_ID).',\'INPUT_ITEM_').$ITEM_ID).'_').$COUNT++).'\')" style="text-decoration: underline;">???</a>').parseitemname (substr ($ITEM_NAME, ($POS + 8)), $ITEM_ID, $COUNT));
}
if ((substr ($ITEM_NAME, $POS, 10) == '{textarea}'))
{
return ((((((((substr ($ITEM_NAME, 0, $POS).'<a href="javascript:vote_data(').$VOTE_ID).',\'INPUT_ITEM_').$ITEM_ID).'_').$COUNT++).'\')" style="text-decoration: underline;">???</a>').parseitemname (substr ($ITEM_NAME, ($POS + 10)), $ITEM_ID, $COUNT));
}
return (substr ($ITEM_NAME, 0, ($POS + 1)).parseitemname (substr ($ITEM_NAME, ($POS + 1)), $ITEM_ID));
}
include_once 'inc/auth.php';
echo '
<html>
<head>
<title>投票结果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
';
echo '<s';
echo 'cript>
function vote_data(vote_id, item_pos)
{
URL="vote_data.php?VOTE_ID="+vote_id+"#"+item_pos;
myleft=(screen.availWidth-300)/2;
window.open(URL,"vote_data","height=300,width=500,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=250,left="+myleft+",resizable=yes");
}
</script>
<body class="bodycolor" topmargin="5">
';
$query = ((''.'SELECT * from VOTE_TITLE where VOTE_ID=').$VOTE_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$SUBJECT = $ROW['SUBJECT'];
$TO_ID = $ROW['TO_ID'];
$ANONYMITY = $ROW['ANONYMITY'];
$READERS = $ROW['READERS'];
$CONTENT = $ROW['CONTENT'];
$CONTENT = htmlspecialchars ($CONTENT);
$CONTENT = nl2br ($CONTENT);
}
echo '<table border="0" width="100%" cellspacing="0" cellpadding="3" align="center" class="small">
<tr>
<td class="Big"><img src="/images/menu/vote.gif" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 投票结果 - ';
echo $SUBJECT;
echo '</span><br>
</td>
</tr>
<tr>
<td class="small1">';
echo $CONTENT;
echo '</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="3" cellspacing="1" align="center" bgcolor="#000000" class="small">
';
$query = ((''.'SELECT count(*) from VOTE_ITEM where VOTE_ID=').$VOTE_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$ITEM_COUNT = $ROW[0];
}
if ((0 < $ITEM_COUNT))
{
$query = ((''.'SELECT * from VOTE_TITLE where VOTE_ID=').$VOTE_ID);
$cursor2 = exequery ($connection, $query);
$ITEM_COUNT = 0;
while ($ROW2 = mysql_fetch_array ($cursor2))
{
++$ITEM_COUNT;
$VOTE_ID = $ROW2['VOTE_ID'];
$TYPE = $ROW2['TYPE'];
$SUBJECT = (($ITEM_COUNT.'、').$ROW2['SUBJECT']);
echo ' <tr class="TableHeader">
<td colspan="3">';
echo $SUBJECT;
echo '</td>
</tr>
';
if ((($TYPE == 0) OR ($TYPE == 1)))
{
$query = ((''.'SELECT sum(VOTE_COUNT),max(VOTE_COUNT) from VOTE_ITEM where VOTE_ID=').$VOTE_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$SUM_COUNT = $ROW[0];
$MAX_COUNT = $ROW[1];
}
if ((($SUM_COUNT == 0) OR ($SUM_COUNT == '')))
{
$SUM_COUNT = 1;
}
if ((($MAX_COUNT == 0) OR ($MAX_COUNT == '')))
{
$MAX_COUNT = 1;
}
$query = (((''.'SELECT * from VOTE_ITEM where VOTE_ID=').$VOTE_ID).' order by ITEM_ID');
$cursor = exequery ($connection, $query);
$NO = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
$ITEM_ID = $ROW['ITEM_ID'];
if ((26 < $NO))
{
$ITEM_NAME = (((chr ((($NO % 26) + 65)).floor (($NO / 26))).'、').$ROW['ITEM_NAME']);
}
else
{
$ITEM_NAME = ((chr ((($NO % 26) + 65)).'、').$ROW['ITEM_NAME']);
}
$VOTE_COUNT = $ROW['VOTE_COUNT'];
$ITEM_NAME = parseitemname ($ITEM_NAME, $ITEM_ID);
++$NO;
echo ' <tr class="TableData">
<td> ';
echo $ITEM_NAME;
echo '</td>
<td width="240">
<table height="10" border="0" cellspacing="0" cellpadding="0" class="small">
<tr height="10">
<td width="10" background="/images/vote_bg.gif"></td>
<td width="';
echo (($VOTE_COUNT * 200) / $MAX_COUNT);
echo '" background="/images/vote_bg.gif"></td>
<td width="30">';
echo round ((($VOTE_COUNT * 100) / $SUM_COUNT));
echo '%</td>
</tr>
</table>
</td>
<td align="right">';
echo $VOTE_COUNT;
echo '票</td>
</tr>
';
}
continue;
}
echo ' <tr class="TableData">
<td colspan="4">
';
$query = (((''.'SELECT * from VOTE_DATA where ITEM_ID=\'').$VOTE_ID).'\' and FIELD_NAME=\'0\'');
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
$USER_ID = $ROW['USER_ID'];
$FIELD_DATA = $ROW['FIELD_DATA'];
$FIELD_DATA = htmlspecialchars ($FIELD_DATA);
$FIELD_DATA = nl2br ($FIELD_DATA);
echo (('<li>'.$FIELD_DATA).'</li><br>');
}
echo ' </td>
</tr>
';
}
}
$query = (((''.'SELECT * from VOTE_TITLE where PARENT_ID=').$VOTE_ID).' order by VOTE_NO,SEND_TIME');
$cursor2 = exequery ($connection, $query);
while ($ROW2 = mysql_fetch_array ($cursor2))
{
++$ITEM_COUNT;
$VOTE_ID = $ROW2['VOTE_ID'];
$TYPE = $ROW2['TYPE'];
$SUBJECT = (($ITEM_COUNT.'、').$ROW2['SUBJECT']);
echo ' <tr class="TableHeader">
<td colspan="3">';
echo $SUBJECT;
echo '</td>
</tr>
';
if ((($TYPE == 0) OR ($TYPE == 1)))
{
$query = ((''.'SELECT sum(VOTE_COUNT),max(VOTE_COUNT) from VOTE_ITEM where VOTE_ID=').$VOTE_ID);
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$SUM_COUNT = $ROW[0];
$MAX_COUNT = $ROW[1];
}
if ((($SUM_COUNT == 0) OR ($SUM_COUNT == '')))
{
$SUM_COUNT = 1;
}
if ((($MAX_COUNT == 0) OR ($MAX_COUNT == '')))
{
$MAX_COUNT = 1;
}
$query = (((''.'SELECT * from VOTE_ITEM where VOTE_ID=').$VOTE_ID).' order by ITEM_ID');
$cursor = exequery ($connection, $query);
$NO = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
$ITEM_ID = $ROW['ITEM_ID'];
if ((26 < $NO))
{
$ITEM_NAME = (((chr ((($NO % 26) + 65)).floor (($NO / 26))).'、').$ROW['ITEM_NAME']);
}
else
{
$ITEM_NAME = ((chr ((($NO % 26) + 65)).'、').$ROW['ITEM_NAME']);
}
$VOTE_COUNT = $ROW['VOTE_COUNT'];
$ITEM_NAME = parseitemname ($ITEM_NAME, $ITEM_ID);
++$NO;
echo ' <tr class="TableData">
<td> ';
echo $ITEM_NAME;
echo '</td>
<td width="240">
<table height="10" border="0" cellspacing="0" cellpadding="0" class="small">
<tr height="10">
<td width="10" background="/images/vote_bg.gif"></td>
<td width="';
echo (($VOTE_COUNT * 200) / $MAX_COUNT);
echo '" background="/images/vote_bg.gif"></td>
<td width="30">';
echo round ((($VOTE_COUNT * 100) / $SUM_COUNT));
echo '%</td>
</tr>
</table>
</td>
<td align="right">';
echo $VOTE_COUNT;
echo '票</td>
</tr>
';
}
continue;
}
echo ' <tr class="TableData">
<td colspan="4">
';
$query = (((''.'SELECT * from VOTE_DATA where ITEM_ID=\'').$VOTE_ID).'\' and FIELD_NAME=\'0\'');
$cursor = exequery ($connection, $query);
while ($ROW = mysql_fetch_array ($cursor))
{
$USER_ID = $ROW['USER_ID'];
$FIELD_DATA = $ROW['FIELD_DATA'];
$FIELD_DATA = htmlspecialchars ($FIELD_DATA);
$FIELD_DATA = nl2br ($FIELD_DATA);
echo (('<li>'.$FIELD_DATA).'</li><br>');
}
echo ' </td>
</tr>
';
}
echo '
</table>
<div align="center">
<br>
<input type="button" value="打印" class="BigButton" onclick="document.execCommand(\'Print\');" title="打印文件内容">
<input type="button" value="关闭" class="BigButton" onClick="window.close();">
</div>
</body>
</html>';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -