. */ class User { public $id; public $accounts; public $categories; public $preferences; function GetCategory($id) { if ($id == "") { $cat["id"] = ""; $cat["forecolor"] = "black"; $cat["backcolor"] = "#3DEB3D"; $s = "background-color:" . $cat["backcolor"] . ";"; $s .= "color:" . $cat["forecolor"] . ";"; $cat["style"] = $s; return $cat; } foreach($this->categories as $i => $category) if ($category["id"] == "$id") return $category; return LoadCategory($this, $id); } function IsAccountBlocked($id) { foreach($this->accounts as $i => $account) if ($account["id"] == "$id") return $account["blocked"] == "1"; return false; } function GetAccountName($id) { foreach($this->accounts as $i => $account) if ($account["id"] == "$id") return $account["name"]; return ""; } } ?>