Changeset 234 for quests/statistic.php


Ignore:
Timestamp:
Jan 15, 2008, 6:16:14 PM (17 years ago)
Author:
maron
Message:

Menší grafické úpravy, možnost seřazení statistiky

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quests/statistic.php

    r233 r234  
    1111<b>Seznam u¾ivatelù: </b>
    1212<table border="1" cellpadding="1" cellspacing="0">
    13 <tr><th>Jméno</th><th>Poèet pøelo¾ených</th><th>Poslední pøipojení</th></tr>
    1413<?php 
    15   $ID = $Database->SQLCommand("SELECT user,Email,LastLogin,(SELECT count(*) FROM `quests` WHERE User = user.id AND User <> 0) as NumberTranslate FROM `user` ORDER BY NumberTranslate DESC");
     14
     15  if(array_key_exists('order', $_GET)) {
     16    $order = $_GET['order'];
     17    $desc = $_GET['desc'];
     18  } else {
     19    $order = 'NumberTranslate';
     20    $desc = 'DESC';
     21  }
     22
     23  if ($desc == '') $desc = 'desc'; else $desc = '';
     24
     25  echo '<tr><th><a href="statistic.php?order=user&amp;desc='.$desc.'">Jméno</a></th>
     26  <th><a href="statistic.php?order=NumberTranslate&amp;desc='.$desc.'">Poèet pøelo¾ených</a></th>
     27  <th><a href="statistic.php?order=LastLogin&amp;desc='.$desc.'">Poslední pøipojení</a></th></tr>';
     28
     29  $ID = $Database->SQLCommand("SELECT user,Email,LastLogin,(SELECT count(*) FROM `quests` WHERE User = user.id AND User <> 0) as NumberTranslate FROM `user` ORDER BY $order $desc");
    1630      while ($Line = mysql_fetch_array($ID))
    1731        echo '<tr><td>'.$Line['user'].'</td><td>'.$Line['NumberTranslate'].'</td><td>'.$Line['LastLogin'].'</td></tr>';
Note: See TracChangeset for help on using the changeset viewer.