At home users Fix
This commit is contained in:
parent
daa0759544
commit
ec4b808d33
@ -3,7 +3,7 @@ class UserManager
|
|||||||
{
|
{
|
||||||
public function getUsers () {
|
public function getUsers () {
|
||||||
try {
|
try {
|
||||||
$allUsers = Db::loadAll ("SELECT user_id, username FROM users");
|
$allUsers = Db::loadAll ("SELECT user_id, username, at_home FROM users");
|
||||||
return $allUsers;
|
return $allUsers;
|
||||||
} catch(PDOException $error) {
|
} catch(PDOException $error) {
|
||||||
echo $error->getMessage();
|
echo $error->getMessage();
|
||||||
|
@ -22,10 +22,10 @@ class Home extends Template
|
|||||||
$usersAtHome = '';
|
$usersAtHome = '';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$i++;
|
|
||||||
if ($user['at_home'] == 'true') {
|
if ($user['at_home'] == 'true') {
|
||||||
|
$i++;
|
||||||
$usersAtHome .= $user['username'];
|
$usersAtHome .= $user['username'];
|
||||||
if ($usersAtHome != "" && isset($users[$i + 1])){
|
if ($usersAtHome != "" && isset($users[$i + 1]) && $users[$i + 1]['at_home'] == 'true'){
|
||||||
$usersAtHome .= ', ';
|
$usersAtHome .= ', ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user