2019-01-09 18:45:40 +00:00
< ? php
/**
* Copyright ( c ) 2019.
* Author : Igor Barkov < lopar . 4 ever @ gmail . com >
* Project name : Battles - Game
* One file to rule ' em all !
*/
2022-01-26 23:15:33 +00:00
use Battles\Database\Db ;
2021-02-01 16:42:52 +00:00
use Battles\Template ;
2021-08-29 22:34:50 +00:00
use Battles\User ;
2021-02-01 16:42:52 +00:00
2019-01-09 18:45:40 +00:00
require_once 'functions.php' ;
2022-01-26 23:15:33 +00:00
if ( ! empty ( $_GET [ 'teleport' ]) && User :: getInstance () -> getAdmin () == 1 ) {
Db :: getInstance () -> execute ( 'update users, online set users.room = 20, online.room = 20 where user_id = id and user_id = ?' , User :: getInstance () -> getId ());
2020-08-30 00:55:53 +00:00
}
2019-01-18 19:59:19 +00:00
2019-01-09 19:49:59 +00:00
# ORDEN PHP
2021-08-29 22:34:50 +00:00
$_POST [ 'use' ] ? ? = null ;
2022-08-09 19:57:43 +00:00
2022-01-26 23:15:33 +00:00
if ( User :: getInstance () -> getAdmin ()) {
2022-08-09 19:57:43 +00:00
$abil = Db :: getInstance () -> execute ( 'SELECT 1 FROM users WHERE id = ?' , User :: getInstance () -> getId ()) -> fetchColumn ();
2021-02-01 20:53:28 +00:00
//$abil = unserialize($abil['abil']);
2019-01-09 19:49:59 +00:00
switch ( $_POST [ 'use' ]) {
2020-08-30 16:48:39 +00:00
case " healing " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/Healing.php " );
2019-01-09 19:49:59 +00:00
break ;
case " ct1 " :
2022-01-26 23:15:33 +00:00
if ( $abil [ 0 ] > 0 && User :: getInstance () -> getAlign () == 6 ) {
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct1.php");
2019-01-09 19:49:59 +00:00
if ( $outok == 1 ) {
$abil [ 0 ] -= 1 ;
2022-08-09 19:57:43 +00:00
Db :: getInstance () -> execute ( 'update users set abil = ? where id = ?' , [ serialize ( $abil ), User :: getInstance () -> getId ()]);
2019-01-09 19:49:59 +00:00
}
2022-01-26 23:15:33 +00:00
} elseif ( User :: getInstance () -> getAlign () != 6 ) {
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct1.php");
2020-08-30 00:55:53 +00:00
}
2019-01-09 19:49:59 +00:00
break ;
case " ct2 " :
2022-01-26 23:15:33 +00:00
if ( $abil [ 1 ] > 0 && User :: getInstance () -> getAlign () == 6 ) {
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct2.php");
2019-01-09 19:49:59 +00:00
if ( $outok == 1 ) {
$abil [ 1 ] -= 1 ;
2022-08-09 19:57:43 +00:00
Db :: getInstance () -> execute ( 'update users set abil = ? where id = ?' , [ serialize ( $abil ), User :: getInstance () -> getId ()]);
2019-01-09 19:49:59 +00:00
}
2022-01-26 23:15:33 +00:00
} elseif ( User :: getInstance () -> getAlign () != 6 ) {
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct2.php");
2020-08-30 00:55:53 +00:00
}
2019-01-09 19:49:59 +00:00
break ;
case " ct3 " :
2022-01-26 23:15:33 +00:00
if ( $abil [ 2 ] > 0 && User :: getInstance () -> getAlign () == 6 ) {
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct3.php");
2019-01-09 19:49:59 +00:00
if ( $outok == 1 ) {
$abil [ 2 ] -= 1 ;
2022-08-09 19:57:43 +00:00
Db :: getInstance () -> execute ( 'update users set abil = ? where id = ?' , [ serialize ( $abil ), User :: getInstance () -> getId ()]);
2019-01-09 19:49:59 +00:00
}
2022-01-26 23:15:33 +00:00
} elseif ( User :: getInstance () -> getAlign () != 6 ) {
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct3.php");
2020-08-30 00:55:53 +00:00
}
2019-01-09 19:49:59 +00:00
break ;
case " ct_all " :
2020-09-16 15:50:38 +00:00
//Заменён на CureInjury.php class. Придумать вызов.
//include("./magic/ct_all.php");
2019-01-09 19:49:59 +00:00
break ;
case " attack " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/eattack.php " );
2019-01-09 19:49:59 +00:00
break ;
case " attack_t " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/attack_t.php " );
2020-08-30 00:55:53 +00:00
if ( $skipper == 1 ) {
header ( " Location:fbattle.php " );
exit ();
}
2019-01-09 19:49:59 +00:00
break ;
case " battack " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/ebattack.php " );
2019-01-09 19:49:59 +00:00
break ;
case " attackk_close " :
2022-01-26 23:15:33 +00:00
if ( $abil [ 1 ] > 0 && User :: getInstance () -> getAlign () == 2 ) {
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/attackk_close.php " );
2019-01-09 19:49:59 +00:00
if ( $outok == 1 ) {
$abil [ 1 ] -= 1 ;
2022-08-09 19:57:43 +00:00
Db :: getInstance () -> execute ( 'update users set abil = ? where id = ?' , [ serialize ( $abil ), User :: getInstance () -> getId ()]);
2020-08-30 00:55:53 +00:00
header ( " Location:fbattle.php " );
exit ();
2019-01-09 19:49:59 +00:00
}
} else {
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/attackk_close.php " );
2020-08-30 00:55:53 +00:00
header ( " Location:fbattle.php " );
exit ();
2019-01-09 19:49:59 +00:00
}
break ;
case " attackk_open " :
2022-01-26 23:15:33 +00:00
if ( $abil [ 1 ] > 0 && User :: getInstance () -> getAlign () == 2 ) {
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/attackk_open.php " );
2019-01-09 19:49:59 +00:00
if ( $outok == 1 ) {
$abil [ 2 ] -= 1 ;
2022-08-09 19:57:43 +00:00
Db :: getInstance () -> execute ( 'update users set abil = ? where id = ?' , [ serialize ( $abil ), User :: getInstance () -> getId ()]);
2020-08-30 00:55:53 +00:00
header ( " Location:fbattle.php " );
exit ();
2019-01-09 19:49:59 +00:00
}
} else {
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/attackk_open.php " );
2020-08-30 00:55:53 +00:00
header ( " Location:fbattle.php " );
exit ();
2019-01-09 19:49:59 +00:00
}
break ;
case " brat " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/brat.php " );
2020-08-30 00:55:53 +00:00
if ( $skipper == 1 ) {
header ( " Location:fbattle.php " );
exit ();
}
2019-01-09 19:49:59 +00:00
break ;
case " vampir " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/vampir.php " );
2019-01-09 19:49:59 +00:00
break ;
case " crush " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/devastate.php " );
2019-01-09 19:49:59 +00:00
break ;
case " def " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/defence.php " );
2019-01-09 19:49:59 +00:00
break ;
case " bexit " :
2022-08-09 19:57:43 +00:00
include_once ( " ./magic/bexit.php " );
2019-01-09 19:49:59 +00:00
break ;
2019-01-09 20:02:42 +00:00
}
}
2022-08-09 19:57:43 +00:00
function show_byu ( $type ) : string
2019-01-09 20:02:42 +00:00
{
$type = $type + 20 ;
2020-09-30 11:12:39 +00:00
$typeName = [
21 => '15 минут тишины' ,
22 => '30 минут тишины' ,
23 => 'изоляция поединка' ,
24 => 'исцеление 20%' ,
25 => 'исцеление 35%' ,
26 => 'исцеление 50%' ,
27 => 'лечение тяжёлой травмы' ,
28 => 'нападение' ,
29 => 'кровавое нападение' ,
30 => 'объятия смерти' ,
31 => 'оставить запись в лог боя' ,
32 => 'снятие изоляции поединка' ,
33 => 'воскрешение' ,
34 => 'порождение клона' ,
35 => 'эфирное воздействие' ,
];
$typeImage = [
21 => 'silence15' ,
22 => 'silence30' ,
23 => 'closebattle' ,
24 => 'cureHP15' ,
25 => 'cureHP45' ,
26 => 'cureHP60' ,
27 => 'cure3' ,
28 => 'attack' ,
29 => 'attackb' ,
30 => 'poison_e' ,
31 => 'note' ,
32 => 'unlockbattle' ,
33 => 'reanimationD' ,
34 => 'mirror' ,
35 => 'antimirror' ,
];
2022-01-26 23:15:33 +00:00
if ( User :: getInstance () -> getClan ()) {
2022-08-09 19:57:43 +00:00
$clan_owner = Db :: getInstance () -> fetchColumn ( 'select owner_id from clans where short_name = ?' , User :: getInstance () -> getClan ());
if ( $clan_owner === User :: getInstance () -> getId ()) {
$r = '<span><a href="javascript:void(0);" class="byu_klan" id="' . $type . '">купить 1 шт.</a></span>' ;
2019-01-09 20:02:42 +00:00
} else {
2022-08-09 19:57:43 +00:00
$r = '<span><a href="javascript:void(0);">Вы не глава</a></span>' ;
2019-01-09 20:02:42 +00:00
}
} else {
2022-08-09 19:57:43 +00:00
$r = '<span><a href="javascript:void(0);">Вы не состоите в клане</a></span>' ;
2019-01-09 20:02:42 +00:00
}
2020-09-30 11:12:39 +00:00
return <<< FFFF
2022-08-09 19:57:43 +00:00
< div class = " items " style = " padding: 2px; " >
< img style = " vertical-align: middle; " class = " slot valign halign " src = " /i/sh/ $typeImage[$type] .gif " alt = " $typeName[$type] " > < span > $typeName [ $type ] </ span > [ $r ]
</ div >
2020-09-30 11:12:39 +00:00
FFFF ;
2019-01-09 20:02:42 +00:00
}
2020-09-30 19:12:34 +00:00
2021-02-01 16:42:52 +00:00
Template :: header ( 'user_abilities' );
2021-02-01 20:53:28 +00:00
echo <<< RELICTS
< span class = 'legend' > Клановые и личные реликты </ span >< br >
< button disabled > sleep15 </ button >
< button disabled > sleep30 </ button >
< button disabled > closebattle </ button >
< button disabled > heal20 </ button >
< button disabled > heal35 </ button >
< button disabled > heal50 </ button >
< button disabled > travmoff </ button >
< button disabled > attack </ button >
< button disabled > bloodattack </ button >
< button disabled > death </ button >
< button disabled > comment </ button >
< button disabled > openbattle </ button >
< button disabled > reamdeath </ button >
< button disabled > clone </ button >
< button disabled > unclone </ button >
RELICTS ;
2022-01-26 23:15:33 +00:00
if ( User :: getInstance () -> getAdmin ()) {
2021-02-01 20:53:28 +00:00
echo <<< A
< button onclick = " location.href='?teleport=1' " > Телепорт на ЦП </ button >
A ;
}
2019-01-09 20:02:42 +00:00
?>
2020-09-30 19:12:34 +00:00
< div style = " float: right; " >
< input type = " button " onClick = " location.href='main.php'; " value = " Вернуться " >
</ div >
< h2 > Особые умения </ h2 >
< div style = " text-align: center; " id = hint3 ></ div >
< div >
< ? php
2022-01-26 23:15:33 +00:00
if ( User :: getInstance () -> getAlign () == 2 || User :: getInstance () -> getAdmin ()) // Нейтралы
2020-09-30 19:12:34 +00:00
{
2022-08-09 19:57:43 +00:00
$abil = [ null , null , null ];
//$abil = db::c()->query('SELECT 1 FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
2021-02-01 20:53:28 +00:00
//$abil = unserialize($abil['abil']);
2020-09-30 19:12:34 +00:00
for ( $i = 0 ; $i < 3 ; $i ++ ) {
if ( ! $abil [ $i ]) {
$abil [ $i ] = 0 ;
}
}
echo ( " <br />Осталось использований:<br /> " );
echo ( " <img src='i/magic/al_neut_power.gif' title='Сила нейтралитета'> Сила нейтралитета - " . $abil [ 0 ] . " <br /> " );
echo ( " <img src='i/magic/attackk_close.gif' title='Кулачное закрытое кровавое нападение'> Кулачное закрытое кровавое нападение - " . $abil [ 1 ] . " <br /> " );
echo ( " <img src='i/magic/attackk_open.gif' title='Кулачное закрытое нападение'> Кулачное закрытое нападение - " . $abil [ 2 ] . " <br /> " );
}
2022-01-26 23:15:33 +00:00
if ( User :: getInstance () -> getAlign () == 6 || User :: getInstance () -> getAdmin ()) // Свет
2020-09-30 19:12:34 +00:00
{
2022-08-09 19:57:43 +00:00
$abil = [ null , null , null ];
//$abil = db::c()->query('SELECT 1 FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
2021-02-01 20:53:28 +00:00
//$abil = unserialize($abil['abil']);
2020-09-30 19:12:34 +00:00
for ( $i = 0 ; $i < 3 ; $i ++ ) {
if ( ! $abil [ $i ]) {
$abil [ $i ] = 0 ;
}
}
echo ( " <br />Осталось использований:<br /> " );
echo ( " <img src='i/magic/ct1.gif' title='Исцелить легкую травму'> Исцелить легкую травму - " . $abil [ 0 ] . " <br /> " );
echo ( " <img src='i/magic/ct2.gif' title='Исцелить среднюю травму'> Исцелить среднюю травму - " . $abil [ 1 ] . " <br /> " );
echo ( " <img src='i/magic/ct3.gif' title='Исцелить тяжелую травму'> Исцелить тяжелую травму - " . $abil [ 2 ] . " <br /> " );
}
?>
</ div >
2019-01-09 20:02:42 +00:00
< h2 > Реликты </ h2 >
< div class = " contentContainer " >
< div >
< fieldset style = " width: 400px; " >
< legend id = " personal " class = " box_user " href = " #inlin " style = " cursor: pointer; "
title = " Магазин персональных реликтов " > Персональные :
</ legend >
2021-02-01 20:53:28 +00:00
[ список в шапке ]
2019-01-09 20:02:42 +00:00
</ fieldset >
</ div >
< div style = " padding-top: 15px; " >
< fieldset style = " width: 400px; " >
< legend id = " klans " class = " box_klan " href = " #inlines " style = " cursor: pointer; "
title = " Магазин клановых реликтов " > Клановые :
</ legend >
2021-02-01 20:53:28 +00:00
[ список в шапке ]
2019-01-09 20:02:42 +00:00
</ fieldset >
</ div >
< div style = " padding-top: 13px; padding-bottom: 13px; " >
< fieldset style = " width: 400px; " >
< legend > Счёт </ legend >
2022-08-09 19:57:43 +00:00
Н а счету < b >< ? = User :: getInstance () -> money () -> getBank () ?> </b>
2019-01-09 20:02:42 +00:00
</ fieldset >
</ div >
</ div >
< div id = " inlin " >
< div class = " items " >
< div class = " title " > Заклятие молчания </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/silence15.gif " /></ div >
< div class = " control " >
Цена : 1.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 1 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Заклятие молчания </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/silence30.gif " /></ div >
< div class = " control " >
Цена : 2.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 2 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Закрыть бой </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/closebattle.gif " /></ div >
< div class = " control " >
Цена : 10.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 3 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Исцеление + 20 %</ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/cureHP15.gif " /></ div >
< div class = " control " >
Цена : 0.50 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 4 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Исцеление + 35 %</ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/cureHP45.gif " /></ div >
< div class = " control " >
Цена : 0.80 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 5 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Исцеление + 50 %</ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/cureHP60.gif " /></ div >
< div class = " control " >
Цена : 1.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 6 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Лечение тяжелой травмы </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/cure3.gif " /></ div >
< div class = " control " >
Цена : 1.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 7 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Нападение </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/attack.gif " /></ div >
< div class = " control " >
Цена : 0.10 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 8 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Нападение ( кровавое ) </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/attackb.gif " /></ div >
< div class = " control " >
Цена : 0.20 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 9 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " style = " display: none; " >
< div class = " title " > Объятия смерти </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/poison_e.gif " /></ div >
< div class = " control " >
Цена : 4.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 10 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Оставить запись в логе боя </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/note.gif " /></ div >
< div class = " control " >
Цена : 0.02 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 11 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Открыть бой </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/unlockbattle.gif " /></ div >
< div class = " control " >
Цена : 20.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 12 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " style = " display: none; " >
< div class = " title " > Поднять мертвого </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/reanimationD.gif " /></ div >
< div class = " control " >
Цена : 10.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 13 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Порождение клона </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/mirror.gif " /></ div >
< div class = " control " >
Цена : 1.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 14 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
< div class = " items " >
< div class = " title " > Эфирное воздействие </ div >
< div class = " img " >< img class = " slot valign halign " src = " /i/sh/antimirror.gif " /></ div >
< div class = " control " >
Цена : 1.00 екр .
< div style = " text-align: center; " >< a href = " javascript:void(0); " class = " byu " id = " 15 " > купить 1 шт .</ a ></ div >
</ div >
</ div >
</ div >
< div id = " inlines " >
2022-08-09 19:57:43 +00:00
< ? php
foreach ( range ( 1 , 15 ) as $item ) {
echo show_byu ( $item );
}
?>
2019-01-09 20:02:42 +00:00
</ div >
< script >
$ ( document ) . ready ( function () {
2019-01-16 17:45:30 +00:00
const types_user = [ 'Заклятие молчания 15 мин' , 'Заклятие молчания 30 мин' , 'Закрыть бой' , 'Исцеление 20%' , 'Исцеление 35%' , 'Исцеление 50%' , 'Лечение' , 'Нападение' , 'Кровавое нападение' , 'Объятия смерти' , 'Записки Комментатора' , 'Открыть бой' , 'Поднять мертвого' , 'Клонирование' , 'Переманить клона' ];
const types_klan = [ 'Заклятие молчания 15 мин' , 'Заклятие молчания 30 мин' , 'Закрыть бой' , 'Исцеление 20%' , 'Исцеление 35%' , 'Исцеление 50%' , 'Лечение' , 'Нападение' , 'Клановое нападение' , 'Объятия смерти' , 'Записки Комментатора' , 'Открыть бой' , 'Поднять мертвого' , 'Клонирование' , 'Переманить клона' ];
2019-01-09 20:02:42 +00:00
$ ( " .box_klan " ) . fancybox ();
$ ( " .box_user " ) . fancybox ();
$ ( " .byu " ) . on ( " click " , function () {
2019-01-16 17:45:30 +00:00
const type = $ ( this ) . attr ( 'id' );
2019-01-09 20:02:42 +00:00
$ . ajax ({
type : 'POST' ,
url : 'fancy/buy.php' ,
2022-01-26 23:15:33 +00:00
data : " type= " + type + " &user= " + < ? = User :: getInstance () -> getId () ?> + "",
2019-01-09 20:02:42 +00:00
success : function ( data ) {
if ( data === 'success' ) {
$ ( " .child " ) . html ( '<b style="color: Red;">' + types_user [ type - 1 ] + ' успешно куплено</b>' );
$ ( " # " + type + " " ) . html ( 'Купить еще?' );
setTimeout ( function () {
$ ( " .child " ) . html ( 'Магазин персональных реликтов' );
}, 500 )
} else {
$ ( " # " + type + " " ) . html ( data );
}
}
});
});
$ ( " .byu_klan " ) . on ( " click " , function () {
2019-01-16 17:45:30 +00:00
const type = $ ( this ) . attr ( 'id' );
2019-01-09 20:02:42 +00:00
$ . ajax ({
type : 'POST' ,
url : 'fancy/buy_klan.php' ,
2022-01-26 23:15:33 +00:00
data : " type= " + type + " &user= " + < ? = User :: getInstance () -> getId () ?> + "",
2019-01-09 20:02:42 +00:00
success : function ( data ) {
if ( data === 'success' ) {
$ ( " .child " ) . html ( '<b style="color: Red;">' + types_klan [ type - 21 ] + ' успешно куплено</b>' );
$ ( " # " + type + " " ) . html ( 'Купить еще?' );
setTimeout ( function () {
$ ( " .child " ) . html ( 'Магазин клановых реликтов' );
}, 500 )
} else {
$ ( " # " + type + " " ) . html ( data );
}
}
});
});
});
2020-08-30 00:55:53 +00:00
</ script >