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

📄 viewvote.php

📁 php做的一个同学录网站,功能齐全. 后台管理非常方便,有需要的同学可以下载测试.
💻 PHP
字号:
<?php
include("pwdsuper.php");
include("connect.inc.php");
include("char.inc.php");
$poll_resultBarHeight = 12;			// height in pixels of percentage bar in result table
$poll_resultBarScale = 1;			// scale of result bar (in multiples of 100 pixels)
$poll_resultBarFile = "phpPollBar.gif";		// name of the image that contains the bar
$poll_voteValid = 1;
$poll_IPLocking = 1;
?>
<html>
<head>
<title>
</title>
<style type="text/css">
<!--
td{font-size:12px;line-height:17px;}
a:active {text-decoration: none;}
a:link {text-decoration: none;}
a:hover{text-decoration: underline;}
a:visited {text-decoration: none;}
BODY{font-size:12px;line-height:17px;SCROLLBAR-FACE-COLOR: #83d160; SCROLLBAR-HIGHLIGHT-COLOR: #CCFF00; SCROLLBAR-SHADOW-COLOR: #CCFF00; SCROLLBAR-3DLIGHT-COLOR: #009900; SCROLLBAR-ARROW-COLOR:  #006600; SCROLLBAR-TRACK-COLOR: ##99FF00; SCROLLBAR-DARKSHADOW-COLOR: #009900; }
-->
</style>
</head>
<body bgcolor="#dcf6ce" marginwidth="0" marginheight="0" text="#666600" link="#009900" alink="#00FF00" vlink="#006600">
<?php
$votequery=@mysql_query("select * from polls where pollid=".$pollid,$conn)or die(mysql_error());
$titlearray=mysql_fetch_array($votequery);
$title=$titlearray["polltitle"];
?>
<div align="center">查看投票结果</div>
<div align="center">标题:<?php echo $title;?></div><hr noshade size="1" width="100%" color="#00CC00">
<?php
$poll_result = mysql_query("SELECT SUM(optioncount) AS SUM FROM pollsdata WHERE pollid=$pollid",$conn);
if(!$poll_result)echo mysql_errno(). ": ".mysql_error(). "<br>";
$poll_sum = (int)mysql_result($poll_result, 0, "SUM"); 
echo '<table border=0 bordercolorlight="#009900" bordercolordark="#009900" cellspacing="1">';
$poll_result = mysql_query("SELECT * FROM pollsdata WHERE pollid=$pollid ORDER BY voteid",$conn);
if(!$poll_result)echo mysql_errno(). ": ".mysql_error(). "<br>";
while ($textarray=mysql_fetch_array($poll_result)){
	echo "<tr><td width=\"130\"><div align=\"right\">".$textarray["optiontext"]."</div></td>";
	if($poll_sum) $poll_percent=100*$textarray["optioncount"]/$poll_sum;
	else $poll_percent=0;
	echo '<td width="102">';
	if ($poll_percent > 0){
	$poll_percentscale = (int)($poll_percent * $poll_resultBarScale);
	echo "<img src=\"images/phppollbar".$textarray["voteid"].".gif\" height=$poll_resultBarHeight width=$poll_percentscale>";
	}else{
	echo "&nbsp;";
	}
	echo '</td><td width="100">';
        printf(" %.2f %% (%d票)", $poll_percent, $textarray["optioncount"]);
	echo '</td></tr>';
}
echo '<tr><td width="130">&nbsp;</td><td width="102">&nbsp;</td><td width="100">共计: <font color="#FF0000"><b>'.$poll_sum.'</b></font> 票</td></tr></table>';
?>
<hr noshade size="1" width="100%" color="#00CC00">
<div align="center"><a href="javascript:window.close()">关闭窗口</a></div>
</body>
</html>

⌨️ 快捷键说明

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