1 | <?php
|
---|
2 | session_start();
|
---|
3 | include('includes/config.php');
|
---|
4 | include('includes/databaseconection.php');
|
---|
5 |
|
---|
6 | //připojení do databáze
|
---|
7 | $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
|
---|
8 | $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
|
---|
9 | $Database->SelectDatabase($Config['Database']['Database']);
|
---|
10 |
|
---|
11 | $TypeTexts = $_GET['TypeText'];
|
---|
12 |
|
---|
13 | // echo "SELECT count(distinct(entry)) FROM $TypeTexts WHERE Language <> '0' AND Complete = '1'";
|
---|
14 | $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(distinct(entry)) FROM $TypeTexts WHERE Language <> '0' AND Complete = '1'"));
|
---|
15 | $NumberTranslate = $ID[0];
|
---|
16 |
|
---|
17 | $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(*) FROM $TypeTexts WHERE Language = '0'"));
|
---|
18 | $NumberAJ = $ID[0];
|
---|
19 |
|
---|
20 | $Percent = ($NumberTranslate/$NumberAJ)*100;
|
---|
21 | $Percent = substr($Percent, 0, 5);
|
---|
22 |
|
---|
23 | $PercentBar = $Percent*4;
|
---|
24 | $obrazek = imagecreatetruecolor(400,60);
|
---|
25 | $Color1 = imagecolorallocate($obrazek,225,246,247);
|
---|
26 | $Color2 = imagecolorallocate($obrazek,77,225,251);
|
---|
27 | $Color3 = imagecolorallocate($obrazek,2,59,199);
|
---|
28 | imagefilledrectangle($obrazek,0,0,400,59,$Color1);
|
---|
29 | imagefilledrectangle($obrazek,0,0,$PercentBar,59,$Color2);
|
---|
30 | imagestring($obrazek, 10, 120, 15, $NumberTranslate.'/'.$NumberAJ, $Color3);
|
---|
31 | imagestring($obrazek, 3, 300, 15, $TypeTexts, $Color3);
|
---|
32 | imagestring($obrazek, 10, 120, 30, $Percent.' %', $Color3);
|
---|
33 | imagestring($obrazek, 1, 240, 50, 'Aktualizováno: '.date("m.d.y H:i"), $Color3);
|
---|
34 |
|
---|
35 |
|
---|
36 | header('Content-Type: image/png');
|
---|
37 | imagepng($obrazek);
|
---|
38 | imagedestroy($obrazek);
|
---|
39 |
|
---|
40 | // echo '<img src="statistic.png">';
|
---|
41 |
|
---|
42 | ?>
|
---|