diff --git a/functions.php b/functions.php index 0e1d82a..88887f7 100644 --- a/functions.php +++ b/functions.php @@ -5,6 +5,7 @@ * Project name: Battles-Game */ +use Battles\Database\DBPDO; use Battles\Travel; use Battles\User; @@ -398,9 +399,8 @@ function timeOut($ttm) return $out; } -function show_eff_inf($u) +function show_eff_inf(int $u): string { - global $db; $img = [ 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", @@ -414,22 +414,22 @@ function show_eff_inf($u) ]; $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; while ($i < count($effs)) { - - $r .= '
'; - $r .= ' effect_id . '\' onclick=\'return confirm("Удалить ' . $effs->name . '?")\'>'; - $r .= '' . $effs->name . ''; - if ($effs['sleep'] != 0) { - $r .= '
Эффект заморожен
'; - } else { - $r .= '
' . timeOut($effs->remaining_time - time()) . '
'; - } - $r .= '
'; + $timeleft = timeOut($effs[$i]->remaining_time - time()); + $r .= << + + {$effs[$i]->name} +
$timeleft
+ +HTML; $i++; } + unset($i); return $r; } diff --git a/main.php b/main.php index ad4d56e..d387346 100644 --- a/main.php +++ b/main.php @@ -371,7 +371,7 @@ Template::header('Игра');
Снять все
- id, 2) ?> + id) ?>