<%@ Page language="c#" Codebehind="SurveyStat.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.SurveyStat" %>
<!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>
		<!--#include file="../../inc/encoding.inc"-->
		<title>结果统计,<%=detail.Title %></title>
		<!--#include file="../../inc/head.inc"-->
		<style type="text/css">
		    table {border-collapse:collapse;border:solid #999;border-width:1px 0 0 1px;}
            table caption {font-size:14px;font-weight:bolder;}
            table th,table td {border:solid #999;border-width:0 1px 1px 0;padding:2px;}
            tfoot td {text-align:center;}
		</style>
	</head>
	<body>
		<form id="Form1" method="post" runat="server">
		    <asp:Repeater id="rptSurveyItem" runat="server">
                <ItemTemplate>
                    <table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="1" style="text-align:left;">
                        <tr>
                            <td>
                                <span style="float:left;"><%# DataBinder.Eval(Container.DataItem,"Title") %></span>
                                <span style="margin-right:0px; float:right;">总数：<%# DataBinder.Eval(Container.DataItem,"TotalVot") %></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table style="width:100%;">
                                    <tr>
                                        <td>
                                            选项名称
                                        </td>
                                        <td style="width:50px;">投票数</td>
                                        <td colspan="2">百分比</td>
                                    </tr>
                                    <asp:Repeater ID="rptOptions" runat="server" DataSource='<%# BindOptions((int)DataBinder.Eval(Container.DataItem,"SurveyItemID")) %>'>
                                        <ItemTemplate>
                                        <tr>
                                            <td><%# DataBinder.Eval(Container.DataItem,"OptionName") %></td>
                                            <td style="width:50px;"><%# DataBinder.Eval(Container.DataItem,"VotCount") %></td>
                                            <td style="width:50px;"><%# GetPercent(DataBinder.Eval(Container.DataItem, "VotCount").ToString(), (int)DataBinder.Eval(Container.DataItem, "SurveyItemID"))%>%</td>
                                            <td style="width:120px;">
                                                <div style="border:1px solid #767676; width:98%;"><img src='images/vote_co.gif' alt='' width='<%# GetPercent(DataBinder.Eval(Container.DataItem, "VotCount").ToString(), (int)DataBinder.Eval(Container.DataItem, "SurveyItemID"))%>%' height="7" /></div>
                                            </td>
                                        </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
	                             </table>
                            </td>
                        </tr>
                    </table>
                    <br />
                </ItemTemplate>
            </asp:Repeater>
		</form>
	</body>
</html>
