Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <td><?php echo $img1; ?></td>
  2. <td><?php echo $img2; ?></td>
  3. <td><?php echo $img3; ?></td>
  4. <td><?php echo $img4; ?></td>
  5. <td><?php echo $img5; ?></td>
  6.  
  7. <?php
  8. $value = 10000 //this value is obtained by SQL
  9. $bar1 = 2600 //is the value of the first bar, obtained by SQL
  10. $bar2 = 9950 //is the value of the second bar, obtained by SQL
  11. $bar3 = 13010 //same as before
  12. $bar4 = 17500 //same as before
  13. $bar5 = 19500 //same as before
  14.  
  15. if($value > 0) && ($value < $bar1) {
  16. $percent = ($value / $bar1) *100;
  17. $bar1 = '<img src="progress.png" width="'.$percent.'" />';
  18. }
  19.  
  20. if($value >= $bar1) {
  21. $percent = '100';
  22. $bar1 = '<img src="reached.png" width="'.$percent.'" />';
  23. ?>
  24.  
  25. <?php
  26. if($value > $bar2) && ($value < bar3) {
  27. $percent = ($value / $bar3) *100;
  28. $bar3 = '<img src="progress.png" width="'.$percent.'" />';
  29. }
  30. >?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement