Не отображался список эффектов. Убрал ненужные элементы управления, итд.

This commit is contained in:
lopar 2021-02-01 01:51:56 +02:00
parent eb33ef76cf
commit da410d57c8
2 changed files with 14 additions and 14 deletions

View File

@ -5,6 +5,7 @@
* Project name: Battles-Game * Project name: Battles-Game
*/ */
use Battles\Database\DBPDO;
use Battles\Travel; use Battles\Travel;
use Battles\User; use Battles\User;
@ -398,9 +399,8 @@ function timeOut($ttm)
return $out; return $out;
} }
function show_eff_inf($u) function show_eff_inf(int $u): string
{ {
global $db;
$img = [ $img = [
1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif", 1 => "travma.gif", 2 => "magic/sleep.gif", 3 => "magic/sleepf.gif", 4 => "magic/haos.gif",
5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif", 5 => "magic/obezl.gif", 6 => "expx15.gif", 7 => "euphoria.png", 8 => "sleep_obj.gif",
@ -414,22 +414,22 @@ function show_eff_inf($u)
]; ];
$r = ''; $r = '';
$effs = $db->ofetchAll('SELECT * FROM users_effects WHERE type != 20 AND owner_id = ?', $u);
$effs = DBPDO::INIT()->ofetchAll('SELECT * FROM users_effects WHERE owner_id = ?', $u);
$i = 0; $i = 0;
while ($i < count($effs)) { while ($i < count($effs)) {
$timeleft = timeOut($effs[$i]->remaining_time - time());
$r .= '<div>'; $r .= <<<HTML
$r .= '<img class="image" src="/i/' . $img[$effs->type] . '" /> <a href=\'main.php?edit=1&del=1&efid=' . $effs->effect_id . '\' onclick=\'return confirm("Удалить ' . $effs->name . '?")\'><img src=\'i/clear.gif\' style=\'float: right;\' /></a>'; <div>
$r .= '<span class="title">' . $effs->name . '</span>'; <img class="image" src="/i/{$img[$effs[$i]->type]}">
if ($effs['sleep'] != 0) { <span class="title">{$effs[$i]->name}</span>
$r .= '<div class="timeleft">Эффект заморожен</div>'; <div class="timeleft">$timeleft</div>
} else { </div>
$r .= '<div class="timeleft">' . timeOut($effs->remaining_time - time()) . '</div>'; HTML;
}
$r .= '</div>';
$i++; $i++;
} }
unset($i);
return $r; return $r;
} }

View File

@ -371,7 +371,7 @@ Template::header('Игра');
<div align="center"> <div align="center">
<a href='main.php?edit=1&undress=all' class="button">Снять все</a><BR> <a href='main.php?edit=1&undress=all' class="button">Снять все</a><BR>
<div class="effectList" style="padding-top: 15px; max-height: 150px; width: 220px;"> <div class="effectList" style="padding-top: 15px; max-height: 150px; width: 220px;">
<?= show_eff_inf($user->id, 2) ?> <?= show_eff_inf($user->id) ?>
</div> </div>
</div> </div>
<br> <br>