Просмотр файла gta/city4/grafic.php

Размер файла: 1.66Kb
  1. <?php
  2. $rat=(int)$_GET['rat'];
  3. $limit=(int)$_GET['limit'];
  4.  
  5. $rats=$rat;
  6. if($rat>=100){$rats=99;}
  7. if($rat>100){$rat=100;}
  8. if($limit==""){$limit=50;}
  9. if($limit>100){$limit=100;}
  10.  
  11. header("Content-type: image/gif");
  12. $im = imageCreateFromGIF("images/grafic.gif");
  13.  
  14. //-----------------------------------------------------------//
  15.  
  16. $color = imagecolorallocate($im, 234, 237, 237);
  17. $color2 = imagecolorallocate($im, 227, 222, 222);
  18. $color3 = imagecolorallocate($im, 204, 200, 200);
  19. $color4 = imagecolorallocate($im, 185, 181, 181);
  20. $color5 = imagecolorallocate($im, 197, 195, 195);
  21.  
  22.  
  23. imagefilledrectangle ($im, 2, 1, 99, 2, $color);
  24. imagefilledrectangle ($im, 1, 3, 100, 4, $color2);
  25. imagefilledrectangle ($im, 1, 5, 100, 6, $color3);
  26. imagefilledrectangle ($im, 1, 7, 100, 8, $color4);
  27. imagefilledrectangle ($im, 2, 9, 99, 10, $color5);
  28.  
  29. //-----------------------------------------------------------//
  30.  
  31. $color = imagecolorallocate($im, 255, 204, 204);
  32. $color2 = imagecolorallocate($im, 255, 153, 153);
  33. $color3 = imagecolorallocate($im, 255, 102, 102);
  34. $color4 = imagecolorallocate($im, 255, 51, 51);
  35. $color5 = imagecolorallocate($im, 255, 102, 102);
  36. $color6 = imagecolorallocate($im, 0, 0, 0);
  37.  
  38. if($rat>0){
  39. imagefilledrectangle ($im, 2, 1, $rats, 2, $color);
  40. imagefilledrectangle ($im, 1, 3, $rat, 4, $color2);
  41. imagefilledrectangle ($im, 1, 5, $rat, 6, $color3);
  42. imagefilledrectangle ($im, 1, 7, $rat, 8, $color4);
  43. imagefilledrectangle ($im, 2, 9, $rats, 10, $color5);
  44. }
  45.  
  46.  
  47. ImageString($im, 1, 78, 2, "$rat%", $color6);
  48.  
  49. ImageGIF($im);
  50.  
  51.  
  52. ?>