game/modules_data/_newanimal.php

445 lines
16 KiB
PHP
Raw Normal View History

2022-06-06 21:30:34 +00:00
<?php
echo "
<script language='JavaScript'>
var elem = document.getElementById('se-pre-con');
elem.parentNode.removeChild(elem);
</script>
";
if(!defined('GAME')) {
die();
}
$slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
if(!isset($slot['id'])) {
if( mysql_query('INSERT INTO `users_animal_slot` ( `uid`,`slots`,`ekr` ) VALUES ( "'.$u->info['id'].'","2","0" )') ) {
$slot = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal_slot` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
}else{
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...';
}
}
$slot['price_next'] = 5;
$petox = mysql_fetch_array(mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
$petox = $petox[0];
$an_eda = array(
0.05,
0.07,
0.10,
0.15,
0.20,
0.30,
0.40,
0.50,
0.60,
0.70,
0.80,
1.00,
1.50,
2.00,
2.50,
3.00,
3.50,
4.00,
4.50,
5.00,
5.50,
7.00
);
function en_ru($txt) {
$g = false;
$en = preg_match("/^(([0-9a-zA-Z _-])+)$/i", $txt);
$ru = preg_match("/^(([0-9<>-<2D><>-<2D> _-])+)$/i", $txt);
if(($ru && $en) || (!$ru && !$en)) {
$g = true;
}
return $g;
}
//
function testBad($txt) {
$white = '-_ 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM<4E><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
$r = false;
$i = 0;
while( $i != -1 ) {
if( isset($txt[$i]) ) {
$g = false;
$j = 0;
while( $j != -1 ) {
if(isset($white[$j])) {
if( $white[$j] == $txt[$i] ) {
$g = true;
}
}else{
$j = -2;
}
$j++;
}
if( $g == false ) {
$r = true;
}
}else{
$i = -2;
}
$i++;
}
return $r;
}
function is_login_an($login) {
$r = true;
//
$login = htmlspecialchars($login,NULL,'cp1251');
//
$bad = array(
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' => 1,
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' => 1
);
//
//$login_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($login).'" LIMIT 1'));
//$login_an_db = mysql_fetch_array(mysql_query('SELECT `id` FROM `users_animal` WHERE `name` = "'.mysql_real_escape_string($login).'" LIMIT 1'));
if( isset($login_db['id']) || isset($login_an_db['id']) || isset($bad[$login]) ) {
$r = false;
}else{
$true = true;
//
/*
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 2 <EFBFBD><EFBFBD> 16 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '_', '-' <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '_', '-' <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
*/
//
$login = str_replace(' ',' ',$login);
$login = str_replace('%',' ',$login);
$login = str_replace('&nbsp;',' ',$login);
//
if( strlen($login) > 16 ) {
$true = false;
}elseif( strlen($login) < 2 ) {
$true = false;
}elseif( strripos($login,' ') == true ) {
$true = false;
}elseif( substr($login,1) == ' ' || substr($login,-1) == ' ' ) {
$true = false;
}elseif( substr($login,1) == '-' || substr($login,-1) == '-' ) {
$true = false;
}elseif( substr($login,1) == '_' || substr($login,-1) == '_' ) {
$true = false;
}elseif( testBad($login) == true ) {
$true = false;
}elseif( en_ru(str_replace('<27>','<27>',str_replace('<27>','<27>',$login))) == true ) {
$true = false;
}
//
if( $true == false ) {
$r = false;
}else{
$r = true;
}
}
return $r;
}
if(isset($_GET['buy_slot'])) {
if($u->info['money2'] < $slot['price_nex']) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>';
}elseif($u->info['money2'] < 5 ) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>!';
}elseif( isset($slot['id']) && $slot['slots'] < 7 ) {
$slot['slots']++;
$u->info['money2'] -= 5;
mysql_query('UPDATE `users_animal_slot` SET `slots` = "'.$slot['slots'].'" WHERE `id` = "'.$slot['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.';
}else{
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
}
}elseif(isset($_GET['pet'])) {
$_GET['pet'] = round((int)$_GET['pet']);
$_GET['petname'] = htmlspecialchars($_GET['petname'],NULL,'cp1251');
$ax = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1'));
$ax = $ax[0];
if( $_GET['pet'] < 1 || $_GET['pet'] > 7 ) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>';
}elseif( $ax >= $slot['slots'] ) {
$u->error = '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>';
}elseif( $u->info['money'] < 50 ) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>';
}elseif(is_login_an($_GET['petname']) == false) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
}else{
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>!';
$u->info['money'] -= 50;
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
//
$anm['type'] = $_GET['pet'];
//
if($anm['type']==1)
{
$anm['name'] = '<27><><EFBFBD>';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'20864.gif',2=>'21301.gif',3=>'21139.gif',4=>'20427.gif');
$anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==2)
{
$anm['name'] = '<27><><EFBFBD><EFBFBD>';
$anm['sex'] = 1;
$anm['obraz'] = array(1=>'21415.gif',2=>'21722.gif',3=>'21550.gif');
$anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==3)
{
$anm['name'] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'22277.gif',2=>'22265.gif',3=>'22333.gif',4=>'22298.gif');
$anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10';
}elseif($anm['type']==4)
{
$anm['name'] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'22177.gif',2=>'21976.gif',3=>'21877.gif');
$anm['stats'] = 's1=25|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10';
}elseif($anm['type']==5)
{
$anm['name'] = '<27><><EFBFBD>';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'22352.gif',2=>'23024.gif',3=>'22900.gif',4=>'22501.gif',5=>'22700.gif');
$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==6)
{
$anm['name'] = '<27><><EFBFBD><EFBFBD>';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'24000.gif',2=>'25000.gif',3=>'27000.gif',4=>'28000.gif');
$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
}elseif($anm['type']==7)
{
$anm['name'] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
$anm['sex'] = 0;
$anm['obraz'] = array(1=>'21338_pgtpdbx.gif');
$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
}
//
$anm['name'] = htmlspecialchars($_GET['petname'],NULL,'cp1251');
$anm['name'] = preg_replace("/&#?[a-z0-9]+;/i","", $anm['name']);
//
$anm['obraz'] = $anm['obraz'][rand(1,count($anm['obraz']))];
$anm['obraz'] = str_replace('.gif','',$anm['obraz']);
$anm['obraz'] = str_replace('.jpg','',$anm['obraz']);
$anm['obraz'] = str_replace('.png','',$anm['obraz']);
$ins = mysql_query('INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`,`eda`) VALUES ("'.$anm['type'].'","'.$anm['name'].'","'.$u->info['id'].'","'.$anm['obraz'].'","'.$anm['stats'].'","'.$anm['sex'].'","0")');
if($ins)
{
$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> &quot;'.$_GET['petname'].'&quot; ('.$_GET['pet'].') - 50 <20><>.',time(),$u->info['city'],'System.inventory',0,0);
}else{
$u->error = '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> ...';
}
//
}
//
}elseif(isset($_GET['eda'])) {
$anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "'.mysql_real_escape_string($_GET['eda']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1'));
$x = round((int)$_GET['vvv']);
if($x > 100 - $anm['eda']) { $x = 100 - $anm['eda']; }
if($x < 1) { $x = 1; }
if($x > 100) { $x = 100; }
if(!isset($anm['id'])) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
}elseif( $anm['eda'] >= 100 ) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>.';
}elseif($an_eda[$anm['level']]*$_GET['vvv'] > $u->info['money']) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.';
}else{
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> &quot;'.$anm['name'].'&quot; <20><> '.$x.' <20><>. <20><> '.($x*$an_eda[$anm['level']]).' <20><>.';
$u->info['money'] -= ($x*$an_eda[$anm['level']]);
$anm['eda'] += $x;
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users_animal` SET `eda` = "'.$anm['eda'].'" WHERE `id` = "'.$anm['id'].'" LIMIT 1');
}
}elseif(isset($_GET['pet_del'])) {
if(mysql_query('UPDATE `users_animal` SET `delete` = "'.time().'" WHERE `id` = "'.mysql_real_escape_string($_GET['pet_del']).'" AND `delete` = 0 AND `uid` = "'.$u->info['id'].'" LIMIT 1')) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
}else{
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
}
}elseif(isset($_GET['rename'])) {
$anm = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `id` = "'.mysql_real_escape_string($_GET['rename']).'" AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 1'));
$_GET['vvv'] = htmlspecialchars($_GET['vvv'],NULL,'cp1251');
if(!isset($anm['id'])) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
}elseif(30 > $u->info['money']) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.';
}else{
$u->info['money'] -= 30;
$anm['name'] = preg_replace('/\W/', '', $_GET['vvv']); //$_GET['vvv'];
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> &quot;'.$anm['name'].'&quot; <20><> 30 <20><>.';
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users_animal` SET `name` = "'.mysql_real_escape_string($anm['name']).'" WHERE `id` = "'.mysql_real_escape_string($anm['id']).'" LIMIT 1');
}
}elseif(isset($_GET['shadow']) && $petox > 0) {
if(isset($_GET['rechange'])) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.';
mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"');
}elseif(isset($_GET['change'])) {
$u->error = '<27><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
mysql_query('UPDATE `obraz_pet` SET `use` = 0 WHERE `uid` = "'.$u->info['id'].'"');
mysql_query('UPDATE `obraz_pet` SET `use` = 1 WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.mysql_real_escape_string($_GET['change']).'" LIMIT 1');
}
}
?>
<style>
.an_border {
border:1px solid #aaaaaa;
padding:2px;
width:120px;
height:220px;
}
.an_btn {
cursor:pointer;
}
.an_btn:hover {
cursor:pointer;
background-color:#cccccc;
}
.an_img64x64 {
padding-top:75px;
height:145px;
}
.an_line {
text-align:center;
padding:5px;
}
.an_line2 {
text-align:left;
padding:5px;
width:124px;
}
.an_w120 {
width:120px;
}
.cp {
cursor:pointer;
}
.obrsl1 {
border:1px solid #888;
padding:1px;
margin-bottom:5px;
}
.obrsl1d {
display:inline-block;
widows:120px;
}
</style>
<center><b><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<font color=darkgreen> <?=$u->info['money']?> <20><>.</center></b></font>
<div align="right">
<?
if(!isset($_GET['shadow']) || $petox == 0 ) {
if( $petox > 0 ) {
echo '<button onClick="location.href=\'/main.php?newanimal&shadow\';" class="btn btn-success"><3E><><EFBFBD><EFBFBD><EFBFBD></button>&nbsp;';
}else{
echo '<button disabled="disabled" onClick="alert(\'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\');" class="btn btn-success"><3E><><EFBFBD><EFBFBD><EFBFBD></button>&nbsp;';
}
?>
<button onClick="location.href='/main.php?newanimal';" class="btn"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></button>&nbsp;
<button onClick="location.href='/main.php?inv';" class="btn"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></button>
<? }else{ ?>
<button onClick="location.href='/main.php?newanimal&shadow';" class="btn"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></button>&nbsp;
<button onClick="location.href='/main.php?newanimal';" class="btn"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></button>
<? } ?>
</div>
<?
if( $u->error != '' ) {
echo '<div><b><font color="red">'.$u->error.'</font></b></div>';
}
?>
<hr>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<?
if(isset($_GET['shadow']) && $petox > 0) {
//
echo '<td align="left">';
$sp = mysql_query('SELECT * FROM `obraz_pet` WHERE `uid` = "'.$u->info['id'].'"');
while( $pl = mysql_fetch_array($sp) ) {
echo '<div class="obrsl1d">';
//
echo '<img class="obrsl1" src="https://img.new-combats.com/pet/'.$pl['img'].'" width="120" height="40"><br><div align="center">';
if( $pl['use'] == 0 ) {
echo '<input onclick="location.href=\'/main.php?newanimal&shadow&change='.$pl['id'].'\';" style="width:120px;" type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btn">';
}else{
echo '<input onclick="location.href=\'/main.php?newanimal&shadow&rechange\';" style="width:120px;" type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btn btn-success">';
}
echo '</div>';
//
echo '</div>';
}
echo '</td>';
}else{
$sp = mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 LIMIT 6');
$i = 1;
while( $pl = mysql_fetch_array($sp) ) {
//
if( isset($_GET['selected']) && $pl['id'] == $_GET['selected'] ) {
if( $u->info['animal'] != $pl['id'] ) {
$u->info['animal'] = $pl['id'];
}else{
$u->info['animal'] = 0;
}
mysql_query('UPDATE `users` SET `animal` = "'.$u->info['animal'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
}
//
//$kp = 0.05; //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
$kp = $an_eda[$pl['level']];
//$kp = $an_eda[1];
//
echo '<td width="16%" align="center" valign="top">';
//
echo '<div class="an_line"><b><img onclick="top.anrename('.$pl['id'].',\''.$pl['name'].'\');" class="cp" src="https://img.new-combats.com/pencil.png" width="16" height="16" title="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"> <small>'.$pl['name'].'</small> <img onclick="if(confirm(\'<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> &quot;'.$pl['name'].'&quot;?\')) location.href=\'main.php?newanimal&pet_del='.$pl['id'].'\';" class="cp" src="https://img.new-combats.com/i/clear.gif" title="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" width="13" height="13"></b></div>';
//
echo '<div title="'.$pl['name'].'" class="an_border"><img src="https://img.new-combats.com/i/obraz/'.$pl['sex'].'/'.$pl['obraz'].'.gif" width="120" height="220"></div>';
//
echo '<div class="an_line2"><small>';
echo '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '.$pl['level'].'<br><3E><><EFBFBD><EFBFBD>: <b>'.$pl['exp'].'</b><br><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '.$pl['eda'].'/100<br>';
//
echo '<input ';
if( $pl['eda'] >= 100 ) {
echo ' disabled="disabled" ';
}else{
echo ' onclick="top.eda('.$pl['id'].',\''.$pl['name'].'\','.(0+$kp).','.(0+100-$pl['eda']).');" ';
}
echo 'type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btn an_w120';
if( $pl['eda'] < 1 ) {
echo ' btn-danger';
}
echo '">';
//
if( $pl['id'] != $u->info['animal'] || ( isset($_GET['selected']) && $pl['id'] != $_GET['selected'] ) ) {
echo '<input onClick="location.href=\'main.php?newanimal&selected='.$pl['id'].'\';" type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btn an_w120">';
}else{
echo '<input onClick="location.href=\'main.php?newanimal&selected='.$pl['id'].'\';" type="button" value="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="btn btn-success an_w120">';
}
//
echo '</small></div>';
//
echo '</td>';
$i++;
}
if( $i <= 6 ) {
$j = 0;
while( $i <= 6 ) {
if( $i <= $slot['slots'] ) {
echo '<td width="16%" align="center" valign="top"><div class="an_line">&nbsp;</div><div onclick="top.petbuy();" onMouseOver="top.hi(this,\'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (50 <20><>)\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" class="an_border an_btn an_img64x64"><img src="https://img.new-combats.com/pet_free_slot.png" width="64" height="64"></div></td>';
}else{
if( $j == 0 ) {
echo '<td width="16%" align="center" valign="top"><div class="an_line">&nbsp;</div><div onclick="if(confirm(\'<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> '.$slot['price_next'].' <20><><EFBFBD>?\')) location.href=\'main.php?newanimal&buy_slot\';" onMouseOver="top.hi(this,\'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ('.$slot['price_next'].' <20><><EFBFBD>)\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" class="an_border an_btn an_img64x64"><img src="https://img.new-combats.com/pet_add.png" width="64" height="64"></div></td>';
$j++;
}else{
echo '<td width="16%" align="center" valign="top"><div class="an_line">&nbsp;</div><div title="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" class="an_border an_img64x64"><img src="https://img.new-combats.com/pet_lock.png" width="64" height="64"></div></td>';
}
}
$i++;
}
}
}
?>
</tr>
</table>