Просмотр файла vavok-1.5.3/gallery/grafic.php

Размер файла: 5.78Kb
  1. <?php
  2. require_once"../include/startup.php";
  3.  
  4. $rat = (int)$_GET['rat'];
  5. $imgs = (int)$_GET['imgs'];
  6. $limit = (int)$_GET['limit'];
  7.  
  8. $rats = $rat;
  9. if ($rat >= 100) {
  10. $rats = 99;
  11. }
  12. if ($rat > 100) {
  13. $rat = 100;
  14. }
  15. if ($limit == "") {
  16. $limit = 50;
  17. }
  18. if ($limit > 100) {
  19. $limit = 100;
  20. }
  21.  
  22. if ($imgs == 1) {
  23. header("Content-type: image/gif");
  24. $im = imageCreateFromGIF("../images/img/grafic.gif");
  25. // -----------------------------------------------------------//
  26. $color = imagecolorallocate($im, 234, 237, 237);
  27. $color2 = imagecolorallocate($im, 227, 222, 222);
  28. $color3 = imagecolorallocate($im, 204, 200, 200);
  29. $color4 = imagecolorallocate($im, 185, 181, 181);
  30. $color5 = imagecolorallocate($im, 197, 195, 195);
  31.  
  32. imagefilledrectangle ($im, 2, 1, 99, 2, $color);
  33. imagefilledrectangle ($im, 1, 3, 100, 4, $color2);
  34. imagefilledrectangle ($im, 1, 5, 100, 6, $color3);
  35. imagefilledrectangle ($im, 1, 7, 100, 8, $color4);
  36. imagefilledrectangle ($im, 2, 9, 99, 10, $color5);
  37. // -----------------------------------------------------------//
  38. $color = imagecolorallocate($im, 255, 204, 204);
  39. $color2 = imagecolorallocate($im, 255, 153, 153);
  40. $color3 = imagecolorallocate($im, 255, 102, 102);
  41. $color4 = imagecolorallocate($im, 255, 51, 51);
  42. $color5 = imagecolorallocate($im, 255, 102, 102);
  43. $color6 = imagecolorallocate($im, 0, 0, 0);
  44.  
  45. if ($rat > 0) {
  46. imagefilledrectangle ($im, 2, 1, $rats, 2, $color);
  47. imagefilledrectangle ($im, 1, 3, $rat, 4, $color2);
  48. imagefilledrectangle ($im, 1, 5, $rat, 6, $color3);
  49. imagefilledrectangle ($im, 1, 7, $rat, 8, $color4);
  50. imagefilledrectangle ($im, 2, 9, $rats, 10, $color5);
  51. }
  52.  
  53. ImageString($im, 1, 78, 2, "$rat%", $color6);
  54.  
  55. ImageGIF($im);
  56. }
  57.  
  58. if ($imgs == 2) {
  59. header("Content-type: image/gif");
  60. $im = imageCreateFromGIF("../images/img/grafic.gif");
  61. // -----------------------------------------------------------//
  62. $color = imagecolorallocate($im, 234, 237, 237);
  63. $color2 = imagecolorallocate($im, 227, 222, 222);
  64. $color3 = imagecolorallocate($im, 204, 200, 200);
  65. $color4 = imagecolorallocate($im, 185, 181, 181);
  66. $color5 = imagecolorallocate($im, 197, 195, 195);
  67.  
  68. imagefilledrectangle ($im, 2, 1, 99, 2, $color);
  69. imagefilledrectangle ($im, 1, 3, 100, 4, $color2);
  70. imagefilledrectangle ($im, 1, 5, 100, 6, $color3);
  71. imagefilledrectangle ($im, 1, 7, 100, 8, $color4);
  72. imagefilledrectangle ($im, 2, 9, 99, 10, $color5);
  73. // -----------------------------------------------------------//
  74. $colorfon = imagecolorallocate($im, 218, 219, 219);
  75. $colorfon2 = imagecolorallocate($im, 197, 198, 198);
  76. $colorfon3 = imagecolorallocate($im, 175, 176, 176);
  77. $colorfon4 = imagecolorallocate($im, 153, 154, 154);
  78. $colorfon5 = imagecolorallocate($im, 175, 176, 176);
  79.  
  80. imagefilledrectangle ($im, 2, 1, $limit, 2, $colorfon);
  81. imagefilledrectangle ($im, 1, 3, $limit, 4, $colorfon2);
  82. imagefilledrectangle ($im, 1, 5, $limit, 6, $colorfon3);
  83. imagefilledrectangle ($im, 1, 7, $limit, 8, $colorfon4);
  84. imagefilledrectangle ($im, 2, 9, $limit, 10, $colorfon5);
  85. // -----------------------------------------------------------//
  86. $color = imagecolorallocate($im, 201, 201, 253);
  87. $color2 = imagecolorallocate($im, 153, 153, 255);
  88. $color3 = imagecolorallocate($im, 102, 102, 255);
  89. $color4 = imagecolorallocate($im, 51, 51, 255);
  90. $color5 = imagecolorallocate($im, 102, 102, 255);
  91. $color6 = imagecolorallocate($im, 0, 0, 0);
  92.  
  93. if ($rat > 0) {
  94. imagefilledrectangle ($im, 2, 1, $rats, 2, $color);
  95. imagefilledrectangle ($im, 1, 3, $rat, 4, $color2);
  96. imagefilledrectangle ($im, 1, 5, $rat, 6, $color3);
  97. imagefilledrectangle ($im, 1, 7, $rat, 8, $color4);
  98. imagefilledrectangle ($im, 2, 9, $rats, 10, $color5);
  99. }
  100.  
  101. ImageString($im, 1, 78, 2, "$rat%", $color6);
  102. ImageGIF($im);
  103. }
  104.  
  105. if ($imgs == 3) {
  106. header("Content-type: image/gif");
  107. $im = imageCreateFromGIF("../images/img/grafic.gif");
  108. // -----------------------------------------------------------//
  109. $color = imagecolorallocate($im, 234, 237, 237);
  110. $color2 = imagecolorallocate($im, 227, 222, 222);
  111. $color3 = imagecolorallocate($im, 204, 200, 200);
  112. $color4 = imagecolorallocate($im, 185, 181, 181);
  113. $color5 = imagecolorallocate($im, 197, 195, 195);
  114.  
  115. imagefilledrectangle ($im, 2, 1, 99, 2, $color);
  116. imagefilledrectangle ($im, 1, 3, 100, 4, $color2);
  117. imagefilledrectangle ($im, 1, 5, 100, 6, $color3);
  118. imagefilledrectangle ($im, 1, 7, 100, 8, $color4);
  119. imagefilledrectangle ($im, 2, 9, 99, 10, $color5);
  120. // -----------------------------------------------------------//
  121. $color = imagecolorallocate($im, 204, 255, 204);
  122. $color2 = imagecolorallocate($im, 153, 255, 153);
  123. $color3 = imagecolorallocate($im, 102, 255, 102);
  124. $color4 = imagecolorallocate($im, 0, 255, 0);
  125. $color5 = imagecolorallocate($im, 102, 255, 102);
  126. $color6 = imagecolorallocate($im, 0, 0, 0);
  127.  
  128. if ($rat > 0) {
  129. imagefilledrectangle ($im, 2, 1, $rats, 2, $color);
  130. imagefilledrectangle ($im, 1, 3, $rat, 4, $color2);
  131. imagefilledrectangle ($im, 1, 5, $rat, 6, $color3);
  132. imagefilledrectangle ($im, 1, 7, $rat, 8, $color4);
  133. imagefilledrectangle ($im, 2, 9, $rats, 10, $color5);
  134. }
  135.  
  136. ImageString($im, 1, 78, 2, "$rat%", $color6);
  137. ImageGIF($im);
  138. }
  139.  
  140. /* if($imgs==3){
  141. header("Content-type: image/gif");
  142. $im = ImageCreate (102, 12);
  143. $color = ImageColorAllocate ($im, 239, 244, 245);
  144. $color2 = imagecolorallocate($im, 51, 255, 0);
  145. $color3 = imagecolorallocate($im, 153, 153, 153);
  146. imagefilledrectangle ($im, 1, 1, $rat, 10, $color2);
  147. imagerectangle ($im, 0, 0, 101, 11, $color3);
  148. ImageGIF($im);
  149. } */
  150.  
  151. ?>