📄 vote.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
echo "\r\n<html>\r\n<head>\r\n<title>投票</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$query = "select READERS from VOTE_TITLE where VOTE_ID='".$VOTE_ID."' and PUBLISH='1' 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" ).")";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$READERS = $ROW['READERS'];
}
else
{
exit( );
}
if ( !find_id( $READERS, $LOGIN_USER_ID ) )
{
$READERS .= $LOGIN_USER_ID.",";
$query = "update VOTE_TITLE set READERS='".$READERS."' where VOTE_ID='{$VOTE_ID}'";
exequery( $connection, $query );
}
else
{
message( "错误", "您已经进行过投票" );
button_back( );
exit( );
}
$TOK = strtok( $ITEM_ID, "," );
while ( $TOK != "" )
{
$query = "select VOTE_USER from VOTE_ITEM where ITEM_ID='".$TOK."'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$VOTE_USER = $ROW['VOTE_USER'];
}
if ( $ANONYMITY == "1" || find_id( $VOTE_USER, $LOGIN_USER_ID ) )
{
$query = "update VOTE_ITEM set VOTE_COUNT=VOTE_COUNT+1 where ITEM_ID='".$TOK."'";
}
else
{
$query = "update VOTE_ITEM set VOTE_COUNT=VOTE_COUNT+1,VOTE_USER='".$VOTE_USER.$LOGIN_USER_ID.( ",' where ITEM_ID='".$TOK."'" );
}
exequery( $connection, $query );
$TOK = strtok( "," );
}
while ( list( $key, $value ) = each( &$GLOBALS['_POST'] ) )
{
$ARRAY = explode( "_", substr( $key, 10 ) );
if ( !( substr( $key, 0, 10 ) != "VOTE_DATA_" ) )
{
if ( find_id( $ITEM_ID, $ARRAY[0] ) || $ARRAY[1] != 0 )
{
break;
}
}
else
{
continue;
}
$query = "insert into VOTE_DATA (USER_ID, ITEM_ID, FIELD_NAME, FIELD_DATA) values('".$LOGIN_USER_ID."', '{$ARRAY['0']}', '{$ARRAY['1']}', '{$value}')";
exequery( $connection, $query );
}
message( "", "投票完成" );
echo "\r\n<center><input type=\"button\" class=\"BigButton\" value=\"返回\" onclick=\"location='read_vote.php?VOTE_ID=";
echo $VOTE_ID;
echo "';\"></center>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -