Файл: sys/fnc/aut.php
Строк: 77
<?
function aut()
{
global $set;
if ($set['web']==false)
{
global $user;
if (isset($user))
{
$k_new=mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`
LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'
WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` IS NULL OR `users_konts`.`type` = 'common' OR `users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0);
$k_new_fav=mysql_result(mysql_query("SELECT COUNT(`mail`.`id`) FROM `mail`
LEFT JOIN `users_konts` ON `mail`.`id_user` = `users_konts`.`id_kont` AND `users_konts`.`id_user` = '$user[id]'
WHERE `mail`.`id_kont` = '$user[id]' AND (`users_konts`.`type` = 'favorite') AND `mail`.`read` = '0'"),0);
echo "<a href='/konsultant.php'>";
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='shoper'><center>";
echo "<img src='/s-klub/konsultant.png' alt='' /> Онлайн Консультант<br />";
echo "</center></td>";
echo "</tr></table>";
echo "</a>";
if ($user['verh_panel']==0)
{
echo '<center>';
echo '<table class="shop" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td>';
echo "<td class='shop_b'><a href='/index.php'>Главная</a></td>";
echo "<td class='shop_b'><a href='/mag_shop/'>Магазин</a></td>";
echo "<td class='shop_b'><a href='/forum/'>Форум</a></td>";
echo "<td class='shop_b'><a href='/umenu.php'>Кабинет</a></td>";
echo "<td class='shop_b'><a href='/konts.php'>Контакты</a></td>";
echo "<td class='shop_b'><a href='/exit.php'>Выйти</a></td>";
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</center>';
}else{
echo '<center>';
echo '<table class="shop" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td>';
echo "<td class='shop_b'><a href='/index.php'><img src='/s-klub/ico/index.png'></a></td>";
echo "<td class='shop_b'><a href='/mag_shop/'><img src='/s-klub/ico/magazin.png'></a></td>";
echo "<td class='shop_b'><a href='/forum/'><img src='/s-klub/ico/forum.png'></a></td>";
echo "<td class='shop_b'><a href='/umenu.php'><img src='/s-klub/ico/kabinet.png'></a></td>";
echo "<td class='shop_b'><a href='/konts.php'><img src='/s-klub/ico/pochta.png'></a></td>";
echo "<td class='shop_b'><a href='/exit.php'><img src='/s-klub/ico/vihod.png'></a></td>";
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</center>';
}
if ($k_new!=0 && $k_new_fav==0)
{
echo '<table class="shop" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td>';
echo "<td class='shop_b'><a href='/new_mess.php'><img src='/style/icons/mess_fav.png' alt='' /> Входящие ($k_new)</a></td>";
echo '</td>';
echo '</tr>';
echo '</table>';
}
if ($k_new_fav!=0)
{
echo '<table class="shop" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td>';
echo "<td class='shop_b'><a href='/new_mess.php'><img src='/style/icons/mess_fav.png' alt='' /> Входящие ($k_new)</a></td>";
echo '</td>';
echo '</tr>';
echo '</table>';
}
$k_n_s_zak=mysql_result(mysql_query("SELECT COUNT(`forum_zakl`.`id_them`) FROM `forum_zakl` LEFT JOIN `forum_p` ON `forum_zakl`.`id_them` = `forum_p`.`id_them` AND `forum_p`.`time` > `forum_zakl`.`time` WHERE `forum_zakl`.`id_user` = '$user[id]' AND `forum_p`.`id` IS NOT NULL"),0);
if ($k_n_s_zak>0)
{
echo '<table class="shop" cellspacing="0" cellpadding="0">';
echo '<tr>';
echo '<td>';
echo "<td class='shop_b'><a href='/zakl.php'>Сообщения в закладках ($k_n_s_zak)</a></td>";
echo '</td>';
echo '</tr>';
echo '</table>';
}
}
else
{
echo '<center>';
echo '<table class="shop" cellspacing="0" cellpadding="0">';
echo "<tr>";
echo '<td>';
echo "<td class='shop_b'><a href='/aut.php'>Вход</a></td>";
echo "<td class='shop_b'><a href='/reg.php'>Регистрация</a></td>";
echo '</td>';
echo "</tr></table>";
echo '</center>';
}
}
}
?>