Changeset 303 for trunk/userlist.php
- Timestamp:
- Jan 30, 2011, 8:19:57 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/userlist.php
r214 r303 9 9 function Show() 10 10 { 11 $Output = '<table class="WideTable" style="font-size: small;"><tr><th>Jméno uživatele</th><th>E-mail</th><th>ICQ</th><th>Telefon</th><th>Počítače</th></tr>'; 11 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `User` WHERE (`Login` != "Anonym")'); 12 $DbRow = $DbResult->fetch_row(); 13 $PageList = GetPageList($DbRow[0]); 12 14 13 $DbResult = $this->Database->select('User', '*', 'Login != "Anonym" ORDER BY Name'); 14 while($User = $DbResult->fetch_assoc()) 15 { 16 if($User['ICQ'] > 0) $ICQ = $User['ICQ']; else $ICQ = ' '; 17 if($User['PhoneNumber'] > 0) $Phone = $User['PhoneNumber']; else $Phone = ' '; 15 $Output = $PageList['Output']; 16 $Output .= '<table class="WideTable" style="font-size: small;">'; 17 18 $TableColumns = array( 19 array('Name' => 'Name', 'Title' => 'Jméno'), 20 array('Name' => 'Email', 'Title' => 'E-mail'), 21 array('Name' => 'ICQ', 'Title' => 'ICQ'), 22 array('Name' => 'PhoneNumber', 'Title' => 'Telefón'), 23 array('Name' => '', 'Title' => 'Počítače'), 24 ); 25 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 26 $Output .= $Order['Output']; 27 28 $Query = 'SELECT * FROM `User` WHERE (`Login` != "Anonym") '.$Order['SQL'].$PageList['SQLLimit']; 29 30 $DbResult = $this->Database->query($Query); 31 while($User = $DbResult->fetch_assoc()) 32 { 33 if($User['ICQ'] > 0) $User['ICQ'] = $User['ICQ']; 34 else $User['ICQ'] = ' '; 35 if($User['PhoneNumber'] > 0) $User['PhoneNumber'] = $User['PhoneNumber']; 36 else $User['PhoneNumber'] = ' '; 18 37 19 38 $DbResult2 = $this->Database->query('SELECT Name, Id FROM NetworkDevice WHERE Member = (SELECT Id FROM Member WHERE Member.ResponsibleUser = '.$User['Id'].') AND Used=1 ORDER BY Name'); … … 23 42 $Devices[] = $Device['Name']; 24 43 } 25 $Devices = implode(', ', $Devices); 26 $Output .= '<tr><td>'.$User['Name'].'</td><td>'.$User['Email'].' </td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Devices.'</td></tr>'; 44 $User['Devices'] = implode(', ', $Devices); 45 46 $Output .= '<tr><td>'.$User['Name'].'</td>'. 47 '<td>'.$User['Email'].'</td>'. 48 '<td>'.$User['ICQ'].'</td>'. 49 '<td>'.$User['PhoneNumber'].'</td>'. 50 '<td>'.$User['Devices'].'</td></tr>'; 27 51 } 28 52 $Output .= '</table>'; 53 $Output .= $PageList['Output']; 54 29 55 return($Output); 30 56 }
Note:
See TracChangeset
for help on using the changeset viewer.