📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
echo "<html>\r\n<head>\r\n<title>投票项目</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n<script>\r\nfunction delete_item(ITEM_ID, VOTE_ID)\r\n{\r\n if (window.confirm(\"您真的要删除该条选项吗?\\n\\n注意:该操作不可恢复!\"))\r\n window.location=\"delete.php?ITEM_ID=\"+ITEM_ID+\"&VOTE_ID=\"+VOTE_ID;\r\n}\r\n</script>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$query = "SELECT * from VOTE_TITLE where VOTE_ID='".$VOTE_ID."'";
if ( $LOGIN_USER_PRIV != "1" )
{
$query .= " and FROM_ID='".$LOGIN_USER_ID."'";
}
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$SUBJECT = $ROW['SUBJECT'];
$PARENT_ID = $ROW['PARENT_ID'];
$ANONYMITY = $ROW['ANONYMITY'];
}
else
{
exit( );
}
echo "<table border=\"0\" width=\"90%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/menu/vote.gif\" align=\"absmiddle\"><span class=\"big3\"> 投票项目管理 - ";
echo $SUBJECT;
echo "</span>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n<table class=\"TableList\" width=\"100%\" align=\"center\">\r\n <tr class=\"TableHeader\" align=\"center\">\r\n <td>选项</td>\r\n <td width=\"60\">票数</td>\r\n <td width=\"280\">投票人员</td>\r\n <td width=\"80\">操作</td>\r\n </tr>\r\n";
$query = "SELECT * from VOTE_ITEM where VOTE_ID='".$VOTE_ID."' order by ITEM_ID";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$ITEM_ID = $ROW['ITEM_ID'];
$ITEM_NAME = $ROW['ITEM_NAME'];
$VOTE_COUNT = $ROW['VOTE_COUNT'];
$VOTE_USER = $ROW['VOTE_USER'];
if ( $ANONYMITY == "0" )
{
$VOTE_USER_NAME = "";
$query = "SELECT * from USER where find_in_set(USER_ID,'".$VOTE_USER."')";
$cursor1 = exequery( $connection, $query );
while ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$VOTE_USER_NAME .= $ROW1['USER_NAME'].",";
}
$VOTE_USER_NAME = substr( $VOTE_USER_NAME, 0, -2 );
}
echo " <tr class=\"TableData\">\r\n <form name=\"form";
echo $ITEM_ID;
echo "\" method=\"post\" action=\"update.php\">\r\n <td> <input type=\"text\" name=\"ITEM_NAME\" class=\"SmallInput\" value=\"";
echo $ITEM_NAME;
echo "\" size=\"50\"></td>\r\n <td align=\"right\">";
echo $VOTE_COUNT;
echo "票</td>\r\n <td style=\"cursor:hand\" title=\"";
echo $VOTE_USER_NAME;
echo "\">";
echo csubstr( $VOTE_USER_NAME, 0, 30 ).( 30 < strlen( $VOTE_USER_NAME ) ? "..." : "" );
echo "</td>\r\n <td align=\"center\">\r\n <input type=\"hidden\" name=\"ITEM_ID\" value=\"";
echo $ITEM_ID;
echo "\">\r\n <input type=\"hidden\" name=\"VOTE_ID\" value=\"";
echo $VOTE_ID;
echo "\">\r\n <input type=\"submit\" name=\"submit\" value=\"修改\" class=\"SmallButton\"> \r\n <input type=\"button\" value=\"删除\" class=\"SmallButton\" name=\"button\" onclick=\"delete_item('";
echo $ITEM_ID;
echo "','";
echo $VOTE_ID;
echo "')\">\r\n </td>\r\n </form>\r\n </tr>\r\n";
}
echo " <tr class=\"TableControl\">\r\n <form name=\"form0\" method=\"post\" action=\"add.php\">\r\n <td colspan=\"4\">添加项目:\r\n <input type=\"text\" name=\"ITEM_NAME\" class=\"SmallInput\" size=\"40\">\r\n <input type=\"hidden\" name=\"VOTE_ID\" value=\"";
echo $VOTE_ID;
echo "\"> \r\n <input type=\"submit\" name=\"submit\" class=\"SmallButton\" value=\"添加\"></td>\r\n </form>\r\n </tr>\r\n</table>\r\n\r\n<div align=\"center\">\r\n <br>\r\n";
if ( $PARENT_ID == 0 )
{
echo " <input type=\"button\" class=\"BigButton\" value=\"返回\" onclick=\"location='../index1.php?start=";
echo $start;
echo "'\">\r\n";
}
else
{
echo " <input type=\"button\" class=\"BigButton\" value=\"返回\" onclick=\"location='../vote.php?PARENT_ID=";
echo $PARENT_ID;
echo "&start=";
echo $start;
echo "'\">\r\n";
}
echo "</div>\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -