recipe for a progress bar in html/php/css

Today I was struggling with progress bar on customer page,
the task was: creation percentage bar of people who are involved in some event, what I have got was: number of people and total number of target that company wanted to reach,

< ?php 
if($total == 0)
$perc = 0;
else
 $perc = $people/$total

if($perc >= 1)
$perc = 1;

?>

then I had to create containing div

now, I had to create second div inside containing div with $perc width of containing div

simple but it works!

Published by

Luke Iwanski

Senior Graphics Programmer @ CD Projekt RED

Leave a Reply

Your email address will not be published. Required fields are marked *