tests
This commit is contained in:
parent
a5a50f6703
commit
b0c3919ab1
@ -24,7 +24,7 @@ spl_autoload_register(function ($class_name) {
|
||||
$items = [];
|
||||
$res = db::c()->query('SELECT name,img,type,id FROM inventory WHERE owner = 11263 AND dressed = 1');
|
||||
foreach ($res->fetch_assoc() as $value) {
|
||||
$items[$value['id']] = $value;
|
||||
$items[$value['name']] = $value;
|
||||
}
|
||||
print_r($items);
|
||||
|
||||
|
44
classes/showpers.php
Normal file
44
classes/showpers.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (c) 2018.
|
||||
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
||||
* Project name: Battles-Game
|
||||
*/
|
||||
|
||||
class showpers
|
||||
{
|
||||
private $pers_data;
|
||||
private $weared_items;
|
||||
|
||||
private function __construct($id)
|
||||
{
|
||||
if (!$this->pers_data) {
|
||||
$query = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $id)->fetch_assoc();
|
||||
$this->pers_data = $query;
|
||||
}
|
||||
if (!$this->weared_items) {
|
||||
$query = db::c()->query('SELECT `name`, `img`, `type` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 1', $id);
|
||||
$this->weared_items = $query;
|
||||
}
|
||||
}
|
||||
|
||||
private function dgfs()
|
||||
{
|
||||
$w_items['sergi'] = $this->pers_data['sergi'];
|
||||
$w_items['kulon'] = $this->pers_data['kulon'];
|
||||
$w_items['weap'] = $this->pers_data['weap'];
|
||||
$w_items['bron'] = $this->pers_data['bron'];
|
||||
$w_items['r1'] = $this->pers_data['r1'];
|
||||
$w_items['r2'] = $this->pers_data['r2'];
|
||||
$w_items['r3'] = $this->pers_data['r3'];
|
||||
$w_items['helm'] = $this->pers_data['helm'];
|
||||
$w_items['perchi'] = $this->pers_data['perchi'];
|
||||
$w_items['shit'] = $this->pers_data['shit'];
|
||||
$w_items['boots'] = $this->pers_data['boots'];
|
||||
$w_items['rubax'] = $this->pers_data['rubax'];
|
||||
$w_items['plaw'] = $this->pers_data['plaw'];
|
||||
$w_items['rune1'] = $this->pers_data['rune1'];
|
||||
$w_items['rune2'] = $this->pers_data['rune2'];
|
||||
$w_items['rune3'] = $this->pers_data['rune3'];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user