Changeset 547 for trunk/Modules/User/UserList.php
- Timestamp:
- Jun 18, 2013, 6:58:22 PM (11 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UserList.php
r544 r547 1 1 <?php 2 2 3 include('includes/global.php'); 3 4 4 include_once('img_level.php'); 5 5 6 ImgLevelUpdate(); 7 8 $Output = ''; 9 if(array_key_exists('search', $_GET)) 6 class PageUserList extends Page 10 7 { 11 $_SESSION['Where'] = ' WHERE `User`.`Name` LIKE "%'.$_GET['search'].'%"'; 8 function Show() 9 { 10 ImgLevelUpdate(); 11 12 $Output = ''; 13 if(array_key_exists('search', $_GET)) 14 { 15 $_SESSION['Where'] = ' WHERE `User`.`Name` LIKE "%'.$_GET['search'].'%"'; 16 } 17 if(array_key_exists('team', $_GET)) 18 { 19 $DbResult = $this->Database->select('Team', 'Name', 'Id='.$_GET['team']); 20 if($DbResult->num_rows > 0) 21 { 22 $Team = $DbResult->fetch_assoc(); 23 $Output .= '<h3>Seznam uživatelů v týmu '.$Team['Name'].'</h3>'; 24 $_SESSION['Where'] = ' WHERE `Team`='.$_GET['team']; 25 if($_GET['team'] == '') $_SESSION['Where'] = ''; 26 } else { 27 $Output .= ShowMessage('Tým '.$_GET['team'].' nenalezen', MESSAGE_CRITICAL); 28 $_SESSION['Where'] = ' WHERE FALSE'; 29 } 30 } else 31 { 32 $Output .= '<h3>Seznam uživatelů</h3>'; 33 if(!array_key_exists('Where', $_SESSION)) $_SESSION['Where'] = ''; 34 } 35 36 if(array_key_exists('action', $_GET)) 37 { 38 if($_GET['action'] == 'nofilter') $_SESSION['Where'] = ''; 39 } 40 //if($_SESSION['Where'] <> '') $Output .= ' <a href="?action=nofilter">Zrušit filtr uživatelů</a><br />'; 41 42 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']); 43 $DbRow = $DbResult->fetch_row(); 44 $PageList = GetPageList($DbRow[0]); 45 46 $Output .= $PageList['Output']. 47 '<table class="BaseTable">'; 48 49 $TableColumns = array( 50 array('Name' => 'Name', 'Title' => 'Jméno'), 51 array('Name' => 'TranslatedCount', 'Title' => 'Překladů'), 52 array('Name' => 'XP', 'Title' => 'Úroveň'), 53 array('Name' => 'XP', 'Title' => 'Zkušenost'), 54 //array('Name' => 'GM', 'Title' => 'Oprávnění'), 55 array('Name' => 'LastLogin', 'Title' => 'Naposledy přítomen'), 56 array('Name' => 'RegistrationTime', 'Title' => 'Čas registrace'), 57 ); 58 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1); 59 $Output .= $Order['Output']; 60 61 62 $Query = 'SELECT `User`.`ID`, `User`.`Name`, `LastLogin`, `GM`, `XP`, `TranslatedCount`, `RegistrationTime` '. 63 'FROM `User` '. 64 'LEFT JOIN `UserTrace` ON `UserTrace`.`User` = `User`.`Id` '. 65 $_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit']; 66 67 $DbResult = $this->Database->query($Query); 68 while($Line = $DbResult->fetch_assoc()) 69 { 70 $XP = GetLevelMinMax($Line['XP']); 71 $Output .= '<tr><td><a href="user.php?user='.$Line['ID'].'">'.$Line['Name'].'</a></td>'. 72 '<td style="text-align: center;"><a href="TranslationList.php?user='.$Line['ID'].'&group=0&state=2" title="Zobrazit Všechny jeho přeložené texty">'.$Line['TranslatedCount'].'</a></td>'. 73 '<td>'.$XP['Level'].'</td>'. 74 '<td>'.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'</td>'. 75 //<td>'.$Moderators[$Line['GM']].'</td> 76 '<td>'.HumanDate($Line['LastLogin']).'</td>'. 77 '<td>'.HumanDate($Line['RegistrationTime']).'</td></tr>'; 78 } 79 $Output .= '</table>'. 80 $PageList['Output']; 81 82 return($Output); 83 } 12 84 } 13 if(array_key_exists('team', $_GET))14 {15 $DbResult = $System->Database->select('Team', 'Name', 'Id='.$_GET['team']);16 if($DbResult->num_rows > 0)17 {18 $Team = $DbResult->fetch_assoc();19 $Output .= '<h3>Seznam uživatelů v týmu '.$Team['Name'].'</h3>';20 $_SESSION['Where'] = ' WHERE `Team`='.$_GET['team'];21 if($_GET['team'] == '') $_SESSION['Where'] = '';22 } else {23 $Output .= ShowMessage('Tým '.$_GET['team'].' nenalezen', MESSAGE_CRITICAL);24 $_SESSION['Where'] = ' WHERE FALSE';25 }26 } else27 {28 $Output .= '<h3>Seznam uživatelů</h3>';29 if(!array_key_exists('Where', $_SESSION)) $_SESSION['Where'] = '';30 }31 32 if(array_key_exists('action', $_GET))33 {34 if($_GET['action'] == 'nofilter') $_SESSION['Where'] = '';35 }36 //if($_SESSION['Where'] <> '') $Output .= ' <a href="?action=nofilter">Zrušit filtr uživatelů</a><br />';37 38 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']);39 $DbRow = $DbResult->fetch_row();40 $PageList = GetPageList($DbRow[0]);41 42 $Output .= $PageList['Output'].43 '<table class="BaseTable">';44 45 $TableColumns = array(46 array('Name' => 'Name', 'Title' => 'Jméno'),47 array('Name' => 'TranslatedCount', 'Title' => 'Překladů'),48 array('Name' => 'XP', 'Title' => 'Úroveň'),49 array('Name' => 'XP', 'Title' => 'Zkušenost'),50 //array('Name' => 'GM', 'Title' => 'Oprávnění'),51 array('Name' => 'LastLogin', 'Title' => 'Naposledy přítomen'),52 array('Name' => 'RegistrationTime', 'Title' => 'Čas registrace'),53 );54 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1);55 $Output .= $Order['Output'];56 57 58 $Query = 'SELECT `User`.`ID`, `User`.`Name`, `LastLogin`, `GM`, `XP`, `TranslatedCount`, `RegistrationTime` '.59 'FROM `User` '.60 'LEFT JOIN `UserTrace` ON `UserTrace`.`User` = `User`.`Id` '.61 $_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit'];62 63 $DbResult = $System->Database->query($Query);64 while($Line = $DbResult->fetch_assoc())65 {66 $XP = GetLevelMinMax($Line['XP']);67 $Output .= '<tr><td><a href="user.php?user='.$Line['ID'].'">'.$Line['Name'].'</a></td>'.68 '<td style="text-align: center;"><a href="TranslationList.php?user='.$Line['ID'].'&group=0&state=2" title="Zobrazit Všechny jeho přeložené texty">'.$Line['TranslatedCount'].'</a></td>'.69 '<td>'.$XP['Level'].'</td>'.70 '<td>'.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'</td>'.71 //<td>'.$Moderators[$Line['GM']].'</td>72 '<td>'.HumanDate($Line['LastLogin']).'</td>'.73 '<td>'.HumanDate($Line['RegistrationTime']).'</td></tr>';74 }75 $Output .= '</table>'.76 $PageList['Output'];77 78 ShowPage($Output);79 80 ?>
Note:
See TracChangeset
for help on using the changeset viewer.