battles/classes/User.php

39 lines
822 B
PHP
Raw Normal View History

<?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;
2020-07-03 13:33:34 +00:00
public function __construct($user)
{
2020-07-03 13:33:34 +00:00
$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];
}
}
}
}