Файл: pages/jurnal.php
Строк: 44
<?
include_once '../inc/conn.php';
include_once '../function.php';
$set['title']='Журнал действий';
include_once'../inc/head.php';
if(isset($_GET['del']))
{
if(isset($_GET['ok']))
{
mysql_query("DELETE FROM `jurnal` WHERE `user`='".$user['id']."'");
}
else
{
echo "<center>Вы хотите очистить журнал операций? <br/><a href='?del&ok'>Да</a> | <a href='?'>Нет</a></center>n";
}
}
if(isset($user)){
if(isset($_GET['g'])){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `user_id`='$user[id]' AND `chek`='1' "),0) != '0'){
$u_gro=mysql_fetch_array(mysql_query("SELECT * FROM `group_user` WHERE `user_id`='$user[id]' "));
if(isset($_GET['yes'])){
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `group_user` WHERE `group_id`='$u_gro[id]' AND `chek`='0' "),0) == '20'){
err_game('Достигнут максимум КАчКов в группе!');
$err = '1';}if($err != '1'){
mysql_query("UPDATE `group_user` SET `chek`= '0' WHERE `user_id` ='$user[id]'");msg_game('Приглашение принято!');
}}if(isset($_GET['no'])){
mysql_query("DELETE FROM `group_user` WHERE `user_id` ='$user[id]'");
msg_game('Приглашение отклонено...');}
}else{err_game('Ошибка!');}}
echo " <div class='umenu'>";
mysql_query("UPDATE `jurnal` SET `chek`= '0' WHERE `user` ='$user[id]'");
$jurnal_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `jurnal` WHERE `user`='$user[id]' "),0);
if($jurnal_count==0) echo 'Пусто...';
$jurnal = mysql_query("SELECT * FROM `jurnal` WHERE `user`='$user[id]' ORDER BY `id` DESC LIMIT 15");
while ($jurnals = mysql_fetch_assoc($jurnal)){
$num++;
echo ' <i>'.$num.'.</i> '.$jurnals['msg'].' <span class="cGrey">('.vremja($jurnals['time']).')</span><br/>';}
echo " <br/><div class='kmenu'><img src='img/kor.gif'><a href='?del'> <b>Очистить журнал</b></a><br /></div>n";
}else{
include_once'../inc/login.php';};
include_once '../inc/foot.php';