Файл: LinkUser/things.php
Строк: 267
<?php
/**
* @author MyStyle
* @copyright 2013
*/
if(isset($_GET['things'])&& num($_GET['things'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `type` = '".num($_GET['things'])."' AND `user` = '$user[id]' LIMIT 6"),0)!=0){
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `type` = '".num($_GET['things'])."' AND `user` = '$user[id] 'LIMIT 6"),0);
if ($k_post==0)
{
echo "Пусто!";
}
$k_page=k_page($k_post,10);
$page=page($k_page);
$start=10*$page-10;
$q=mysql_query("SELECT * FROM `mystyle_things` WHERE `type` = '".num($_GET['things'])."' AND `user` = '$user[id]' ORDER BY `id` DESC LIMIT 6");
echo '<ul>';
while($post=mysql_fetch_array($q))
{
echo '<li><div>
<div style="border: 1px solid #005f8a; margin: 4px 0; border-radius: 4px;">
<img class="portrait" width="48" height="48" alt="o" style="padding: 4px 0 0 4px;" src="images/items/'.$post['imgs'].'.png">
<div class="pt6">
<span class="whiteBoldLink">'.$post['name'].'</span>
<span class="fr pr6">
<span class="beauty nobr textshadow"><img width="16" height="16" alt="красота" title="крутость" src="images/icons/beauty.png"> <span>'.$post['glam'].'</span></span>
</span>
</div>';
if($post['in'] == 'no')echo '<span>Снято </span>';
if($post['in'] == 'yes'){
echo '<span>Надето</span>';
}else{
echo '<a href="?things&id='.$post['id'].'&iss='.$post['ver'].'"><span>Одеть</span></a>';
}
echo '<div style="clear: both;"></div>
</div></div></li>';
}
echo '</ul>';
$users_v1 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '1' AND `user` = '".$user['id']."'"));
$users_v2 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '2' AND `user` = '".$user['id']."'"));
$users_v3 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '3' AND `user` = '".$user['id']."'"));
$users_v4 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '4' AND `user` = '".$user['id']."'"));
$users_v5 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '5' AND `user` = '".$user['id']."'"));
$users_v6 = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '6' AND `user` = '".$user['id']."'"));
echo '<ul>
<li>
<span class="whiteLink btn">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Вся одежда
</span>
<span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]'"),0).'</span>)
</span>
</span>
</li>
<li>
<a class="whiteLink btn" href="?things&thins='.$users_v4['ver'].'">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Ошейники
</span>
<span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]' AND `ver` = '4'"),0).'</span>)
</span>
</a>
</li>
<li>
<a class="whiteLink btn" href="?things&thins='.$users_v5['ver'].'">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Штанишки
</span>
<span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]' AND `ver` = '5'"),0).'</span>)
</span>
</a>
</li>
<li>
<a class="whiteLink btn" href="?things&thins='.$users_v6['ver'].'">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Амулеты
</span>
<span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]' AND `ver` = '6'"),0).'</span>)
</span>
</a>
</li>
<li>
<a class="whiteLink btn" href="?things&thins='.$users_v2['ver'].'">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Рубашки
</span>
<span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]' AND `ver` = '2'"),0).'</span>)
</span>
</a>
</li>
<li>
<a class="whiteLink btn" href="?things&thins='.$users_v3['ver'].'">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Шапочки
</span><span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]' AND `ver` = '3'"),0).'</span>)
</span>
</a>
</li>
<li>
<a class="whiteLink btn" href="?things&thins='.$users_v1['ver'].'">
<span>
<img width="16" height="16" alt="o" src="images/icons/filter.png"/>
Остальное
</span>
<span class="fr">
(<span>'.mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `user` = '$user[id]' AND `ver` = '1'"),0).'</span>)
</span>
</a>
</li>
</ul>
';
}elseif(isset($_GET['id']) && isset($_GET['iss']) && num($_GET['id'])!=NULL && num($_GET['iss'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `id` = '".num($_GET['id'])."' AND `ver` = '".num($_GET['iss'])."' AND `user` = '".$user['id']."' LIMIT 1"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `id` = '".num($_GET['id'])."' AND `ver` = '".num($_GET['iss'])."' AND `user` = '".$user['id']."'"));
$in = 'yes';
$v = num($_GET['iss']);
$v_m = 'v'.$v.'';
$ins = 'no';
$fe = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '".num($_GET['iss'])."' AND `in` = 'yes' AND `user` = '".$user['id']."'"));
if($fe['in'] == 'yes'){
update_shop('v'.$v.'',$fer['imgs']);
update_shop('s'.$v.'',$fer['glam']);
update_seta('in',$ins,'id',$fe['id']);
update_thingsq('in',$in,'id',num($_GET['id']));
header("Location: ?things=1&ok&1");
exit;
}else{
update_shop('v'.$v.'',$fer['imgs']);
update_shop('s'.$v.'',$fer['glam']);
update_seta('in',$ins,'id',$fe['id']);
update_thingsq('in',$in,'id',num($_GET['id']));
header("Location: ?things=1&ok&2");
exit;
}
}elseif(isset($_GET['thins'])&& num($_GET['thins'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `ver` = '".num($_GET['thins'])."' AND `user` = '$user[id]' LIMIT 6"),0)!=0){
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `ver` = '".num($_GET['thins'])."' AND `user` = '$user[id] 'LIMIT 6"),0);
if ($k_post==0)
{
echo "Пусто!";
}
$k_page=k_page($k_post,10);
$page=page($k_page);
$start=10*$page-10;
$q=mysql_query("SELECT * FROM `mystyle_things` WHERE `ver` = '".num($_GET['thins'])."' AND `user` = '$user[id]' ORDER BY `id` DESC LIMIT $start, 10");
echo '<ul>';
while($post=mysql_fetch_array($q))
{
echo '<li><div>
<div style="border: 1px solid #005f8a; margin: 4px 0; border-radius: 4px;">
<img class="portrait" width="48" height="48" alt="o" style="padding: 4px 0 0 4px;" src="images/items/'.$post['imgs'].'.png">
<div class="pt6">
<span class="whiteBoldLink">'.$post['name'].'</span>
<span class="fr pr6">
<span class="beauty nobr textshadow"><img width="16" height="16" alt="красота" title="красота" src="images/icons/beauty.png"> <span>'.$post['glam'].'</span></span>
</span>
</div>';
if($post['in'] == 'no')echo '<span>Снято </span>';
if($post['in'] == 'yes'){
echo '<span>Надето</span>';
}else{
$post_money = $post['cena']*15;
echo '<a href="?things&id='.$post['id'].'&iss='.$post['ver'].'"><span>Одеть</span></a>
<a class="btnwom" href="?things&LinkId='.$post['id'].'">
Продать за <span class="fr"><span class="money nobr textshadow"><img width="16" height="16" src="/images/icons/coins.png" alt=""/>
<span>'.$post_money.'</span></span></span>
</a>';
}
echo '<div style="clear: both;"></div>
</div></div></li>';
}
echo '</ul>';
}elseif(isset($_GET['LinkId']) && num($_GET['LinkId'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_things` WHERE `id` = '".num($_GET['LinkId'])."' AND `user` = '".$user['id']."' AND `in` = 'no' LIMIT 1"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_things` WHERE `id` = '".num($_GET['LinkId'])."' AND `user` = '".$user['id']."'"));
if(isset($_GET['LinkOk'])){
delete_things('id',$fer['id']);
$fer_money = $fer['cena']*15;
update_user('money',$fer_money);
///////// Лог Пользователя ///// By MyStyle
$time_log = $time+5; /// На 5 сек
$text = ''.$fer['name'].' - Продано за '.$fer_money.' монет';
update_log('user',$user['id'],'text',$text,'time',$time_log);
header("Location: index.php");
exit;
}else{
echo '<div>
<div class="feedbackPanel">
<div class="whiteLink">Вы уверены?</div>
<div style="text-align: center;">
<div class="fl" style="width: 49%;">
<a class="btn" href="?things&LinkId='.num($_GET['LinkId']).'&LinkOk">
<img width="16" height="16" alt="o" src="/images/icons/tick.png"/>
<span>Подтверждаю!</span>
</a>
</div>
<div class="fr" style="width: 49%;">
<a class="btn" href="index.php">
<img width="16" height="16" alt="o" src="/images/icons/cross.png"/>
<span>Отказываюсь!</span>
</a>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>';
}
}else{
header("Location: index.php?NoLink");
exit;
}
?>