Database->query('SELECT COUNT(*) FROM `User`');
$DbRow = $DbResult->fetch_row();
$PageList = GetPageList($DbRow[0]);
$Output = $PageList['Output'];
$Output .= '
';
$TableColumns = array(
array('Name' => 'Name', 'Title' => 'Jméno'),
array('Name' => 'Email', 'Title' => 'E-mail'),
array('Name' => 'PhoneNumber', 'Title' => 'Telefón'),
array('Name' => '', 'Title' => 'Počítače'),
);
$Order = GetOrderTableHeader($TableColumns, 'Name', 0);
$Output .= $Order['Output'];
$Query = 'SELECT * FROM `User` '.$Order['SQL'].$PageList['SQLLimit'];
$DbResult = $this->Database->query($Query);
while($User = $DbResult->fetch_assoc())
{
if($User['PhoneNumber'] > 0) $User['PhoneNumber'] = $User['PhoneNumber'];
else $User['PhoneNumber'] = ' ';
$Devices = array();
$DbResult2 = $this->Database->query('SELECT `Id` FROM `Member` WHERE `Member`.`ResponsibleUser` = '.$User['Id']);
while($Member = $DbResult2->fetch_assoc())
{
$DbResult3 = $this->Database->query('SELECT `Name`, `Id` FROM `NetworkDevice` '.
'WHERE `Member` = '.$Member['Id'].' AND `Used`=1 ORDER BY `Name`');
while($Device = $DbResult3->fetch_assoc())
{
$Devices[] = $Device['Name'];
}
}
$User['Devices'] = implode(', ', $Devices);
$Output .= ''.$User['Name'].' | '.
''.$User['Email'].' | '.
''.$User['PhoneNumber'].' | '.
''.$User['Devices'].' |
';
}
$Output .= '
';
$Output .= $PageList['Output'];
return($Output);
}
}