Changeset 49 for trunk/img_statistic.php
- Timestamp:
- Jan 30, 2009, 10:33:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
SqlTranslate.zip
-
Property svn:ignore
set to
-
trunk/img_statistic.php
r43 r49 3 3 include('includes/config.php'); 4 4 include('includes/databaseconection.php'); 5 6 // SQL injection hack protection 7 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]); 8 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 5 9 6 10 //připojení do databáze … … 12 16 13 17 // 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 $TypeTextsWHERE Language <> '0' AND Complete = '1'"));18 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(distinct(entry)) FROM ".$TypeTexts." WHERE Language <> '0' AND Complete = '1'")); 15 19 $NumberTranslate = $ID[0]; 16 20 17 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(*) FROM $TypeTextsWHERE Language = '0'"));21 $ID = mysql_fetch_row($Database->SQLCommand("SELECT count(*) FROM ".$TypeTexts." WHERE Language = '0'")); 18 22 $NumberAJ = $ID[0]; 19 23 20 $Percent = ($NumberTranslate /$NumberAJ)*100;24 $Percent = ($NumberTranslate / $NumberAJ) * 100; 21 25 $Percent = substr($Percent, 0, 5); 22 26 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 27 $PercentBar = $Percent * 4; 28 $obrazek = imagecreatetruecolor(400, 40); 29 $Color1 = imagecolorallocate($obrazek, 225, 246, 247); 30 $Color2 = imagecolorallocate($obrazek, 77, 225, 251); 31 $Color3 = imagecolorallocate($obrazek, 2, 9, 199); 32 imagefilledrectangle($obrazek, 0, 0, 400, 39, $Color1); 33 imagefilledrectangle($obrazek, 0, 0, $PercentBar, 59, $Color2); 34 imagestring($obrazek, 10, 120, 5, $NumberTranslate.'/'.$NumberAJ, $Color3); 35 imagestring($obrazek, 3, 300, 5, $TypeTexts, $Color3); 36 imagestring($obrazek, 10, 120, 20, $Percent.' %', $Color3); 37 imagestring($obrazek, 1, 240, 30, 'Aktualizace: '.date("m.d.y H:i"), $Color3); 35 38 36 39 header('Content-Type: image/png');
Note:
See TracChangeset
for help on using the changeset viewer.