Файл: public_html/testfile.php
Строк: 33
<?php
include_once ('core/base.php');
include_once ('core/head.php');
$users = $db->query("SELECT * FROM `users`");
$count = 0;
while($us = $users->fetch_object())
{
$head = $us->head > 0 ? $db->query("SELECT * FROM `inventory` WHERE `id` = '".$us->head."'")->num_rows : 'NotWeared';
$body = $us->body > 0 ? $db->query("SELECT * FROM `inventory` WHERE `id` = '".$us->body."'")->num_rows : 'NotWeared';
$boots = $us->boots > 0 ? $db->query("SELECT * FROM `inventory` WHERE `id` = '".$us->boots."'")->num_rows : 'NotWeared';
$weapon = $us->weapon > 0 ? $db->query("SELECT * FROM `inventory` WHERE `id` = '".$us->weapon."'")->num_rows : 'NotWeared';
$sequence = $head.$body.$boots.$weapon;
if(in_array($sequence, ['0000','0001','0010','0011','0100','0101','0110','0111','1000','1001','1010','1011','1100','1101','1110']))
{
echo '<a class="link" href="/user/'.$us->id.'">'.$us->login.'[Head'.$head.' | Body'.$body.' | Boots'.$boots.' | Weapon'.$weapon.']</a>';
$count++;
}
}
echo '<div class="b">Результатов: '.$count.'</div>';
include_once ('core/foot.php');