<?
/* if($user['id'] ==3)
{
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено Кол-во рублей! Теперь у вас их <font color="green"><b>Кол-во</b></font> Продолжайте общаться и получать больше рублей.</font>';/////
///$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
*/
/*if($user['id'] == 1)
{
$kol = 10;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас их <font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше рублей.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
*/
/* if(date("H:i") == '19:20')
{
$kol = 30;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За явку в чат Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}*/
if($msg[0] == '!')
{
if($msg == '!бонус' and ($user['level']==9 or $user['id'] == 998))
{
$whos = $db->sql_query("SELECT * FROM `who`");
while($who = $db->sql_fetchrow($whos))
{
$res1 = mysql_query( "SELECT `rur`,`user`,`id` FROM `users` WHERE `id` = '".$who['user']."' LIMIT 1 ;" );
$r = mysql_fetch_assoc($res1);
$kol = 30;
$balls = $r['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."' WHERE `id`='".$r['id']."'");
if($who['rm'] != 0)
{
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">Вам было начислено по акции ОТМЕТИЛСЯ '.$kol.' рублей! Теперь у вас '.$r['rur'].'+'.$kol.'=</font><font color="green"><b>'.$balls.'</b></font> Оставайтесь с нами!';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$who['rm']."','".$r['id']."','".$r['id']."')");
}else
{
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">Вам было начислено по акции ОТМЕТИЛСЯ '.$kol.' рублей! Теперь у вас '.$r['rur'].'+'.$kol.'=</font><font color="green"><b>'.$balls.'</b></font> Оставайтесь с нами!';
$db->sql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('".$user_system."','0','".$r['user']."','".$r['id']."','".$time."','".$mes."')");
}
}
}
}
if($user['dayp'] == 50)
{
$kol = 10;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."', dayp = '51' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
if($user['dayp'] == 100)
{
$kol = 25;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."', dayp = '101' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
//////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
if($user['dayp'] == 200)
{
$kol = 50;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."', dayp = '201' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
if($user['dayp'] == 300)
{
$kol = 75;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."', dayp ='301' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
if($user['dayp'] == 400)
{
$kol = 100;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."', dayp = '401' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
if($user['dayp'] == 1000)
{
$kol = 500;
$balls = $user['rur'] + $kol;
mysql_query ("UPDATE `users` SET `rur` = '".$balls."' , dayp = '1001' WHERE `id`='".$user['id']."'");
$mes = '<font color="green"><b>Поздравляем!!!</b></font> <font color="blue">За активное общение в чате Вам было начислено '.$kol.' рублей! Теперь у вас '.$user['rur'].'+'.$kol.'=<font color="green"><b>'.$balls.'</b></font> Продолжайте общаться и получать больше.</font>';
$db->sql_query("INSERT INTO `message` (user,user_id,time,msg,rm,komu,privat) VALUES ('".$user_system."','0','".($time+1)."','".$mes."','".$rm."','".$user[id]."','".$user[id]."')");
////mysql_query("INSERT INTO `privat` (user,user_id,to_user,to_id,time,msg) VALUES ('$user_system','0','".user($user['name'])."','".user_inf($user['id'])."','$time','".$msg."')");
}
?>