<?php
#define('START_TIME', microtime(true));
$err = '<center>Увы, нет поддержки GD</center>';
if (!extension_loaded('gd')) {
die($err);
}
#error_reporting(0);
$a = 'z.php';
include $a;
$b = 'imageColorAllocate';
$width = 72;
$height = 9;
$arr = array(0, 0, 71, 0, 71, 8, 0, 8);
$z = c();
$h = $z[1];
$i = strlen($h);
$j = $z[0];
switch ($i) {
case 1:
if ($h == 1) {
$l = 69; break;
}
$l = 66; break;
case 2:
if ($h == 11) {
$l = 67; break;
}
if ($h{0} == 1 || $h{1} == 1) {
$l = 64; break;
}
$l = 61; break;
case 3:
if ($h == 111) {
$l = 65; break;
}
if (preg_match('|1[^1][^1]|', $h) ||
preg_match('|[^1]1[^1]|', $h) ||
preg_match('|[^1][^1]1|', $h)) {
$l = 59; break;
}
if (preg_match('|11[^1]|', $h) ||
preg_match('|1[^1]1|', $h) ||
preg_match('|[^1]11|', $h)) {
$l = 62; break;
}
$l = 56; break;
default:
$l = 51;
}
$img = imageCreate($width, $height);
$white = $b($img, 255, 255, 255);
if (isset($_GET['c'])) {
$c = $_GET['c']{0};
switch ($c) {
case 'b':
$col = $b($img, 0, 0, 0); break;
case 'g':
$col = $b($img, 120, 120, 120); break;
case 'l':
$col = $b($img, 60, 160, 45); break;
case 'p':
$col = $b($img, 190, 90, 190); break;
}
} else {
$col = $b($img, 0, 0, 0);
# $col = $b($img, 255, 255, 255);
}
$font = 'font/cnt.ttf';
imageColorTransparent($img, $white);
imagePolygon($img, $arr, 4, $col);
imageTtfText($img, 6, $arr[1], 2, 7, $col, $font, $j);
imageTtfText($img, 6, $arr[1], $l, 7, $col, $font, $h);
header('Cache-control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Content-type: image/png');
imagePng($img);
imageDestroy($img);
#printf("Время работы скрипта: %.5f c<br />", microtime(true) - START_TIME);
?>