php进度条如何计算,投票最后显示进度条的百分比怎么算

我自己写的一个投票结果显示,其中设定票数最多的那个进度条为100%。public class voteresult : System.Web.UI.Page

{

protected System.Web.UI.HtmlControls.HtmlTableCell td_vote;

protected System.Web.UI.HtmlControls.HtmlTable tab_result;

private void Page_Load(object sender, System.EventArgs e)// 在此处放置用户代码以初始化页面

{

tab_result=new HtmlTable();

string voteid=Request.Params["voteid"];

string optionid=Request.Params["optionid"];

CommonFunction.SQLConnection scon=new SQLConnection();

System.Data.DataTable dt;

System.Web.UI.HtmlControls.HtmlTableCell tc;

System.Web.UI.HtmlControls.HtmlTableRow tr;

string sql="";

sql="update voteinfo set optioncount=optioncount+1 where voteid="+voteid+" and optionid="+optionid;

scon.OperationRecord(sql);

sql="select optionstr,optioncount from voteinfo where voteid="+voteid;dt=scon.Query(sql);

int i=0;

int length=0;

while(i

{

if(length

length=(int)dt.Rows[i].ItemArray[1];

i++;

}

i=0;

td_vote.InnerHtml="

while(i

{

td_vote.InnerHtml+="

";

td_vote.InnerHtml+="

";

td_vote.InnerHtml+=(string)dt.Rows[i].ItemArray[0];

td_vote.InnerHtml+="

";

//tc=new HtmlTableCell();

//tr=new HtmlTableRow();

//tc.InnerText=

//tr.Cells.Add(tc);

//tc=new HtmlTableCell();

td_vote.InnerHtml+="long.gif%5C%22";

//tc.InnerHtml=

//tr.Cells.Add(tc);

td_vote.InnerHtml+="

";

td_vote.InnerHtml+=((int)dt.Rows[i].ItemArray[1]).ToString();;

//tc=new HtmlTableCell();

//tc.InnerText=

td_vote.InnerHtml+="

";

i++;

}

td_vote.InnerHtml+="

";

}

相关文章:

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值