39 lines
803 B
PHP
39 lines
803 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($userid)
|
||
|
{
|
||
|
$user_query = db::c()->query('SELECT * FROM users WHERE id = ?i', $userid)->fetch_assoc();
|
||
|
foreach ($this as $key => $value) {
|
||
|
if (isset($user_query[$key])) {
|
||
|
$this->$key = $user_query[$key];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|