#$us = mysql_fetch_array(mysql_query("SELECT *,(select `id` from `online` WHERE `real_time` >= ".(time()-60)." AND `id` = users.`id`) as `online` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
$owntravma=mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$us['id']." AND (type=13 OR ND type=12 OR type=14);"));
$magic=mysql_fetch_array(mysql_query("SELECT `chanse` FROM `magic` WHERE `id` = '23' ;"));
$us_b=mysql_fetch_array(mysql_query("SELECT `type`,`open` FROM `battle` WHERE `id`='{$us['battle']}';"));
$int=101;
$jert=mysql_fetch_array(mysql_query("SELECT * FROM `bots` WHERE `name` = '{$_POST['target']}' LIMIT 1;"));
$effect=mysql_fetch_array(mysql_query("SELECT `id` FROM `effects` WHERE `owner` = '{$jert['id']}' AND `time` > '".time()."' AND `type` = '227' LIMIT 1"));
//mysql_query('UPDATE `logs` SET `log` = CONCAT(`log`,\'<span class=date>'.date("H:i").'</span> '.nick5($user['id'],"B".$ttt).' вмешался в поединок!<BR>\') WHERE `id` = '.$jert['battle'].'');
//addlog($jert['battle'],'<span class=date>'.date("H:i").'</span> '.nick5($user['id'],"B".$ttt).' вмешался в поединок!<BR>');
mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'`=CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = '.$jert['battle'].' ;');
mysql_query("UPDATE users SET `battle` =".$jert['battle'].",`zayavka`=0 WHERE `id`= ".$user['id']);