Размер файла: 7.37Kb
<?
require_once'../core/system.php';
echo only_reg();
echo ban();
echo blok();
$header='Дуэли';
require_once'../core/head.php';
mysql_query("UPDATE `user` set `mesto` = 'Дуэли', `battle` = '0' where `id` = '".$user['id']."'");
$pix = $_SERVER['REQUEST_TIME']+86400;
mysql_query("DELETE FROM `dlogi` WHERE `timer`>".$pix."");
if($user['level']<10){
header('location: /');
$_SESSION['err'] = 'Доступно только с 10 уровня';}
echo"<img src='/images/duel.jpg' width='100%'><hr>";
echo'<div class="d-grey grey center"><div class="empty"></div>Сражаться можно только с игроками противоположной империи.<div class="empty"></div></div><hr>';
echo'<div class="head"><a class="mini-fight" href="application">Подать заявку</a></div>
<hr><div class="d-grey center"> <img src="/images/icon/dead.png">Победы: '.$user['duel'].'</div>';
echo"<hr><div class='head'><div class='inpc-ar center'>Список активных заявок</br></div></div>";
if($user['plem']=='ogn'){$race='0';}
if($user['plem']=='mol'){$race='1';}
$k_post = mysql_result(mysql_query("SELECT COUNT(id) FROM `duel` WHERE `race`!='".$race."' and `status`='0' and `who`='0' and `timer`>'".$_SERVER['REQUEST_TIME']."'"),0);
$k_page = k_page($k_post,6);
$page = page($k_page);
$start = 6*$page-6;
$q = mysql_query("SELECT * FROM `duel` WHERE `race`!='".$race."' and `status`='0' and `who`='0' and `timer`>'".$_SERVER['REQUEST_TIME']."' ORDER BY `id` DESC LIMIT ".$start.", 6");
$avt = mysql_num_rows($q);
while($sel = mysql_fetch_array($q)){
$us = mysql_query("SELECT * FROM `user` WHERE `id`='".$sel['usr']."'");
$post = mysql_fetch_array($us);
echo "<div class='but-list'>";
if($post['prava']=="5"){$status="<font color='ffc22b'>[A]</font>";$color="#F7990D";}
if($post['prava']=="4"){$status="<font color='ffc22b'>[a]</font>";$color="EBC621";}
if($post['prava']=="3"){$status="<font color='ffc22b'>[M]</font>";}
if($post['prava']=="2"){$status="<font color='ffc22b'>[m]</font>";}
echo '<a href="?inf&id='.$sel['id'].'">';
echo online($post['id']);
echo' <font color="'.$post['font'].'">'.$post['nick'].'</font>';
if($post['prava']>"1"){echo' '.$status.'';}
echo', <img src="/images/icon/level.png">'.$post['level'].' <span class="float-right"> <img src="/images/icon/level.png">'.$sel['min'].'-'.$sel['max'].'</span> </a></div>';
}
if($avt==0){
echo'<hr><div class="foot grey">Список пуст</div>';
}
if ($k_page>1){
echo '<hr>';
str('?',$k_page,$page); // Вывод страниц
}
echo'<hr><div class="foot"><div class="inpc-ar center">Последние битвы</div></div><hr>';
$req = mysql_query("SELECT * FROM `dlogi` ORDER BY `id` DESC LIMIT 6");
$avto = mysql_num_rows($req);
if($avto>=1){
While($ilok = mysql_fetch_array($req)){
echo'<div class="head"><div class="empty"></div>';
$timeudar=$_SERVER['REQUEST_TIME']-$ilok['timer']+300;
if($timeudar<=60){
$timeudar=''.$timeudar.' сек.';
}
if($timeudar>60 and $timeudar<=3600){
$timeudar=round($timeudar/60);
$timeudar=''.$timeudar.' мин.';
}
if($timeudar>3600){
$timeudar=round($timeudar/3600);
$timeudar=''.$timeudar.' часов.';
}
$fed = mysql_query("SELECT * FROM `user` WHERE `id` = '".$ilok['kogo']."'");
$us = mysql_fetch_array($fed);
$fe = mysql_query("SELECT * FROM `user` WHERE `id` = '".$ilok['usr']."'");
$mu = mysql_fetch_array($fe);
if($mu['plem']=='ogn'){$plem='0';}
if($mu['plem']=='mol'){$plem='1';}
if($us['plem']=='ogn'){$plem2='0';}
if($us['plem']=='mol'){$plem2='1';}
if($mu['prava']=="5"){$status="<font color='ffc22b'>[A]</font>";}
if($mu['prava']=="4"){$status="<font color='ffc22b'>[a]</font>";}
if($mu['prava']=="3"){$status="<font color='ffc22b'>[M]</font>";}
if($mu['prava']=="2"){$status="<font color='ffc22b'>[M]</font>";}
if($us['prava']=="5"){$status2="<font color='ffc22b'>[A]</font>";}
if($us['prava']=="4"){$status2="<font color='ffc22b'>[a]</font>";}
if($us['prava']=="3"){$status2="<font color='ffc22b'>[M]</font>";}
if($us['prava']=="2"){$status2="<font color='ffc22b'>[M]</font>";}
if($ilok['slip']==1){echo'<font color="grey"> '.$ilok['text'].'</font> <span class="mit">'.$timeudar.'</span> <div class="empty"></div>';}
if($ilok['slip']==2){echo'<font color="#AAAAAA"> <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$mu['id'].'/"><font color="'.$mu['font'].'">'.$mu['nick'].'</font> '; if($mu['prava']>1){echo''.$status.'';}echo'</a> </a><font color="grey"> '.$ilok['text'].'</font> на игрока <font color="#AAAAAA"> <img src=/images/icon/race/'.$plem2.'.png><a href="/user/'.$us['id'].'/"><font color="'.$us['font'].'">'.$us['nick'].'</font>'; if($us['prava']>1){echo''.$status2.'';}echo'</a> </a> <font color="8CF956">+'.$ilok['uron'].'</font> здоровья <span class="mit">'.$timeudar.'</span> <div class="empty"></div>';}
if($ilok['slip']==3){echo'<font color="#AAAAAA"> <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$mu['id'].'/"><font color="'.$mu['font'].'">'.$mu['nick'].'</font> '; if($mu['prava']>1){echo''.$status.'';}echo'</a> </a><font color="grey"> '.$ilok['text'].'</font> <font color="8CF956">+'.$ilok['uron'].'</font> к <img src="/images/icon/stat/hp.png"><img src="/images/icon/stat/sila.png"><img src="/images/icon/stat/prot.png"> <span class="mit">'.$timeudar.'</span> <div class="empty"></div>';}
if($ilok['slip']==0){
if($ilok['kogo']>0){
if($mu['plem']=='ogn'){$plem='0';}
if($mu['plem']=='mol'){$plem='1';}
if($ilok['dead']==1){echo '
<font color="#AAAAAA"> <img src=/images/icon/race/'.$plem.'.png> <a href="/user/'.$mu['id'].'/"><font color="'.$mu['font'].'">'.$mu['nick'].'</font> '; if($mu['prava']>1){echo''.$status.'';}echo'</a> '.$ilok['text'].' <img src=/images/icon/race/'.$plem2.'.png> <a href="/user/'.$us['id'].'/"><font color="'.$us['font'].'">'.$us['nick'].'</font> '; if($us['prava']>1){echo''.$status2.'';}echo'</a> </a></font> <span class="mit">'.$timeudar.'</span> <div class="empty"></div></div>';}else{
echo'<font color="#AAAAAA"> <img src=/images/icon/race/'.$plem.'.png> <a href="/user/'.$mu['id'].'/"><font color="'.$mu['font'].'">'.$mu['nick'].'</font> '; if($mu['prava']>1){echo''.$status.'';}echo'</a> '.$ilok['text'].' <img src=/images/icon/race/'.$plem2.'.png><a href="/user/'.$us['id'].'/"><font color="'.$us['font'].'">'.$us['nick'].'</font>'; if($us['prava']>1){echo''.$status2.'';}echo'</a> </a> на <font color="F5E17E">'.$ilok['uron'].'</font> урона</font><span class="mit">'.$timeudar.'</span> </div><hr>';}}
if($ilok['kogo']==0){
if($ilok['dead']==1){echo '
<font color="#AAAAAA"> <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$mu['id'].'/"><font color="'.$mu['font'].'"> '.$mu['nick'].'</font> '; if($mu['prava']>1){echo''.$status.'';}echo'</a> </a>'.$ilok['text'].' <img src=/images/icon/race/'.$plem2.'.png> <a href="/user/'.$us['id'].'/"><font color="'.$us['font'].'">'.$us['nick'].'</font> '; if($us['prava']>1){echo''.$status2.'';}echo'</a> </a></font> <span class="mit">'.$timeudar.'</span> <div class="empty"></div></div>';}else{
echo'<font color="#AAAAAA"> <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$mu['id'].'/"><font color="'.$mu['font'].'"> '.$mu['nick'].'</font> '; if($mu['prava']>1){echo''.$status.'';}echo'</a> </a>'.$ilok['text'].' на <font color="F5E17E">'.$ilok['uron'].'</font> урона</font></font><span class="mit">'.$timeudar.'</span> <div class="empty"></div>';}}}}}else{echo'<div class="foot grey">Список пуст</div>';}
echo"</div>";
require_once'../core/foot.php';
?>