<?php require_once('../../include/class.inc.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="../inc/css.css" type="text/css" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE5 {color: #FFFFFF; font-weight: bold; }
-->
</style>
</head>

<body>
<table width="1055" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="960"><?php
	$my->showpage();
	?></td>
    <td width="95"><a href="../vote/vote_add.php">添加分类标题</a></td>
  </tr>
  <tr>
    <td colspan="2"><table width="1052" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#799AE1" class="tableBorder">
      <tbody><?php
$VoteID=intval($_GET["VoteID"]);
$sql="select * from voteclass where VoteID='$VoteID'";
$result=$my->data_work($sql);
$rs1=mysql_fetch_array($result);
$VoteName=$rs1["VoteName"];
//echo $VoteName;
//exit;
?>
        <tr bgcolor="#CCCCCC">
          <td height="20" bgcolor="#4455aa"><div align="center" class="STYLE5">投票主题</div></td>
          <td height="20" colspan="2" bgcolor="#4455aa"><div align="center" class="STYLE5">
            <?php echo $rs1["VoteName"]?>
          </div>            <div align="center"></div></td>
          <td height="20" colspan="3" bgcolor="#4455aa"><div align="center" class="STYLE5">投票结果</div></td>
        </tr>
<?php
//所有激活主题主题投票数的和
$result_s=$my->data_work("select sum(totalnum) as v_hit from vote where voteid=$VoteID");
$rs_s=mysql_fetch_array($result_s);
$v_hit=$rs_s[0];

$sql="select * from vote where voteid=$VoteID order by id desc";
//echo $sql;
//exit;
$result=$my->data_work($sql);
while($rs=mysql_fetch_array($result)){
?> 
        <tr bgcolor="#DEE5FA">
          <td width="52" align="center" class="txlrow">&nbsp;</td>
          <td width="45" align="center" class="txlrow"><?php echo $rs["id"]?></td>
          <td width="258" align="center" class="txlrow"><div align="center">
            <?php echo $rs["Votetitle"]?>
          </div></td>
          <td width="440" align="center" class="txlrow"><div align="left"><img src="images/dot1.gif"   width="<?php echo number_format(($rs["totalnum"]/$v_hit)*100,2)?>" height="15" /></div></td>
          <td width="143" align="center" class="txlrow"><?php echo $rs["totalnum"]?></td>
          <td width="81" align="center" class="txlrow"><?php echo number_format(($rs["totalnum"]/$v_hit)*100)?>
            %</td>
        </tr>
        <?php
}; 	
?>
        <tr bgcolor="#DEE5FA">
          <td colspan="6" align="center" class="txlrow"></td>
        </tr>
      </tbody>
    </table></td>
  </tr>
  <tr>
    <td colspan="2"><?php
    
	$my->showpage();
	
	?></td>
  </tr>
</table>
</body>
</html>
