Fatal error: Uncaught Error: Cannot use object of type User as array
This commit is contained in:
+96
-143
@@ -7,11 +7,14 @@
|
||||
*/
|
||||
|
||||
session_start();
|
||||
if (!isset($_SESSION['uid'])) header("Location: index.php");
|
||||
if (empty($_SESSION['uid'])) {
|
||||
header("Location: index.php");
|
||||
}
|
||||
require_once 'functions.php';
|
||||
|
||||
if (!empty($_GET['teleport']) AND $user['admin'] == 1)
|
||||
if (!empty($_GET['teleport']) and $user->admin == 1) {
|
||||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -23,24 +26,25 @@ if (!empty($_GET['teleport']) AND $user['admin'] == 1)
|
||||
</head>
|
||||
<body>
|
||||
<div style="float: right;">
|
||||
<?php if ($user['admin'] == 1): ?>
|
||||
<?php if ($user->admin == 1): ?>
|
||||
<button onclick="location.href='?teleport=1'">Телепорт на ЦП</button>
|
||||
<?php endif; ?>
|
||||
<input type="button" onClick="location.href='main.php';" value="Вернуться">
|
||||
</div>
|
||||
<h2>Особые умения</h2>
|
||||
<div align=center id=hint3></div>
|
||||
|
||||
<?php
|
||||
|
||||
# ORDEN PHP
|
||||
$al = db::c()->query('SELECT `accses`,`name` FROM `aligns` WHERE `align` = ?i', $user['align'])->fetch_assoc();
|
||||
$al = db::c()->query('SELECT `accses`,`name` FROM `aligns` WHERE `align` = ?i', $user->align)->fetch_assoc();
|
||||
$moj = expa($al['accses']);
|
||||
|
||||
function imp($array)
|
||||
{
|
||||
$str = '';
|
||||
foreach ($array as $k => $v) $str .= $k . ";" . $v . ";";
|
||||
foreach ($array as $k => $v) {
|
||||
$str .= $k . ";" . $v . ";";
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
@@ -48,53 +52,62 @@ function expa($str)
|
||||
{
|
||||
$rarray = '';
|
||||
$array = explode(";", $str);
|
||||
for ($i = 0; $i <= count($array) - 2; $i = $i + 2) $rarray[$array[$i]] = $array[$i + 1];
|
||||
for ($i = 0; $i <= count($array) - 2; $i = $i + 2) {
|
||||
$rarray[$array[$i]] = $array[$i + 1];
|
||||
}
|
||||
return $rarray;
|
||||
}
|
||||
|
||||
if (in_array($_POST['use'], array_keys($moj))) {
|
||||
//echo $_GET['use'];
|
||||
$abil = mysql_fetch_array(mysql_query("SELECT `abil` FROM `users` WHERE `id`='{$user['id']}';"));
|
||||
$abil = db::c()->query('SELECT abil FROM users WHERE id = ?i', $user->id)->fetch_assoc();
|
||||
$abil = unserialize($abil['abil']);
|
||||
switch ($_POST['use']) {
|
||||
case "cure150":
|
||||
include("./magic/cure150.php");
|
||||
break;
|
||||
case "al_neut_power":
|
||||
if ($abil[0] > 0 && $user['align'] == 2) {
|
||||
if ($abil[0] > 0 && $user->align == 2) {
|
||||
include("./magic/al_neut_power.php");
|
||||
if ($outok == 1) {
|
||||
$abil[0] -= 1;
|
||||
mysql_query("UPDATE `users` SET `abil`='" . serialize($abil) . "' WHERE `id`='{$user['id']}';");
|
||||
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
|
||||
}
|
||||
} elseif ($user['align'] != 2) include("./magic/al_neut_power.php");
|
||||
} elseif ($user->align != 2) {
|
||||
include("./magic/al_neut_power.php");
|
||||
}
|
||||
break;
|
||||
case "ct1":
|
||||
if ($abil[0] > 0 && $user['align'] == 6) {
|
||||
if ($abil[0] > 0 && $user->align == 6) {
|
||||
include("./magic/ct1.php");
|
||||
if ($outok == 1) {
|
||||
$abil[0] -= 1;
|
||||
mysql_query("UPDATE `users` SET `abil`='" . serialize($abil) . "' WHERE `id`='{$user['id']}';");
|
||||
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
|
||||
}
|
||||
} elseif ($user['align'] != 6) include("./magic/ct1.php");
|
||||
} elseif ($user->align != 6) {
|
||||
include("./magic/ct1.php");
|
||||
}
|
||||
break;
|
||||
case "ct2":
|
||||
if ($abil[1] > 0 && $user['align'] == 6) {
|
||||
if ($abil[1] > 0 && $user->align == 6) {
|
||||
include("./magic/ct2.php");
|
||||
if ($outok == 1) {
|
||||
$abil[1] -= 1;
|
||||
mysql_query("UPDATE `users` SET `abil`='" . serialize($abil) . "' WHERE `id`='{$user['id']}';");
|
||||
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
|
||||
}
|
||||
} elseif ($user['align'] != 6) include("./magic/ct2.php");
|
||||
} elseif ($user->align != 6) {
|
||||
include("./magic/ct2.php");
|
||||
}
|
||||
break;
|
||||
case "ct3":
|
||||
if ($abil[2] > 0 && $user['align'] == 6) {
|
||||
if ($abil[2] > 0 && $user->align == 6) {
|
||||
include("./magic/ct3.php");
|
||||
if ($outok == 1) {
|
||||
$abil[2] -= 1;
|
||||
mysql_query("UPDATE `users` SET `abil`='" . serialize($abil) . "' WHERE `id`='{$user['id']}';");
|
||||
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
|
||||
}
|
||||
} elseif ($user['align'] != 6) include("./magic/ct3.php");
|
||||
} elseif ($user->align != 6) {
|
||||
include("./magic/ct3.php");
|
||||
}
|
||||
break;
|
||||
|
||||
case "sleep":
|
||||
@@ -151,45 +164,53 @@ if (in_array($_POST['use'], array_keys($moj))) {
|
||||
break;
|
||||
case "attack_t":
|
||||
include("./magic/attack_t.php");
|
||||
if ($skipper == 1) /* header("Location:fbattle.php");*/
|
||||
die("<script>location.href='fbattle.php';</script>");
|
||||
if ($skipper == 1) {
|
||||
header("Location:fbattle.php");
|
||||
exit();
|
||||
}
|
||||
break;
|
||||
case "battack":
|
||||
include("./magic/ebattack.php");
|
||||
break;
|
||||
|
||||
case "attackk_close":
|
||||
if ($abil[1] > 0 && $user['align'] == 2) {
|
||||
if ($abil[1] > 0 && $user->align == 2) {
|
||||
include("./magic/attackk_close.php");
|
||||
if ($outok == 1) {
|
||||
$abil[1] -= 1;
|
||||
mysql_query("UPDATE `users` SET `abil`='" . serialize($abil) . "' WHERE `id`='{$user['id']}';");
|
||||
die("<script>location.href='fbattle.php';</script>");
|
||||
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
|
||||
header("Location:fbattle.php");
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
include("./magic/attackk_close.php");
|
||||
die("<script>location.href='fbattle.php';</script>");
|
||||
header("Location:fbattle.php");
|
||||
exit();
|
||||
}
|
||||
break;
|
||||
|
||||
case "attackk_open":
|
||||
if ($abil[1] > 0 && $user['align'] == 2) {
|
||||
if ($abil[1] > 0 && $user->align == 2) {
|
||||
include("./magic/attackk_open.php");
|
||||
if ($outok == 1) {
|
||||
$abil[2] -= 1;
|
||||
mysql_query("UPDATE `users` SET `abil`='" . serialize($abil) . "' WHERE `id`='{$user['id']}';");
|
||||
die("<script>location.href='fbattle.php';</script>");
|
||||
db::c()->query('UPDATE users SET abil = "?s" WHERE id = ?i', serialize($abil), $user->id);
|
||||
header("Location:fbattle.php");
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
include("./magic/attackk_open.php");
|
||||
die("<script>location.href='fbattle.php';</script>");
|
||||
header("Location:fbattle.php");
|
||||
exit();
|
||||
}
|
||||
break;
|
||||
|
||||
case "brat":
|
||||
include("./magic/brat.php");
|
||||
if ($skipper == 1) /* header("Location:fbattle.php"); */
|
||||
die("<script>location.href='fbattle.php';</script>");
|
||||
if ($skipper == 1) {
|
||||
header("Location:fbattle.php");
|
||||
exit();
|
||||
}
|
||||
break;
|
||||
|
||||
case "vampir":
|
||||
@@ -225,7 +246,6 @@ if (in_array($_POST['use'], array_keys($moj))) {
|
||||
|
||||
echo "<table><tr><td><br><br>";
|
||||
foreach ($moj as $k => $v) {
|
||||
//echo $k;
|
||||
switch ($k) {
|
||||
case "sleep":
|
||||
$script_name = "runmagic0";
|
||||
@@ -410,33 +430,34 @@ foreach ($moj as $k => $v) {
|
||||
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
|
||||
$abil = unserialize($abil['abil']);
|
||||
|
||||
if ($user['align'] == 2) {
|
||||
if ($k == 'al_neut_power') {
|
||||
if ($abil[0] < 1) $action_ok = 0;
|
||||
if ($user->align == 2) {
|
||||
if ($k == 'al_neut_power' && $abil[0] < 1) {
|
||||
$action_ok = 0;
|
||||
}
|
||||
if ($k == 'attackk_close') {
|
||||
if ($abil[1] < 1) $action_ok = 0;
|
||||
if ($k == 'attackk_close' && $abil[1] < 1) {
|
||||
$action_ok = 0;
|
||||
}
|
||||
if ($k == 'attackk_open') {
|
||||
if ($abil[2] < 1) $action_ok = 0;
|
||||
if ($k == 'attackk_open' && $abil[2] < 1) {
|
||||
$action_ok = 0;
|
||||
}
|
||||
}
|
||||
if ($user['align'] == 6) {
|
||||
if ($k == 'ct1') {
|
||||
if ($abil[0] < 1) $action_ok = 0;
|
||||
if ($user->align == 6) {
|
||||
if ($k == 'ct1' && $abil[0] < 1) {
|
||||
$action_ok = 0;
|
||||
}
|
||||
if ($k == 'ct2') {
|
||||
if ($abil[1] < 1) $action_ok = 0;
|
||||
if ($k == 'ct2' && $abil[1] < 1) {
|
||||
$action_ok = 0;
|
||||
}
|
||||
if ($k == 'ct3') {
|
||||
if ($abil[2] < 1) $action_ok = 0;
|
||||
if ($k == 'ct3' && $abil[2] < 1) {
|
||||
$action_ok = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($action_ok > 0) print "<a onclick=\"javascript:$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a> ";
|
||||
if ($action_ok > 0) {
|
||||
print "<a onclick=\"javascript:$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a> ";
|
||||
}
|
||||
}
|
||||
if ($user['align'] == 2) // Нейтралы
|
||||
if ($user->align == 2) // Нейтралы
|
||||
{
|
||||
|
||||
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
|
||||
@@ -448,7 +469,7 @@ if ($user['align'] == 2) // Нейтралы
|
||||
echo("<img src='i/magic/attackk_open.gif' title='Кулачное закрытое нападение'> Кулачное закрытое нападение - " . $abil[2] . "<br />");
|
||||
}
|
||||
|
||||
if ($user['align'] == 6) // Свет
|
||||
if ($user->align == 6) // Свет
|
||||
{
|
||||
|
||||
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
|
||||
@@ -463,78 +484,12 @@ if ($user['align'] == 6) // Свет
|
||||
echo "</td></tr></table>";
|
||||
|
||||
#RELIKT PHP
|
||||
function vip_relicts()
|
||||
{
|
||||
global $user;
|
||||
$r = '';
|
||||
if ($user['vip'] > 0 && $user['vip_time'] > time()) {
|
||||
$abils = db::c()->query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `dontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = ?i', $user['id'])->fetch_assoc();
|
||||
if ($abils['sokr'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=2", "target")\'><img src=\'i/sh/devastate.gif\' title=\'Сокрушение\' /></a><div class="amount">' . $abils['sokr'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/devastate.gif\' style=\'opacity: 0.3;\' title=\'Сокрушение\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['zash'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=3", "target")\'><img src=\'i/sh/defence.gif\' title=\'Защита от оружия\' /></a><div class="amount">' . $abils['zash'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/defence.gif\' style=\'opacity: 0.3;\' title=\'Защита от оружия\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['invisible'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=1", "target")\'><img src=\'i/sh/hidden.gif\' title=\'Невидимость\' /></a><div class="amount">' . $abils['invisible'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/hidden.gif\' style=\'opacity: 0.3;\' title=\'Невидимость\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['attack'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=4", "target")\'><img src=\'i/sh/attack.gif\' title=\'Нападение\' /></a><div class="amount">' . $abils['attack'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attack.gif\' style=\'opacity: 0.3;\' title=\'Нападение\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['bloodattack'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=5", "target")\'><img src=\'i/sh/attackb.gif\' title=\'Кровавое нападение\' /></a><div class="amount">' . $abils['bloodattack'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attackb.gif\' style=\'opacity: 0.3;\' title=\'Кровавое нападение\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['sleep30'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=6", "target")\'><img src=\'i/sh/silence30.gif\' title=\'Заклятие молчания 30 минут\' /></a><div class="amount">' . $abils['sleep30'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/silence30.gif\' style=\'opacity: 0.3;\' title=\'Заклятие молчания 30 минут\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['travmoff'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=7", "target")\'><img src=\'i/sh/cure3.gif\' title=\'Лечение травм\' /></a><div class="amount">' . $abils['travmoff'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/cure3.gif\' style=\'opacity: 0.3;\' title=\'Лечение травм\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['dontattack'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=8", "target")\'><img src=\'i/magic/attack_defence.gif\' title=\'Защита от нападений\' /></a><div class="amount">' . $abils['dontattack'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/magic/attack_defence.gif\' style=\'opacity: 0.3;\' title=\'Защита от нападений\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['unsleep'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=9", "target")\'><img src=\'i/magic/sleep_off.gif\' title=\'Снять заклятие молчания\'/></a><div class="amount">' . $abils['unsleep'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/sleep_off.gif\' style=\'opacity: 0.3;\' title=\'Снять заклятие молчания\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($abils['pers_attack'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?use=10", "target")\'><img src=\'i/sh/attackb.gif\' title=\'Личное Кровавое нападение\' /></a><div class="amount">' . $abils['pers_attack'] . '</div></div>';
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/attackb.gif\' style=\'opacity: 0.3;\' title=\'Личное Кровавое нападение\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
} elseif ($user['vip'] == 0) {
|
||||
$r = 'Вы не вип пользователь ...';
|
||||
} elseif ($user['vip_time'] <= time()) {
|
||||
$r = 'Вы не вип пользователь ...';
|
||||
} else {
|
||||
$r = 'Ошибка ...';
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
function klan_relicts()
|
||||
{
|
||||
global $user;
|
||||
$r = '';
|
||||
if ($user['klan'] > 0) {
|
||||
$abils = db::c()->query('SELECT `id`, `klan`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_klan` WHERE `klan` = ?i', $user['klan'])->fetch_assoc();
|
||||
if ($user->clan > 0) {
|
||||
$abils = db::c()->query('SELECT `id`, `klan`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_klan` WHERE `klan` = ?i', $user->clan)->fetch_assoc();
|
||||
if ($abils['sleep15'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?useds=1", "target")\'><img src=\'i/sh/silence15.gif\' title=\'Заклятие молчания 15 минут\' /></a><div class="amount">' . $abils['sleep15'] . '</div></div>';
|
||||
} else {
|
||||
@@ -620,7 +575,7 @@ function user_relicts()
|
||||
{
|
||||
global $user;
|
||||
$r = '';
|
||||
$abils = db::c()->query('SELECT `id`, `uid`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_user` WHERE `uid` = ?i', $user['id'])->fetch_assoc();
|
||||
$abils = db::c()->query('SELECT `id`, `uid`, `sleep15`, `sleep30`, `closebattle`, `heal20`, `heal35`, `heal50`, `travmoff`, `attack`, `bloodattack`, `death`, `comment`, `openbattle`, `reamdeath`, `clone`, `unclone` FROM `abils_user` WHERE `uid` = ?i', $user->id)->fetch_assoc();
|
||||
if ($abils['sleep15'] > 0) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "?used=1", "target")\'><img src=\'i/sh/silence15.gif\' title=\'Заклятие молчания 15 минут\' /></a><div class="amount">' . $abils['sleep15'] . '</div></div>';
|
||||
} else {
|
||||
@@ -696,7 +651,7 @@ function user_relicts()
|
||||
} else {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\'><img src=\'i/sh/antimirror.gif\' style=\'opacity: 0.3;\' title=\'Эфирное воздействие\' /></a><div class="amount">0</div></div>';
|
||||
}
|
||||
if ($user['id'] == 10022 || $user['id'] == 9081) {
|
||||
if ($user->admin) {
|
||||
$r .= '<div class="item"><a href=\'javascript: void(0);\' onclick=\'runmagic1("Введите имя персонажа", "main.php?edit=1&use=3651943", "target")\'><img src=\'i/sh/spell_luck.gif\' title=\'Благословление Мусорщика\' /></a><div class="amount">~</div></div>';
|
||||
}
|
||||
return $r;
|
||||
@@ -794,9 +749,9 @@ function show_byu($type)
|
||||
{
|
||||
global $user;
|
||||
$type = $type + 20;
|
||||
if ($user['klan'] != '') {
|
||||
$clan = db::c()->query('SELECT `id`, `glava` FROM `clans` WHERE `id` = ?i', $user['klan'])->fetch_assoc();
|
||||
if ($clan['glava'] == $user['id']) {
|
||||
if ($user->clan) {
|
||||
$clan = db::c()->query('SELECT `id`, `glava` FROM `clans` WHERE `id` = ?i', $user->clan)->fetch_assoc();
|
||||
if ($clan['glava'] == $user->id) {
|
||||
$r = '<div style="text-align: center;"><a href="javascript:void(0);" class="byu_klan" id="' . $type . '">купить 1 шт.</a></div>';
|
||||
} else {
|
||||
$r = '<div style="text-align: center;"><a href="javascript:void(0);">Вы не глава</a></div>';
|
||||
@@ -807,15 +762,21 @@ function show_byu($type)
|
||||
return $r;
|
||||
}
|
||||
|
||||
$is_ = db::c()->query('SELECT `id` FROM `abils_user` WHERE `uid` = ?i', $user['id'])->fetch_assoc();
|
||||
if (empty($is_['id'])) db::c()->query('INSERT INTO `abils_user` (`uid`) VALUES (?i)', $user['id']);
|
||||
$is_ = db::c()->query('SELECT `id` FROM `abils_user` WHERE `uid` = ?i', $user->id)->fetch_assoc();
|
||||
if (empty($is_['id'])) {
|
||||
db::c()->query('INSERT INTO `abils_user` (`uid`) VALUES (?i)', $user->id);
|
||||
}
|
||||
|
||||
$is_ = db::c()->query('SELECT `id` FROM `abils_vip` WHERE `uid` = ?i', $user['id'])->fetch_assoc();
|
||||
if (empty($is_['id'])) db::c()->query('INSERT INTO `abils_vip` (`uid`) VALUES (?i)', $user['id']);
|
||||
$is_ = db::c()->query('SELECT `id` FROM `abils_vip` WHERE `uid` = ?i', $user->id)->fetch_assoc();
|
||||
if (empty($is_['id'])) {
|
||||
db::c()->query('INSERT INTO `abils_vip` (`uid`) VALUES (?i)', $user->id);
|
||||
}
|
||||
|
||||
if (empty($user['klan'])) {
|
||||
$is_ = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user['klan'])->fetch_assoc();
|
||||
if (empty($is_['id'])) db::c()->query('INSERT INTO `abils_klan` (`klan`) VALUES (?i)', $user['klan']);
|
||||
if (empty($user->clan)) {
|
||||
$is_ = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user->clan)->fetch_assoc();
|
||||
if (empty($is_['id'])) {
|
||||
db::c()->query('INSERT INTO `abils_klan` (`klan`) VALUES (?i)', $user->clan);
|
||||
}
|
||||
}
|
||||
|
||||
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['uid'])->fetch_assoc();
|
||||
@@ -840,12 +801,6 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
|
||||
<?= klan_relicts(); ?>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div style="padding-top: 15px;">
|
||||
<fieldset style="width: 400px;">
|
||||
<legend>Vip :</legend>
|
||||
<?= vip_relicts(); ?>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div style="padding-top: 13px; padding-bottom: 13px;">
|
||||
<fieldset style="width: 400px;">
|
||||
<legend>Счёт</legend>
|
||||
@@ -1126,7 +1081,7 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'fancy/buy.php',
|
||||
data: "type=" + type + "&user="+<?=$user['id'];?>+"",
|
||||
data: "type=" + type + "&user=" + <?= $user->id ?> + "",
|
||||
success: function (data) {
|
||||
if (data === 'success') {
|
||||
$(".child").html('<b style="color: Red;">' + types_user[type - 1] + ' успешно куплено</b>');
|
||||
@@ -1146,7 +1101,7 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'fancy/buy_klan.php',
|
||||
data: "type=" + type + "&user="+<?=$user['id'];?>+"",
|
||||
data: "type=" + type + "&user=" + <?= $user->id ?> + "",
|
||||
success: function (data) {
|
||||
if (data === 'success') {
|
||||
$(".child").html('<b style="color: Red;">' + types_klan[type - 21] + ' успешно куплено</b>');
|
||||
@@ -1161,6 +1116,4 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
</script>
|
||||
Reference in New Issue
Block a user