From da410d57c84904f3dff840f45f272a92190e5b80 Mon Sep 17 00:00:00 2001 From: lopar Date: Mon, 1 Feb 2021 01:51:56 +0200 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B0=D0=BB=D1=81=D1=8F=20=D1=81=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=BE=D0=BA=20=D1=8D=D1=84=D1=84=D0=B5=D0=BA=D1=82=D0=BE=D0=B2?= =?UTF-8?q?.=20=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BD=D0=B5=D0=BD=D1=83?= =?UTF-8?q?=D0=B6=D0=BD=D1=8B=D0=B5=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D1=8B=20=D1=83=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F,=20=D0=B8=D1=82=D0=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 26 +++++++++++++------------- main.php | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) 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) ?>