View file sdark.mobi/task/tend.php

File size: 8.61Kb
<?php
if($user['health'] <= 0){
echo"</div><div  class='but-list'>
<a href=\"?\"> <img src='/images/icon/reload.png'> Обновить </a></font>
<a href=\"/\"> <img src='/images/icon/error.png'> Покинуть бой </a></div></div>";
} else { 
$ureq = mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `task`='".$task['task']."' and `id`='".$user['mob']."'");
$umob = mysql_fetch_array($ureq);
$avt = mysql_num_rows($ureq);
if($avt > 0){
echo'<div class="foot"><table width="100%"><tbody><td class="center"><div class="empty2"></div>';
if($umob['boss'] == 1){echo'<font color="orange">'.$umob['name'].'</font>';}
if($umob['boss'] != 1){echo $umob['name'];}
echo'<div class="empty2"></div>';
$kol70 = $umob['hpmax'] * 0.70;
$kol30 = $umob['hpmax'] * 0.30;
if($umob['hp'] >= $kol70){$health = "green";}
if($umob['hp'] >= $kol30 and $umob['hp'] < $kol70){$health = "orange";}
if($umob['hp'] < $kol30){$health = "red";}
echo'<div class="hp">
<div class="'.$health.'" style="width:'.floor(100/($umob['hpmax']/$umob['hp'])).'%"></div>
</div><div class="empty2"></div>
<div class="empty2"></div>
<font color="#CDC9C9"> ('.$umob['hp'].'/'.$umob['hpmax'].')</font></td>
</tbody></table></div><hr>';
}
echo"<div class='head'><table  width='100%' border='0' cellpadding='5px' cellspacing='0' style='padding-top: 5px;'>
<tbody>";

$randomob = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `status`='' ORDER BY RAND() LIMIT 1"),0);
if($kols == 0){echo'<td width="45%"><a class="fight center" href="?">  Обновить  </a></div></td>';}
if($kols == 1 and $umob['hp'] > 0){echo' <td width="45%"><a class="fight center" href="?udar&id='.$umob['id'].'">  Атаковать  </a></div></td>';}
if($kols == 1 and $umob['hp'] <= 0){echo' <td width="45%"><a class="fight center" href="?udar&id='.$randomob['id'].'">  Атаковать  </a></div></td>';}
if($kols > 1){
if($user['mob'] > 0 and $umob['hp'] > 0){echo' <td width="45%"><a class="fight center" href="?udar&id='.$umob['id'].'">  Атаковать  </a></div></td>';}
echo' <td width="45%"><a class="fight center" href="?udar&id='.$randomob['id'].'">  Бить любого  </a></div></td>';}
echo"</tbody></table><table  width='100%' border='0' cellpadding='1px' cellspacing='0' style='padding-top: 5px;'>
<tbody>";
$req = mysql_query("SELECT timer FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='whack' LIMIT 1");
$umen = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto == 0){
echo"<td width='30%'><div class='big-but'><div class='imgwrap'><img src='/images/umen/whack_grey.png' height='20' width='20'></div><div class='empty'></div>Недоступно</td></div>"; 
}
if($avto > 0){
if($umen['timer']<= $_SERVER['REQUEST_TIME']){
if($umob['hp'] > 0){
echo"<td width='30%'>
<a class='big-but' href=\"?udar&whack&id=".$umob['id']."\">
<div class='imgwrap'><img src='/images/umen/whack.png' height='35' width='35'>
</div> 
<div class='empty'></div> 
</a>
</td>
</div>";
}
if($umob['hp'] <= 0){	
echo"<td width='30%'>
<a class='big-but' href=\"?udar&whack&id=".$randomob['id']."\"><div class='imgwrap'><img src='/images/umen/whack.png' height='35' width='35'>
</div> 
<div class='empty'>	</div> 
</a>
</td>
</div>";
} 
} else {
$recharge = $umen['timer'] - $_SERVER['REQUEST_TIME'];
echo"<td width='30%'><div class='big-but'><div class='imgwrap'><img src='/images/umen/whack_grey.png' height='20' width='20'></div>
<div class='empty'></div>".$recharge." сек</td>
</div>";
}
}
$req = mysql_query("SELECT timer FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='healing'");
$umen = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto == 0){
echo'<td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/healing_grey.png" height="20" width="20"></div><div class="empty"></div>Недоступно</td></div>'; 
} else {
if($umen['timer'] <= $_SERVER['REQUEST_TIME']){
echo'<td width="30%"><a class="big-but" href=\'?healing\'><div class="imgwrap"><img src="/images/umen/healing.png" height="35" width="35"></div><div class="empty"></div></a></td></div>'; 
} else {
$recharge = $umen['timer'] - $_SERVER['REQUEST_TIME'];
echo' <td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/healing_grey.png" height="20" width="20"></div>
<div class="empty"></div>'.$recharge.' сек</td>
</div>';
}
}
$req = mysql_query("SELECT timer FROM `umen` WHERE `usr` = '".$user['id']."' and `img`='gift_of_the_Gods'");
$umen = mysql_fetch_array($req);
$avto = mysql_num_rows($req);
if($avto == 0){
echo'<td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/gift_of_the_Gods_grey.png" height="20" width="20"></div><div class="empty"></div>Недоступно</td></div>'; 
} else {
if($umen['timer'] <= $_SERVER['REQUEST_TIME']){
echo'<td width="30%"><a class="big-but" href=\'?gift_of_the_Gods\'><div class="imgwrap"><img src="/images/umen/gift_of_the_Gods.png" height="35" width="35"></div><div class="empty"></div></a></td></div>'; 
} else {
$recharge = $umen['timer'] - $_SERVER['REQUEST_TIME'];
echo'<td width="30%"><div class="big-but"><div class="imgwrap"><img src="/images/umen/gift_of_the_Gods_grey.png" height="20" width="20"></div>
<div class="empty"></div>'.$recharge.' сек</td>
</div>';
}
}
echo'</td></tbody></table></td>
</tbody>
</table><table width="100%" cellpadding="4px">
<tbody><tr><td width="30%">
<a class="inpc-ar center" href="?bottle=1"><div class="imgwrap"><img src="/images/icon/bottle/0.png">
</div> 
<div class="empty"></div> 
</a>
</td>
<td width="30%"><a class="inpc-ar center" href="?bottle=2"><div class="imgwrap"><img src="/images/icon/bottle/0.png"></div><div class="empty"></div></a></td>
<td width="30%"><a class="inpc-ar center" href="?bottle=3"><div class="imgwrap"><img src="/images/icon/bottle/0.png"></div><div class="empty"></div></a></td>
</tr></tbody>
</table></div>';
}

