1 | <?php
|
---|
2 |
|
---|
3 | session_start();
|
---|
4 | include('includes/config.php');
|
---|
5 | include('includes/databaseconection.php');
|
---|
6 | include('includes/global_function.php');
|
---|
7 |
|
---|
8 | // SQL injection hack protection
|
---|
9 | foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]);
|
---|
10 | foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]);
|
---|
11 |
|
---|
12 | // Open database connection
|
---|
13 | $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
|
---|
14 | $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
|
---|
15 | $Database->SelectDatabase($Config['Database']['Database']);
|
---|
16 |
|
---|
17 | $FontFile = 'images/FRIZQT__.ttf';
|
---|
18 | $TranslationTree = GetTranslationTree();
|
---|
19 | $Group = $TranslationTree[$_GET['group']];
|
---|
20 |
|
---|
21 | $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(distinct(entry)) FROM '.$Group['TablePrefix'].' WHERE (Language <> 0) AND (Complete = 1)'));
|
---|
22 | $NumberTranslate = $ID[0];
|
---|
23 |
|
---|
24 | $ID = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Group['TablePrefix'].' WHERE (Language = 0)'));
|
---|
25 | $NumberAJ = $ID[0];
|
---|
26 |
|
---|
27 | if($NumberAJ > 0) $Percent = ($NumberTranslate / $NumberAJ) * 100; else $Percent = 0;
|
---|
28 | $Percent = substr($Percent, 0, 5);
|
---|
29 |
|
---|
30 | $PercentBar = $Percent * 4;
|
---|
31 | $Image = ImageCreateTrueColor(400, 32);
|
---|
32 | $Color1 = imagecolorallocate($Image, 225, 246, 247);
|
---|
33 | $Color2 = imagecolorallocate($Image, 77, 225, 251);
|
---|
34 | $Color3 = imagecolorallocate($Image, 2, 9, 199);
|
---|
35 | imagefilledrectangle($Image, 0, 0, 400, 31, $Color1);
|
---|
36 | imagefilledrectangle($Image, 0, 0, $PercentBar, 59, $Color2);
|
---|
37 | $FontSize = 10;
|
---|
38 | ImageTTFText($Image, $FontSize, 0, 120, 13, $Color3, $FontFile, $NumberTranslate.'/'.$NumberAJ);
|
---|
39 | ImageTTFText($Image, $FontSize, 0, 240, 13, $Color3, $FontFile, $Group['Name']);
|
---|
40 | ImageTTFText($Image, $FontSize, 0, 120, 29, $Color3, $FontFile, $Percent.'%');
|
---|
41 | $FontSize = 6;
|
---|
42 | ImageTTFText($Image, $FontSize, 0, 240, 28, $Color3, $FontFile, 'Aktualizace: '.date("m.d.y H:i"));
|
---|
43 |
|
---|
44 | Header("Content-type: image/png");
|
---|
45 | ImagePNG($Image);
|
---|
46 | ImageDestroy($Image);
|
---|
47 |
|
---|
48 | ?>
|
---|