Home > Panele > Statystyki downloadu 2

Statystyki downloadu 2

Dodane przez: piciu
opis:
images65.fotosik.pl/796/5d4d9a75b50bac81med.jpg
Kod:
  1. if (!defined("IN_FUSION")) { die("Access Denied"); }
  2.  
  3. openside("Statystyki download");
  4.  
  5.  
  6.  
  7. $stat = dbquery("SELECT
  8.  
  9. (SELECT COUNT(*) FROM ".DB_DOWNLOAD_CATS.") AS kategori,
  10.  
  11. (SELECT COUNT(*) FROM ".DB_DOWNLOADS.") AS plikow,
  12.  
  13. (SELECT SUM(download_count) FROM ".DB_DOWNLOADS.") AS pobran");
  14.  
  15. $r = dbarray($stat);
  16.  
  17.  
  18. echo "<table border='0' width='100%' class='small'>
  19. <tr><td class='small'>Liczba kategorii:</td><td align='right' class='small'>[".number_format($r['kategori'])."]</td></tr>
  20. <tr><td class='small'>Liczba plików:</td><td align='right' class='small'>[".number_format($r['plikow'])."]</td></tr>
  21. <tr><td class='small'>Liczba pobrań:</td><td align='right' class='small'>[".number_format($r['pobran'])."]</td></tr>
  22. </table>";
  23.  
  24. $result = dbquery("SELECT download_id, download_title, download_image_thumb, download_count, download_cat FROM ".DB_DOWNLOADS." ORDER BY download_count DESC LIMIT 4");
  25.  
  26. if (dbrows($result) != 0) {
  27.  
  28. echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
  29.  
  30. while ($data = dbarray($result)) {
  31.  
  32. if ($data['download_image_thumb']) {
  33.  
  34. $img_thumb = DOWNLOADS."images/".$data['download_image_thumb'];
  35.  
  36. } else {
  37.  
  38. $img_thumb = DOWNLOADS."images/no_image.jpg";
  39.  
  40. }
  41.  
  42.  
  43.  
  44. echo "<td width='25%' style='text-align:center;font-size:10px;'><img src='".$img_thumb."' style='float:center;margin:5px;' alt='".$data['download_title']."' /><br /><a href='".BASEDIR."downloads.php?download_id=".$data['download_id']."' title='".$data['download_title']."'>".$data['download_title']."</a></td>\n";
  45.  
  46. }
  47.  
  48. echo "</tr>\n</table>\n";
  49.  
  50. } else {
  51.  
  52. echo "<div style='text-align:center;'>Brak danych do wyświetlenia.</div>\n";
  53.  
  54. }
  55.  
  56. echo "<br />\n";
  57.  
  58. closeside();

©