Перенос отображения подарков в класс.

This commit is contained in:
Igor Barkov (iwork)
2020-07-03 19:37:24 +03:00
parent 16a2b0e5da
commit 25a6f17d7e
2 changed files with 23 additions and 18 deletions

View File

@@ -6,7 +6,6 @@ class User
public $id;
public $login;
public $email;
private $pass;
public $realname;
public $borndate;
public $info;
@@ -41,4 +40,26 @@ class User
}
}
}
public function showPresents()
{
//$presents = db::c()->query('SELECT img, sender FROM `users_presents` WHERE expiration_date >= "?s" AND owner = ?i', date('Y-m-d'), $user->id);
$presents_query = db::c()->query();
if ($presents_query->getNumRows()) {
echo <<<PRESENT_BEFORE
<div>
<legend>Подарки</legend>
PRESENT_BEFORE;
while ($row = $presents_query->fetch_assoc()) {
echo <<<PRESENT
<img src = "{$row['img']}" title = "{$row['sender']}" alt = "{$row['sender']}" >
PRESENT;
}
echo <<<PRESENT_AFTER
</div>
PRESENT_AFTER;
}
}
}