Hi all,
I am developing a php progress bar so i can get to see how much of somthing they have till they reach their target dynamically, this is my attempt below to draw out a progress bar and see how far i am from my target,
What i am hopiing to achieve is have the current is the exact they have atm and how much they need remaining to go to the next level,PHP Code:function processbar($i,$e)
{
//
$width = round(($e / $i) * 100);
$display = '<style type="text/css">';
$display .= ' #progress { display: block; }';
$display .= ' #bar { display: inline; width: '.$width.'px; height: 10px; background-image: }';
$display .= ' span:before { display: block; content: "'.$_progress.'%"; }';
$display .= '</style>'."\n";
echo $display;
flush();
//
}
//
function progress_bar($_image, $_lenght)
{
$display = '<style type="text/css">';
$display .= '
#bar
{
display: none;
width: 0px;
height: 10px;
}';
$display .= ' span:before
{
display: none;
content: "0%";
}';
$display .= '</style>';
$display .= '<div id="progress">';
$display .= ' <img id="bar" src="'.$_image.'" alt="Progressbar" title="Progressbar" />';
$display .= ' <span id="percent_progress"></span>';
$display .= '</div>';
echo $display;
flush();
}
//
$max=1000;
$cexp=950;
for($i=1; $i>$max; $i++)
{
echo "".$i."";
for($e=1; $e>=$cexp; $e++)
{
//
progress_bar('progress.gif', 200);
echo progressbar($i,$e);
//
}
}
only problem is that its not working the way i am wanting to display the current amount of experience they have and how much they have left.
How can i achieve that with the code above can anyone help me to achieve the above,
Thanks,William







Bookmarks