//名称:showresult.php3
//本程序用于查看投票结果
//作者:phpstudent
//$vpollid=1; 传递参数 调查ID
require(database.php3);
$db = new database();
$db->openDefaultConnection();
$SQL="SELECT polltitle from poll where pollid=".$vpollid;
$db->openResultset($SQL);
$db->rstNext();
$vpolltitle=$db->getItem(1); //取出调查标题
$db->closeResultset();
$SQL = "SELECT chioceid,chiocename,chiocenum,chiocecolor from pollchioce where pollid=".$vpollid;
$db->openResultset($SQL);
$i=0;
$vpollData=" ";
$vpollColor="";
$voteTotal=0;
$vchiocename=split(",","1,2,3,4,5,6,7,8");
while($db->rstNext()) //取出选项的文字,计数及颜色
{ $vchiocename[$i]=$db->getItem(2);
if($i==0)
{
$vpollData=$db->getItem(3);
$vpollColor=$db->getItem(4);
}
else
{$vpollData.=",";
$vpollData.=$db->getItem(3);
$vpollColor.=",";
$vpollColor.=$db->getItem(4);