Файл: accmarket.net/war/army.php
Строк: 53
<?php
define('_ON_CMS', 1);
require_once '../includes/start.php';
require_once '../includes/function.php';
require_once '../includes/header.php';
if($game==0 OR $level==0 OR $ban!=0){
header('Location: ../index.php');
}
$a1=$_GET['a1'];
$a2=$_GET['a2'];
$s = mysql_query("SELECT * FROM `army` WHERE `id`='".check(mysql_real_escape_string($a1))."'");
$a1 = mysql_fetch_array($s);
$q = mysql_query("SELECT * FROM `army` WHERE `id`='".check(mysql_real_escape_string($a2))."'");
$a2 = mysql_fetch_array($q);
$units=$a2['u1']+$a2['u2']+$a2['u3']+$a2['u4']+$a2['u5']+$a2['u6']+$a2['u7']+$a2['u8']+$a2['u9']+$a2['u10']+$a2['u11']+$a2['u12'];
$units1=$a2['u8']+$a2['u9']+$a2['u10']+$a2['u11']+$a2['u12'];
$units2=$a2['u1']+$a2['u2']+$a2['u3']+$a2['u4'];
$units3=$a2['u5']+$a2['u6']+$a2['u7'];
switch ($act) {
default:
if($a1['onpl']==$a2['onpl'] AND $a1['xpl']==$a2['xpl'] AND $a1['ypl']==$a2['ypl'] AND $a1['uid']!=$a2['uid'] AND (($a1['fr_id']==$a2['fr_id'] AND $a1['fr_id']==0 AND $a2['fr_id']==0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']!=0 AND $a2['fr_id']==0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']==0 AND $a2['fr_id']!=0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']!=0 AND $a2['fr_id']!=0))){
div('<a href="../game/pl_army.php?a='.$a1['id'].'">Отряд '.$a1['name'].'</a> | Разведка отряда','top');
echo '<div class="cont">Отряд <span class="'.crasa($a2['rasa']).'">'.$a2['name'].'</span> ';
if($a2['fr_id']==$fr_id AND $fr_id!=0 AND $a2['uid']!=$use_id)echo '[<span class="blue">союзник</span>]';
if($a2['uid']!=$use_id AND (($a1['fr_id']==$a2['fr_id'] AND $a1['fr_id']==0 AND $a2['fr_id']==0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']!=0 AND $a2['fr_id']==0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']==0 AND $a2['fr_id']!=0)))echo '[<span class="red">противник</span>]';
echo '<br/>Расположение x:'.$a2['xpl'].' y:'.$a2['ypl'].'</div>';
if($units1!=0){
echo '<div class="top">Воздушные войска</div><div class="conts">';
if($a2['u8']!=0)echo ''.rasa($a2['rasa']).' '.units(8, $a2['rasa']).': '.$a2['u8'].'<br/>';
if($a2['u9']!=0)echo ''.rasa($a2['rasa']).' '.units(9, $a2['rasa']).': '.$a2['u9'].'<br/>';
if($a2['u10']!=0)echo ''.rasa($a2['rasa']).' '.units(10, $a2['rasa']).': '.$a2['u10'].'<br/>';
if($a2['u11']!=0)echo ''.rasa($a2['rasa']).' '.units(11, $a2['rasa']).': '.$a2['u11'].'<br/>';
if($a2['u12']!=0)echo ''.rasa($a2['rasa']).' '.units(12, $a2['rasa']).': '.$a2['u12'].'<br/>';
echo '</div>';}
if($units2!=0){
echo '<div class="top">Легкие наземные войска</div>';
echo '<div class="conts">';
if($a2['u1']!=0)echo ''.rasa($a2['rasa']).' '.units(1, $a2['rasa']).': '.$a2['u1'].'<br/>';
if($a2['u2']!=0)echo ''.rasa($a2['rasa']).' '.units(2, $a2['rasa']).': '.$a2['u2'].'<br/>';
if($a2['u3']!=0)echo ''.rasa($a2['rasa']).' '.units(3, $a2['rasa']).': '.$a2['u3'].'<br/>';
if($a2['u4']!=0)echo ''.rasa($a2['rasa']).' '.units(4, $a2['rasa']).': '.$a2['u4'].'<br/>';
echo '</div>';}
if($units3!=0){
echo '<div class="top">Тяжелые наземные войска</div>';
echo '<div class="conts">';
if($a2['u5']!=0)echo ''.rasa($a2['rasa']).' '.units(5, $a2['rasa']).': '.$a2['u5'].'<br/>';
if($a2['u6']!=0)echo ''.rasa($a2['rasa']).' '.units(6, $a2['rasa']).': '.$a2['u6'].'<br/>';
if($a2['u7']!=0)echo ''.rasa($a2['rasa']).' '.units(7, $a2['rasa']).': '.$a2['u7'].'<br/>';
echo '</div>';}
if($a2['uid']!=$use_id AND(($a1['fr_id']==$a2['fr_id'] AND $a1['fr_id']==0 AND $a2['fr_id']==0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']!=0 AND $a2['fr_id']==0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']==0 AND $a2['fr_id']!=0) OR ($a1['fr_id']!=$a2['fr_id'] AND $a1['fr_id']!=0 AND $a2['fr_id']!=0))){
if($a1['time']>=$realtime){echo '<div class="top"><img src="../images/time.gif" alt="image" /> Отдых '. intval(($a1['time']-$realtime)/60) .' минут</div>';}else{
echo '<div class="top"><img src="../images/war.jpg" alt="image" /> <a href="ataka.php?a1='.$a1['id'].'&a2='.$a2['id'].'">Атаковать отряд</a></div>';}}
echo '<div class="conts"><a href="../game/pl_army.php?act=loc&a='.$a1['id'].'"><<Назад</a></div>';
}
break;
}
div('<a href="../">В игру</a>','conts');
require_once '../includes/footer.php';
?>