1 | <?php
|
---|
2 |
|
---|
3 | include('includes/global.php');
|
---|
4 |
|
---|
5 | $FontFile = 'images/FRIZQT__.ttf';
|
---|
6 | $TranslationTree = GetTranslationTree();
|
---|
7 | $Group = $TranslationTree[$_GET['group']];
|
---|
8 | if (array_key_exists('team', $_GET)) {
|
---|
9 | $team = ' AND User IN (SELECT ID FROM user WHERE team = '.$_GET['team'].')';
|
---|
10 | } else $team = '';
|
---|
11 |
|
---|
12 | $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(entry)) FROM '.$Group['TablePrefix'].' WHERE (Language <> 0) AND (Complete = 1) '.$team));
|
---|
13 | $NumberTranslate = $ID[0];
|
---|
14 |
|
---|
15 | $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Group['TablePrefix'].' WHERE (Language = 0)'));
|
---|
16 | $NumberAJ = $ID[0];
|
---|
17 |
|
---|
18 | if($NumberAJ > 0) $Percent = ($NumberTranslate / $NumberAJ) * 100; else $Percent = 0;
|
---|
19 | $Percent = substr($Percent, 0, 5);
|
---|
20 |
|
---|
21 | $PercentBar = $Percent * 4;
|
---|
22 | $Image = ImageCreateTrueColor(400, 32);
|
---|
23 | $Color1 = imagecolorallocate($Image, 214, 214, 214);
|
---|
24 | $Color2 = imagecolorallocate($Image, 239, 131, 166);
|
---|
25 | $Color3 = imagecolorallocate($Image, 225, 0, 0);
|
---|
26 | imagefilledrectangle($Image, 0, 0, 400, 31, $Color1);
|
---|
27 | imagefilledrectangle($Image, 0, 0, $PercentBar, 59, $Color2);
|
---|
28 | $FontSize = 10;
|
---|
29 | ImageTTFText($Image, $FontSize, 0, 120, 13, $Color3, $FontFile, $NumberTranslate.'/'.$NumberAJ);
|
---|
30 | ImageTTFText($Image, $FontSize, 0, 240, 13, $Color3, $FontFile, $Group['Name']);
|
---|
31 | ImageTTFText($Image, $FontSize, 0, 120, 29, $Color3, $FontFile, $Percent.'%');
|
---|
32 | $FontSize = 6;
|
---|
33 | ImageTTFText($Image, $FontSize, 0, 240, 28, $Color3, $FontFile, 'Aktualizace: '.date("m.d.y H:i"));
|
---|
34 |
|
---|
35 | Header("Content-type: image/png");
|
---|
36 | ImagePNG($Image);
|
---|
37 | ImageDestroy($Image);
|
---|
38 |
|
---|
39 | ?>
|
---|