Файл: titwar.ru/equip.php
Строк: 119
<?
include './system/common.php';
include './system/functions.php';
include './system/user.php';
if(!$user) {
header('location: /');
exit;
}
$id = _string(_num($_GET['id']));
if($id && $id != $user['id']) {
$i = mysql_query('SELECT * FROM `users` WHERE `id` = "'.$id.'"');
$i = mysql_fetch_array($i);
if(!$i) {
header('location: /user/');
exit;
}
$title = 'Equipment '.$i['login'];
}
else
{
$i = $user;
$title = 'Equipment';
}
include './system/h.php';
?>
<div class='line'></div>
<?
for($w = 1; $w < 9; $w++) {
switch($w) {
case 1:
$w_name = 'Head';
break;
case 2:
$w_name = 'Shoulders';
break;
case 3:
$w_name = 'Torso';
break;
case 4:
$w_name = 'Gloves';
break;
case 5:
$w_name = 'Left hand';
break;
case 6:
$w_name = 'Right hand';
break;
case 7:
$w_name = 'Legs';
break;
case 8:
$w_name = 'Shoes';
break;
}
?>
<div class='content'>
<table cellpadding='0' cellspacing='0'>
<tr>
<?
if($i['w_'.$w]) {
$inv = mysql_query('SELECT * FROM `inv` WHERE `id` = "'.$i['w_'.$w].'"');
$inv = mysql_fetch_array($inv);
$item = mysql_query('SELECT * FROM `items` WHERE `id` = "'.$inv['item'].'"');
$item = mysql_fetch_array($item);
switch($item['quality']) {
case 0:
$bonus = 0;
$quality = 'Common';
$quality_color = "#986";
break;
case 1:
$bonus = 5;
$quality = 'Uncommon';
$quality_color = "#6c3";
break;
case 2:
$bonus = 10;
$quality = 'Rare';
$quality_color = "#69c";
break;
case 3:
$bonus = 15;
$quality = 'Epic';
$quality_color = "#c6f";
break;
case 4:
$bonus = 20;
$quality = 'Legendary';
$quality_color = "#f60";
break;
case 5:
$bonus = 50;
$quality = 'Divine';
$quality_color = "#999";
break;
case 6:
$bonus = 65;
$quality = 'Super Divine';
$quality_color = "#999";
break;
}
?>
<td><img src='/itemImage.php?id=<?=$inv['item']?>&smith=<?=$inv['smith']?>' alt='*'/></td>
<td valign='top' style='padding-left: 5px;'><img src='/images/icon/quality/<?=$item['quality']?>.png' alt='*'/> <a href='/item/<?=$inv['id']?>/'><?=$item['name']?></a>
<?
if($inv['smith'] > 0) {
?>
<font color='#9c9'>+<?=$inv['smith']?></font>
<?
}
?>
<br/>
<small><small>
<font color="<?=$quality_color?>"><?=$quality?> [<?=$inv['bonus']?>/<?=$bonus?>]</font>
<?
if($user['w_'.$item['w']] != 0) {
$equip_item = mysql_query('SELECT * FROM `inv` WHERE `id` = "'.$user['w_'.$item['w']].'"');
$equip_item = mysql_fetch_array($equip_item);
if(($inv['_str']+$inv['_vit']+$inv['_agi']+$inv['_def']) - ($equip_item['_str']+$equip_item['_vit']+$equip_item['_agi']+$equip_item['_def']) > 0) {
?>
<font color='#3c3'>+<?=($inv['_str']+$inv['_vit']+$inv['_agi']+$inv['_def']) - ($equip_item['_str']+$equip_item['_vit']+$equip_item['_agi']+$equip_item['_def'])?></font>
<?
}
}
else
{
?>
<font color="#3c3">+<?=($inv['_str']+$inv['_vit']+$inv['_agi']+$inv['_def'])?></font>
<?
}
if($inv['rune']) {
switch($inv['rune']) {
case 1:
$rune_stats = 75;
break;
case 2:
$rune_stats = 150;
break;
case 3:
$rune_stats = 250;
break;
case 4:
$rune_stats = 600;
break;
case 5:
$rune_stats = 1000;
break;
}
switch($item['w']) {
case 1:
$rune_stat = 'of strength';
break;
case 2:
$rune_stat ='of health';
break;
case 3:
$rune_stat ='of protection';
break;
case 4:
$rune_stat ='of agility';
break;
case 5:
$rune_stat = 'of strength';
break;
case 6:
$rune_stat = 'of strength';
break;
case 7:
$rune_stat ='of protection';
break;
case 8:
$rune_stat ='of health';
break;
}
?>
<br/>
<img src='/images/icon/quality/<?=$inv['rune']?>.png' alt='*'/> <font color='#90c090'>+<?=$rune_stats?></font> <?=$rune_stat?>
<?
}
?>
</small></small>
</td>
<?
}
else
{
?>
<td><img src='/images/item_null.png' alt='*'/></td>
<td valign='top' style='padding-left: 5px;'><?=$w_name?></td>
<?
}
?>
</tr></table>
</div>
<?
if($i < 8) {
?>
<div class='line'></div>
<?
}
}
include './system/f.php';
?>