Файл: archive/www/musimka.ru/game/bar/my_c.php
Строк: 35
<?php
include_once '../../connect.php';
include_once '../../head.php';
include_once 'inc/start.php';
echo "
<div class='".$diz['main']."'>
<img src='i/4.png' /> ".$bar_user['level']."
<img src='i/exp.png' /> ".$bar_user['exp']."
<img src='i/d.png' /> ".$bar_user['money']."
<br/><img src='i/bottle.png' />".$bar_user['alc']." ".nap($bar_user['alc'])."
<div class='".$diz['title2']."'>Мои коктейли</div>
";
$id=abs(intval($_GET['id']));
if(isset($_GET['id_vip'])){
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `bar_coctails` WHERE `id_u`='".$user_id."' AND `sender`!='0' AND `id`='".abs(intval($_GET['id_vip']))."' AND `act`!='2'"),0);
if($total!=0){
$quert=mysql_fetch_array(mysql_query("SELECT * FROM `bar_coctails` WHERE `id`='".abs(intval($_GET['id_vip']))."'"));
$alc=mysql_result(mysql_query("SELECT `alc` FROM `bar_recept` WHERE `id`='".$quert['id_r']."'"),0);
mysql_query("UPDATE `bar_user` SET `alc`=`alc`+".$alc." WHERE `id_u`='".$user_id."'");
mysql_query("UPDATE `bar_coctails` SET `act`='2' WHERE `id`='".abs(intval($_GET['id_vip']))."'");
header("Location:my_c.php");
exit;
}
}
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `bar_coctails` WHERE `id_u`='".$user_id."' AND `sender`!='0'"),0);
if($total==0)
echo "Вам не дарили еще коктейлей!";
else
if($total>0){
$quert=mysql_query("SELECT * FROM `bar_coctails` WHERE `id_u`='".$user_id."' AND `sender`!='0' ORDER BY `act` ASC LIMIT ".$start.",5");
$i=0;
while($array=mysql_fetch_array($quert)){
$post=($i%2 ? $diz['post_1'] : $diz['post_2']);
echo '<div class="'.$post.'">
<table cellpadding="0">
<tr>
<td>
<img src="i/r_'.$array['id_r'].'.png"/>
</td>
<td>
<b> '.$array['name'].'</b>
<br/>
Подарил <a href="profile.php?id='.$array['sender'].'">'.mysql_result(mysql_query("SELECT `login` FROM `bar_user` WHERE `id_u`='".$array['sender']."'"),0).'</a>
<br/>
'.($array['act']!=2 ? "<a href='my_c.php?id_vip=".$array['id']."'>Выпить</a>" : "Выпит").'
</td></tr></table></div>';
$i++;
}
if ($total > 5){
echo bar_pagenav('my_c.php?', $start, $total, 5);
}
}
echo "</div>";
ret($diz['ret'],'Кабинет','cab.php');
ret($diz['ret'],'Мой бар','index.php');
include_once '../../foot.php';
?>