functionShowPercent($now,$total)
{
$percent=sprintf('%.0f',$now*100/$total);
$html='<tablewidth="60%"style="border-collapse:separate"height="10"border="0"cellpadding="0"cellspacing="2"bgcolor="#fff"><tr>';
$count=0;
$pertr=30;
while($count<$total)
{
$bgcolor=$count<$now?'green':'#EEEEEE';
$html.='<tdbgcolor="'.$bgcolor.'"></td>';
$count++;
if($count%$pertr==0)$html.='</tr><tr>';
}
$bgcolor2=$now==$total?'style="font-weight:bold;color:green;"':'';
$html.='<td'.$bgcolor2.'colspan="'.($count%$pertr).'">'.$percent.'%</td></tr></table>';
return$html;
}
|