This commit is contained in:
Igor Barkov [iwork] 2018-11-01 17:08:24 +02:00
parent 9d53e239c0
commit f803801042

View File

@ -825,7 +825,9 @@ function timeOut($ttm)
return $out;
}
$img = [
function show_eff_inf($u, $type)
{
$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",
10 => "magic/chains.gif", 11 => "travma.gif", 12 => "travma.gif", 13 => "travma.gif",
@ -835,27 +837,24 @@ $img = [
220 => "magic/wis_earth_def3.gif", 221 => "magic/wis_fire_def1.gif", 222 => "magic/wis_fire_def2.gif", 223 => "magic/wis_fire_def3.gif",
224 => "magic/wis_water_def1.gif", 225 => "magic/wis_water_def2.gif", 226 => "magic/wis_water_def3.gif", 227 => "magic/attack_defence.gif",
1022 => "sh/hidden.gif"
];
function show_eff_inf($u, $type)
{
global $img;
];
$r = '';
$and = '';
if ($type == 1) {
$and = " AND `type` != 1022";
}
$effs = db::c()->query('SELECT * FROM `effects` WHERE `owner` = ?i'.$and, $u)->fetch_assoc();
$etype = $effs['type'];
if ($type == 1) {
while ($effs) {
if ($effs['type'] == 11 || $effs['type'] == 12 || $effs['type'] == 13 || $effs['type'] == 14) {
if ($effs['type'] == 11) {
if ($etype == 11 || $etype == 12 || $etype == 13 || $etype == 14) {
if ($etype == 11) {
$adds = 'Легкая ';
} elseif ($effs['type'] == 12) {
} elseif ($etype == 12) {
$adds = 'Средняя ';
} elseif ($effs['type'] == 13) {
} elseif ($etype == 13) {
$adds = 'Тяжелая ';
} elseif ($effs['type'] == 14) {
} elseif ($etype == 14) {
$adds = 'Неизлечимая ';
} else {
$adds = '';
@ -864,7 +863,7 @@ function show_eff_inf($u, $type)
$adds = '';
}
$r .= '<div>';
$r .= '<img class="image" src="/i/' . $img[$effs['type']] . '" />';
$r .= '<img class="image" src="/i/{$img[$etype]}">';
$r .= '<span class="title">' . $adds . $effs['name'] . '</span>';
if ($effs['sleep'] != 0) {
$r .= '<div class="timeleft">Эффект заморожен</div>';
@ -875,23 +874,8 @@ function show_eff_inf($u, $type)
}
} else {
while ($effs) {
if ($effs['type'] == 11 || $effs['type'] == 12 || $effs['type'] == 13 || $effs['type'] == 14) {
if ($effs['type'] == 11) {
$adds = 'Легкая ';
} elseif ($effs['type'] == 12) {
$adds = 'Средняя ';
} elseif ($effs['type'] == 13) {
$adds = 'Тяжелая ';
} elseif ($effs['type'] == 14) {
$adds = 'Неизлечимая ';
} else {
$adds = '';
}
} else {
$adds = '';
}
$r .= '<div>';
$r .= '<img class="image" src="/i/' . $img[$effs['type']] . '" /> <a href=\'main.php?edit=1&del=1&efid=' . $effs['id'] . '\' onclick=\'return confirm("Удалить ' . $adds . $effs['name'] . '?")\'><img src=\'i/clear.gif\' style=\'float: right;\' /></a>';
$r .= '<img class="image" src="/i/' . $img[$etype] . '" /> <a href=\'main.php?edit=1&del=1&efid=' . $effs['id'] . '\' onclick=\'return confirm("Удалить ' . $adds . $effs['name'] . '?")\'><img src=\'i/clear.gif\' style=\'float: right;\' /></a>';
$r .= '<span class="title">' . $adds . $effs['name'] . '</span>';
if ($effs['sleep'] != 0) {
$r .= '<div class="timeleft">Эффект заморожен</div>';