Файл: LinkPodval/IndexLink.php
Строк: 88
<?php
if(isset($_GET['LinkGood']) && num($_GET['LinkGood'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_podval` WHERE `id` = '".num($_GET['LinkGood'])."' AND `time` <= '".$time."' AND `user` = '".$user['id']."' LIMIT 1"),0)!=0){
$fer = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_podval` WHERE `id` = '".num($_GET['LinkGood'])."' AND `time` <= '".$time."' AND `user` = '".$user['id']."' "));
$usvr = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_podval_user` WHERE `user` = '".$user['id']."'"));
$uv = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_podval_shop` WHERE `id` = '".$fer['id_d']."'"));
$usv = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_podval_user` WHERE `img` = '".$fer['img']."'"));
if($usv['img'] == $fer['img']){
$vol = $usvr['col']+1;
$culinary = '0.05';
update_user('culinary',$culinary);
update_podval_user('name',$fer['name'],'col',$vol,'img',$fer['img'],'id',$usv['id']);
}else{
$culinary = '0.05';
update_user('culinary',$culinary);
insert_podval_user('user',$user['id'],'name',$fer['name'],'col',1,'img',$fer['img']);
}
delete_podval('id',$fer['id']);
update_user('money',$uv['money']);
update_user('rating',$uv['exp']);
///////// Лог Пользователя ///// By MyStyle
$time_log = $time+5; /// На 5 сек
$text = 'Вы получили Опыта: '.$uv['exp'].' и монет: '.$uv['money'].'';
update_log('user',$user['id'],'text',$text,'time',$time_log);
header("Location: ?LinkPodval");
exit;
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_podval` WHERE `user` = '".$user['id']."'"),0);
if ($k_post==0)
{
echo '<a class="btn center" href="?LinkPodvalShop">Приготовление</a>
<div class="feedbackPanel"><div class="whiteLink">У вас еще нет приготовлений.</div></div>';
}
$link=mysql_query("SELECT * FROM `mystyle_podval` WHERE `user` = '".$user['id']."' LIMIT 1");
while($base=mysql_fetch_array($link))
{
$uv = mysql_fetch_array(mysql_query("SELECT * FROM `mystyle_podval_shop` WHERE `id` = '".$base['id_d']."'"));
$bt = $base['time']-$time;
$tim = $bt/$uv['time']*100;
if($base['time'] < time()){
echo '<div style="border: 1px solid #005f8a; margin: 4px 0; border-radius: 4px;">
<img class="portrait pt6 pl6 pr6" width="48" height="48" src="/images/cellar/'.$base['img'].'" alt=""/>
<div class="pt6">Рецепт: <span class="whiteBoldLink">'.$base['name'].'</span>
</div><div class="pt6">Награда: <span><span class="money nobr textshadow">
<img width="16" height="16" src="/images/icons/coins.png" alt=""/> <span>'.$base['money'].'</span></span></span> <span>
<span class="expirience nobr textshadow">
<img height="16" width="16" src="/images/icons/level.png"> <span>'.$base['exp'].'</span></span></span>
</div><div style="clear:both"></div>
<a class="btnwom" href="?LinkPodval&LinkGood='.$base['id'].'">
<img src="/images/icons/tick.png" width="16" height="16" alt="o"/>Готово!</a></div></div>';
}else{
echo '<div class="feedbackPanel">Идет процесс приготовления</div>
<div style="border: 1px solid #005f8a; margin: 4px 0; border-radius: 4px;">
<img class="portrait pt6 pl6 pr6" width="48" height="48" src="/images/cellar/'.$base['img'].'" alt=""/>
<div class="pt6">Рецепт: <span class="whiteBoldLink">'.$base['name'].'</span>
</div><div class="pt6">Осталось: <span class="whiteLink">'.time_left($base['time']-$time).'</span>
</div><div style="clear:both">
</div><div class="pt6 pb6 pl6 pr6">
<div style="width: 100%;">
<div><div><div class="expBorder">
<div class="expline2" style="width:'.$tim.'%;"></div>
</div></div></div></div><div style="clear: both;"></div>
</div></div></div>';
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `mystyle_podval_user` WHERE `user` = '".$user['id']."'"),0);
$k_page=k_page($k_post,$user['set']);
$page=page($k_page);
$start=$user['set']*$page-$user['set'];
$q=mysql_query("SELECT * FROM `mystyle_podval_user` WHERE `user` = '".$user['id']."' LIMIT $start, $user[set]");
echo "<ul>";
while($post=mysql_fetch_array($q)){
echo '<div class="center"><ul>
<li class="emptyPanel" style="display: inline-block; list-style-type: none; margin: 0px 2px 4px 2px; white-space:nowrap; width:28%">
<img style="margin-left: auto; margin-right: auto; padding-top: 4px; padding-bottom: 4px; display: block;" width="48" height="48" src="/images/cellar/'.$post['img'].'">
<div class="center">'.$post['col'].' шт.</div>
</li></ul></div></ul></div></div>';
}
if ($k_page>1)str("?LinkPodval&",$k_page,$page); // Вывод страниц
?>