session_start();
include("conf.php");
include("functions.php");
$act=htmlspecialchars($act);
$date=htmlspecialchars($date);
$target=htmlspecialchars($target);
$view=htmlspecialchars($view);
$scan=htmlspecialchars($scan);
$log=htmlspecialchars($log);
$data = mysql_connect($base_name, $base_user, $base_pass);
mysql_select_db($db_name,$data);
mysql_query("SET CHARSET cp1251");
$S = mysql_query("SELECT * FROM characters WHERE login='$login'");
$db = mysql_fetch_array($S);
$orden = $db["orden"];
if(empty($date)){$date = date("Y.m.d");$date_t=$date;}
else{$date_t = $date;}
if(empty($target)){$target = $login;$login_t = $login;}
else{$login_t = $target;}
$orden_d = $db["orden"];
$clan_s = $db["clan_short"];
$clan_f = $db["clan"];
$travm = $db["travm"];
$level = $db["level"];
$room = $db["room"];
$rang = $db["rang"];
$cure_hp=$db["cure_hp"];
$cure_mp=$db["cure_mp"];
$time_to_cure=$cure_hp-time();
$hhh=$db["hp_all"];
if($db["battle"]==0){
if($time_to_cure>0){
$percent_hp=floor((100*$time_to_cure)/1200);
$percent=100-$percent_hp;
$percent=$percent;
$hp[0]=floor(($hhh*$percent)/100);
$sss="UPDATE characters SET hp='$hp[0]' WHERE login='$login'";
$q=mysql_query($sss);
}
else{
$hp[0]=$db["hp_all"];
$SS = mysql_query("UPDATE characters SET hp='$hp[0]',cure_hp='0' WHERE login='$login'");
$time_to_cure_f=0;
}
}
if($travm!=0){
$travm_i = "";
}
else{$travm_i="";}
if($orden_d==1){$orden_dis="Белое братство";}
else if($orden_d==2){$orden_dis="Темное братство";}
else if($orden_d==3){$orden_dis="Нейтральное братство";}
else if($orden_d==4){$orden_dis="Алхимик";}
else if($orden_d==5){$orden_dis="Тюремный заключеный";}
if(empty($clan_s)){$clan="";}
else{$clan="";}
if(empty($orden_d)){$orden="";}
else{
if ($orden_d==2) {$orden="";}
else{$orden="";}
if ($orden_d==1) {$orden="";} }
?>
АнтиБК+
";
}
else {
print" Бои: |
Физические |
С ботом |
Групповые |
Текущие |
Завершенные |
Бои проводятся только в залах Бойцовского клуба!
";
die();}
?>
Список боев персонажа за
if(!empty($target) AND !empty($view)){
$date = str_replace(".","",$date);
$SEEK = mysql_query("SELECT * FROM battles WHERE status='finished'");
$i=1;
while($DATA = mysql_fetch_array($SEEK)){
$date_db = substr($DATA["date"],0,10);
$date_db = str_replace("-","",$date_db);
if($date == $date_db){
$bid = $DATA["id"];
$TEAM1 = mysql_query("SELECT player,ip FROM team1_history WHERE battle_id='$bid'");
$TEAM2 = mysql_query("SELECT player,ip FROM team2_history WHERE battle_id='$bid'");
while($T1_D = mysql_fetch_array($TEAM1)){
if($T1_D["player"] == $target){
$team1 = "";
$team2 = "";
if($DATA["win"]==1){$win1 = "";$win2="";}
else{$win2 = "";$win1="";}
$LIST_TEAM1 = mysql_query("SELECT player,ip FROM team1_history WHERE battle_id='$bid'");
while($T1_LISTD = mysql_fetch_array($LIST_TEAM1)){
$pl = $T1_LISTD["player"];
$pl1 = str_replace(" ","%20",$pl);
if($orden == 1){
$ip = $T1_LISTD["ip"];
$ip_t = "(ip: $ip)";
}
else{$ip_t = "";}
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team1 .= "$pl$ip_t [$lev],";
}
$LIST_TEAM2 = mysql_query("SELECT player,ip FROM team2_history WHERE battle_id='$bid'");
while($T2_LISTD = mysql_fetch_array($LIST_TEAM2)){
$pl = $T2_LISTD["player"];
$pl1 = str_replace(" ","%20",$pl);
if($orden == 1){
$ip = $T2_LISTD["ip"];
$ip_t = "(ip: $ip)";
}
else{$ip_t = "";}
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team2 .= "$pl$ip_t [$lev],";
}
print "$i. $team1$win1 VS $team2$win2 - смотреть >>>
";
$i++;
}
}
while($T2_D = mysql_fetch_array($TEAM2)){
if($T2_D["player"] == $target){
$team1 = "";
$team2 = "";
if($DATA["win"]==1){$win1 = "";$win2="";}
else{$win2 = "";$win1="";}
$LIST_TEAM1 = mysql_query("SELECT player,ip FROM team1_history WHERE battle_id='$bid'");
while($T1_LISTD = mysql_fetch_array($LIST_TEAM1)){
$pl = $T1_LISTD["player"];
$pl1 = str_replace(" ","%20",$pl);
if($orden == 1){
$ip = $T1_LISTD["ip"];
$ip_t = "(ip: $ip)";
}
else{$ip_t = "";}
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team1 .= "$pl$ip_t [$lev],";
}
$LIST_TEAM2 = mysql_query("SELECT player,ip FROM team2_history WHERE battle_id='$bid'");
while($T2_LISTD = mysql_fetch_array($LIST_TEAM2)){
$pl = $T2_LISTD["player"];
$pl1 = str_replace(" ","%20",$pl);
if($orden == 1){
$ip = $T2_LISTD["ip"];
$ip_t = "(ip: $ip)";
}
else{$ip_t = "";}
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team2 .= "$pl$ip_t [$lev],";
}
print "$i. $team1$win1 VS $team2$win2 - смотреть >>>
";
$i++;
}
}
}
}
}
if(!empty($target) AND !empty($scan)){
$GET_DB = mysql_query("SELECT * FROM characters WHERE login='$target'");
$GDB = mysql_fetch_array($GET_DB);
$ip_target = $GDB["reg_ip"];
$SEEK_IP1 = mysql_query("SELECT * FROM team1_history WHERE ip = '$ip_target'");
while($DAT = mysql_fetch_array($SEEK_IP1)){
$bid = $DAT["battle_id"];
$T1 = mysql_query("SELECT player FROM team1_history WHERE battle_id='$bid'");
$team1 = "";
while($TD1 = mysql_fetch_array($T1)){
$pl = $TD1["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team1 .= "$pl [$lev],";
}
$T2 = mysql_query("SELECT player FROM team2_history WHERE battle_id='$bid'");
$team2 = "";
while($TD2 = mysql_fetch_array($T2)){
$pl = $TD2["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team2 .= "$pl [$lev],";
}
$bat .= "$bid. $team1 VS $team2 - смотреть >>>
";
}
$SEEK_IP2 = mysql_query("SELECT * FROM team2_history WHERE ip = '$ip_target'");
while($DAT = mysql_fetch_array($SEEK_IP2)){
$bid = $DAT["battle_id"];
$T12 = mysql_query("SELECT player FROM team1_history WHERE battle_id='$bid'");
$team1 = "";
while($TD12 = mysql_fetch_array($T12)){
$pl = $TD12["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team1 .= "$pl [$lev],";
}
$T22 = mysql_query("SELECT player FROM team2_history WHERE battle_id='$bid'");
$team2 = "";
while($TD22 = mysql_fetch_array($T22)){
$pl = $TD22["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$team2 .= "$pl [$lev],";
}
$bat .= "$bid. $team1 VS $team2 - смотреть >>>
";
}
print "Бои-multyIP,проведенные с одного IP-адреса.:
";
$bat_MIP = "";
$i=1;
$LOOK = mysql_query("SELECT * FROM team1_history WHERE player='$target'");
while($LD = mysql_fetch_array($LOOK)){
$ip_t = $LD["ip"];
$bid = $LD["battle_id"];
$MT = mysql_query("SELECT * FROM team2_history WHERE battle_id='$bid' AND ip='$ip_t'");
while($DAT = mysql_fetch_array($MT)){
$B = $DAT["battle_id"];
if(!empty($B)){
$B_SEEK = mysql_query("SELECT * FROM battles WHERE id='$B'");
$BSD = mysql_fetch_array($B_SEEK);
if($BSD["win"]==1){$win1 = "";$win2="";}
else{$win2 = "";$win1="";}
$T12 = mysql_query("SELECT player,ip FROM team1_history WHERE battle_id='$B'");
$team1 = "";
while($TD12 = mysql_fetch_array($T12)){
$pl = $TD12["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$ip = $TD12["ip"];
if($ip == $ip_t){$ip = "$ip";}
$ip_t2 = "(ip: $ip)";
$team1 .= "$pl$ip_t2 [$lev],";
}
$T22 = mysql_query("SELECT player,ip FROM team2_history WHERE battle_id='$B'");
$team2 = "";
while($TD22 = mysql_fetch_array($T22)){
$pl = $TD22["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$ip = $PL_LD["ip"];
$ip = $TD22["ip"];
if($ip == $ip_t){$ip = "$ip";}
$ip_t2 = "(ip: $ip)";
$team2 .= "$pl$ip_t2 [$lev],";
}
}
$bat_MIP .= "$i. $team1$win1 VS $team2$win2 - смотреть >>>
";
$i++;
}
}
$LOOK2 = mysql_query("SELECT * FROM team2_history WHERE player='$target'");
while($LD = mysql_fetch_array($LOOK2)){
$ip_t = $LD["ip"];
$bid = $LD["battle_id"];
$MT = mysql_query("SELECT * FROM team1_history WHERE battle_id='$bid' AND ip='$ip_t'");
while($DAT = mysql_fetch_array($MT)){
$B = $DAT["battle_id"];
if(!empty($B)){
$B_SEEK = mysql_query("SELECT * FROM battles WHERE id='$B'");
$BSD = mysql_fetch_array($B_SEEK);
if($BSD["win"]==1){$win1 = "";$win2="";}
else{$win2 = "";$win1="";}
$T12 = mysql_query("SELECT player,ip FROM team1_history WHERE battle_id='$B'");
$team1 = "";
while($TD12 = mysql_fetch_array($T12)){
$pl = $TD12["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$ip = $TD12["ip"];
if($ip == $ip_t){$ip = "$ip";}
$ip_t2 = "(ip: $ip)";
$team1 .= "$pl$ip_t2 [$lev],";
}
$T22 = mysql_query("SELECT player,ip FROM team2_history WHERE battle_id='$B'");
$team2 = "";
while($TD22 = mysql_fetch_array($T22)){
$pl = $TD22["player"];
$pl1 = str_replace(" ","%20",$pl);
$PL_L = mysql_query("SELECT level FROM characters WHERE login='$pl'");
$PL_LD = mysql_fetch_array($PL_L);
$lev = $PL_LD["level"];
$ip = $PL_LD["ip"];
$ip = $TD22["ip"];
if($ip == $ip_t){$ip = "$ip";}
$ip_t2 = "(ip: $ip)";
$team2 .= "$pl$ip_t2 [$lev],";
}
}
$bat_MIP .= "$i. $team1$win1 VS $team2$win2 - смотреть >>>
";
$i++;
}
}
print "$bat_MIP
";
}
?>