$requ = mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `status`=''  ");
$avto = mysql_num_rows($requ);
if($avto > 0){
echo"<hr><div class='foot foot'><div class='center'>Противники</br><div class='empty2'></div></div>";
$req = mysql_query("SELECT DISTINCT `name` FROM `battle` WHERE `usr`='".$user['nick']."' and `status`='' ");
while($mob = mysql_fetch_array($req)){
$randomobu = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `usr`='".$user['nick']."' and `name`='".$mob['name']."' and `status`='' ORDER BY RAND() LIMIT 1"),0);
if($randomobu['hp'] >= $kol70){
	$health = 'green';
	$hp = '<font color="green">'.$randomobu['hp'].'</font>';
}
if($randomobu['hp'] >= $kol30 and $randomobu['hp']<$kol70){
	$health = 'orange';
	$hp = '<font color="orange">'.$randomobu['hp'].'</font>';
}
if($randomobu['hp'] < $kol30){
	$health = 'red';	
	$hp = '<font color="red">'.$randomobu['hp'].'</font>';
}
$koll = mysql_result(mysql_query("SELECT  COUNT(`id`)  FROM `battle` WHERE `name`='".$mob['name']."' and `usr`='".$user['nick']."' and `status`=''"),0);
if($koll > 1){
echo"<a class='fight' href='?udar&id=".$randomobu['id']."'>".$mob['name']." <font color='#CDC9C9'>(".$koll.")</font></a>";
} else {
if($randomobu['boss']==1){
echo"<a class='fight' href='?udar&id=".$randomobu['id']."'><font color='orange'>".$mob['name']."</font> (".$hp.")</a>";
} else {
echo"<a class='fight' href='?udar&id=".$randomobu['id']."'>".$mob['name']." (".$hp.")</a>";
}
}
}
echo'</div>';
}

$req = mysql_query("SELECT * FROM `duellog` WHERE `opon` = '".$user['nick']."' or `usr` = '".$user['nick']."' and `timer`>='".$_SERVER['REQUEST_TIME']."' ORDER BY `id` DESC LIMIT 9");
$avto = mysql_num_rows($req);
if($avto > 0){
echo"<hr><div class='foot foot'><div class='center'>Журнал боя</br><div class='empty2'></div></div>";
While($ilok = mysql_fetch_array($req)){
$timeudar = $_SERVER['REQUEST_TIME'] - $ilok['timer'] + 300;
if($timeudar < 60){
$timeudar = ''.$timeudar.' сек.';
} else {
$timeudar = round($timeudar/60);
$timeudar = ''.$timeudar.' мин.';
}

if($ilok['kogo'] > 0){
if($user['plem'] == 'ogn'){$plem = 0;}
if($user['plem'] == 'mol'){$plem = 1;}
if($ilok['dead'] == 1){
echo'<img src="/images/icon/dead.png" height="16" width="16">
<font color="#AAAAAA"> '.$ilok['text'].' <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$user['id'].'/"><font color="'.$user['font'].'">'.$user['nick'].'</font></a></font>
<span class="mit">'.$timeudar.'</span>  
<div class="empty"></div>';
} else {
echo'<font color="#AAAAAA"> '.$ilok['text'].' <img src=/images/icon/race/'.$plem.'.png><a href="/user/'.$user['id'].'/"><font color="'.$user['font'].'">'.$user['nick'].'</font></a> на <font color="F5E17E">'.$ilok['uron'].'</font> урона</font>
<span class="mit">'.$timeudar.'</span>  
<div class="empty"></div>';
}
}
}
}
echo'</div>';