battles/classes/User.php
2020-07-03 16:49:39 +03:00

44 lines
961 B
PHP

<?php
class User
{
public $id;
public $login;
public $email;
private $pass;
public $realname;
public $borndate;
public $info;
public $level;
public $align;
public $clan;
public $money;
public $strength;
public $dexterity;
public $intuition;
public $endurance;
public $intelligence;
public $wisdom;
public $ip;
public $session_id;
public $admin;
public $enter_game;
public $room;
public $block;
// Пока несуществующие, для совместимости.
public $married;
public $exp;
public $stats;
public function __construct($user)
{
$user_query = db::c()->query('SELECT * FROM users WHERE id = ?i OR login = "?s"', $user, $user)->fetch_assoc();
foreach ($this as $key => $value) {
if (isset($user_query[$key])) {
$this->$key = $user_query[$key];
}
}
}
}