39 lines
822 B
PHP
39 lines
822 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 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];
|
|
}
|
|
}
|
|
}
|
|
} |