Файл: inventar.php
Строк: 217
<?php
//////////////////////////////////////////////////////////
//Автор скрипта: 404No7Found-_-(Тима) //
//Данный скрипт платный //
//Права на скрипт принадлежат 404No7Found-_-(Тима) //
//Перепродажа/Дарение/Выкадывание скрипта - Запрещено! //
//Связь с автором Скайп: STormfrhell-_- //
//////////////////////////////////////////////////////////
include_once('./inc/head.php');
include_once('./inc/prov.php');
title('Инвентар');
/*
$sqll = mysql_query("SELECT * FROM `inventar` WHERE `status` = 'on'");
while($inf_shmot1 = mysql_fetch_assoc($sqll)) {
$ui = mysql_fetch_assoc(mysql_query("SELECT `zashita`, `ataka` FROM `users` WHERE `id` = '".$inf_smot1['id_user']."'"));
if($inf_shmot1['class'] == '1') {
$zash1 = 'zashita';
}
if($inf_shmot1['class'] == '2') {
$zash1 = 'zashita';
}
if($inf_shmot1['class'] == '3') {
$zash1 = 'ataka';
}
if($inf_shmot1['class'] == '4') {
$zash1 = 'zashita';
}
if($inf_shmot1['class'] == '5') {
$zash1 = 'zashita';
}
$inf_pl1 = $inf_shmot1['plus'];
$ups11 = mysql_query("UPDATE `inventar` SET `status` = 'off' WHERE `id` = '".$inf_shmot1['id']."'");
$ups21 = mysql_query("UPDATE `users` SET ".$zash1." = ".$zash1." - '".$inf_pl1."' WHERE `id` = '".$inf_shmot1['id_user']."'");
}
*/
$new_msg = mysql_result(mysql_query("SELECT COUNT(*) FROM `ferm_privat` WHERE `komu` = '".$uinf['login']."' and `view` = '1'"), 0);
if($uinf['id'] == $profil['id'] or $uinf['adm'] == '1')
echo '<div class="title"><b>'.$uinf['login'].' <a href="./privat.php?privat=vhod"><img src="http://144.76.127.94/view/image/icons/post.png" height="15" width="15" align="top" alt="ic">'.$new_msg.'</a> | '.$uinf['hp'].'<img src="http://warbk.com/graph/ico/hp.png" width="16" height="16" > | <img src="http://warbk.com/img/lvl.png" width="16" height="16" > '.$uinf['lvl'].'</b> | <b>Золото: </b> '.$uinf['zoloto'].' <img src="./theme/gold.png" height="16" width="16" align="top" alt="ic"> | <b>Рубли: </b> '.$uinf['rub'].' <img src="http://144.76.127.94/view/image/icons/buy_gold.png" height="16" width="16" align="top" alt="ic"></div>';
switch(htmlspecialchars($_GET['invent'])) {
default;
echo '<div class="menulink">Инвентарь</div>';
echo '<div class="menulink"><a href="?invent=inventar&id=1">Шлемы</a></div>';
echo '<div class="menulink"><a href="?invent=inventar&id=4">Панцири</a></div>';
echo '<div class="menulink"><a href="?invent=inventar&id=2">Щиты</a></div>';
echo '<div class="menulink"><a href="?invent=inventar&id=3">Оружие</a></div>';
echo '<div class="menulink"><a href="?invent=inventar&id=5">Поножи</a></div>';
break;
case 'inventar':
echo '<div class="menulink">Инвентарь</div>';
$i_id = htmlspecialchars($_GET['id']);
$prov2 = mysql_num_rows(mysql_query("SELECT * FROM `inventar` WHERE `class` = '".$i_id."' and `id_user` = '".$uinf['id']."'"));
if($prov2 == '0') {
echo '<div class="content">Пусто</div>';
} else {
$sel_invinf = mysql_query("SELECT * FROM `inventar` WHERE `class` = '".$i_id."' and `id_user` = '".$uinf['id']."' ORDER BY `id` DESC LIMIT $start, $kmess");
$prov = mysql_num_rows(mysql_query("SELECT * FROM `inventar` WHERE `class` = '".$i_id."' and `id_user` = '".$uinf['id']."'"));
while($sel_inv = mysql_fetch_assoc($sel_invinf)) {
echo '<div class="user"><img src="'.$sel_inv['img'].'" alt="shmot"></div>';
echo '<div class="content">Название: '.$sel_inv['name'].'<br/>';
if($i_id == '3') {
echo 'Атака: + '.$sel_inv['plus'].'<br/>';
} else {
echo 'Защита: + '.$sel_inv['plus'].'<br/>';
}
if($sel_inv['status'] == 'off') {
echo '</div><div class="menulink"><a href="?invent=inventar&id='.$i_id.'&d=odet&id_s='.$sel_inv['id'].'">Одеть</a></div>';
} else {
echo '</div><div class="menulink"><a href="?invent=inventar&id='.$i_id.'&d=snyat&id_s='.$sel_inv['id'].'"><font color="#333333">Снять</font></a></div>';
}
}
echo '</div>';
echo '<div class="lines"></div>';
if ($prov > $kmess) {
echo '<div class="content"><center>';
echo '' . pagenav('?invent=inventar&id='.$i_id.'&', $start, $prov, $kmess) . '';
echo '</center></div>';
}
echo '<div class="menulink"><a href="?menu=inventar_top">«Назад</a></div>';
echo '</div>';
////БЛОК ОДЕТЬ////
if(htmlspecialchars($_GET['d']) == 'odet') {
$s_id = htmlspecialchars($_GET['id_s']);
$prov_us = mysql_result(mysql_query("SELECT `id_user` FROM `inventar` WHERE `id` = '".$s_id."'"), 0);
if($prov_us == $uinf['id']) {
$prov_s = mysql_result(mysql_query("SELECT COUNT(*) FROM `inventar` WHERE `class` = '".$i_id."' and `status` = 'on' and `id_user` = '".$uinf['id']."'"), 0);
if($prov_s == '0') {
$inf_shmot = mysql_fetch_assoc(mysql_query("SELECT * FROM `inventar` WHERE `id` = '".$s_id."'"));
if($uinf['lvl'] >= $inf_shmot['lvl']) {
if($inf_shmot['class'] == '1') {
$zash = 'zashita';
}
if($inf_shmot['class'] == '2') {
$zash = 'zashita';
}
if($inf_shmot['class'] == '3') {
$zash = 'ataka';
}
if($inf_shmot['class'] == '4') {
$zash = 'zashita';
}
if($inf_shmot['class'] == '5') {
$zash = 'zashita';
}
$inf_pl = $uinf[$zash] + $inf_shmot['plus'];
$ups1 = mysql_query("UPDATE `inventar` SET `status` = 'on' WHERE `id` = '".$s_id."'");
$ups2 = mysql_query("UPDATE `users` SET ".$zash." = '".$inf_pl."' WHERE `id` = '".$uinf['id']."'");
header("Location: ?invent=inventar&id=$i_id");
} else {
$_SESSION['result'] = '<b>Требуемый уровень '.$inf_shmot['lvl'].'!</b><br/>';
header("Location: ./start.php?start=result");
}
}
}
}
////////
/////БЛОК СНЯТЬ/////
if(htmlspecialchars($_GET['d']) == 'snyat') {
$s_id1 = htmlspecialchars($_GET['id_s']);
$prov_us1 = mysql_result(mysql_query("SELECT `id_user` FROM `inventar` WHERE `id` = '".$s_id1."'"), 0);
if($prov_us1 == $uinf['id']) {
$prov_s1 = mysql_num_rows(mysql_query("SELECT * FROM `inventar` WHERE `class` = '".$i_id."' and `status` = 'on' and `id` = '".$s_id1."' and `id_user` = '".$uinf['id']."'"));
if($prov_s1 != '0') {
$inf_shmot1 = mysql_fetch_assoc(mysql_query("SELECT * FROM `inventar` WHERE `id` = '".$s_id1."'"));
if($inf_shmot1['class'] == '1') {
$zash1 = 'zashita';
}
if($inf_shmot1['class'] == '2') {
$zash1 = 'zashita';
}
if($inf_shmot1['class'] == '3') {
$zash1 = 'ataka';
}
if($inf_shmot1['class'] == '4') {
$zash1 = 'zashita';
}
if($inf_shmot1['class'] == '5') {
$zash1 = 'zashita';
}
$inf_pl1 = $uinf[$zash1] - $inf_shmot1['plus'];
$ups11 = mysql_query("UPDATE `inventar` SET `status` = 'off' WHERE `id` = '".$s_id1."'");
$ups21 = mysql_query("UPDATE `users` SET ".$zash1." = '".$inf_pl1."' WHERE `id` = '".$uinf['id']."'");
header("Location: ?invent=inventar&id=$i_id");
}
}
}
echo '</div>';
}
break;
}
include_once('./inc/foot.php');
?>