Облом!'; echo 'Bu funksiyadan foydalanishga faqat supervayzorlar haqli!'; require_once ("incfiles/end.php"); exit; } switch($_GET['act']) { //Страница ввода текста сообщения. default: echo '
Umumiy xabar
' . "\n"; echo '


'; echo 'Kimlarga yuboramiz
'; echo '
' . "\n"; echo '
Xabar matni:
'; echo '
'; echo '

[Smayllar] [BB-kodlar]

'; echo '' . "\n"; echo '

'; echo ''; break; //Проверка,обработка и отправка сообщений case 'start': if (empty($_POST['message'])) { echo 'Bunaqamasda!Xabar matnini kiritmadizku?!
» Qaytish'; require_once ("incfiles/end.php"); exit; } echo '
Xabar yo\'llash natijalari
' . "\n"; echo '
'; $soob = check(trim($_POST['message'])); //Отправка всем пользователям if ($_POST['sel'] == 'all') { $colus = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . (time() - 604800) . "'"), 0); $asp = mysql_query("SELECT `id` FROM `users` ORDER BY `lastdate` DESC LIMIT $colus;"); $wx = 0; while ($res = mysql_fetch_assoc($asp)) { $usid = $res['id']; mysql_query("INSERT INTO `cms_mail` SET `user_id` = '997',`from_id` = '" . $usid . "',`text` = '" . $soob . "',`time` = '" . time() . "'"); $wx++; } echo 'Murojaatnoma bajarildi!
' .$wx. ' xabarlar barcha userlarga yuborildi!'; $type_r = 1; } //Отправка сообщений всем модерам и админам elseif ($_POST['sel'] == 'adm') { $colad = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `rights`>= 1"), 0); $asp = mysql_query("SELECT `id` FROM `users` WHERE `rights`>=1 ORDER BY `lastdate` DESC LIMIT $colad;"); $wx = 0; while ($res = mysql_fetch_assoc($asp)) { $usid = $res['id']; if ($usname == $login) { continue; } mysql_query("INSERT INTO `cms_mail` SET `user_id` = '997',`from_id` = '" . $usid . "',`text` = '" . $soob . "',`time` = '" . time() . "'"); $wx++; } echo 'Murojaatnoma yuborildi!
' .$wx. ' ta xabar Adming va moderatorlarga yuborildi!'; $type_r = 2; } //Отправка сообщений всем Старшим модерам и админам elseif ($_POST['sel'] == 'smdadm') { $coladm = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `rights`>=6"), 0); $asp = mysql_query("SELECT `id` FROM `users` WHERE `rights`>=6 ORDER BY `lastdate` DESC LIMIT $coladm"); $wx = 0; while ($res = mysql_fetch_assoc($asp)) { $usid = $res['id']; if ($usname == $login) { continue; } mysql_query("INSERT INTO `cms_mail` SET `user_id` = '997',`from_id` = '" . $usid . "',`text` = '" . $soob . "',`time` = '" . time() . "'"); $wx++; } echo 'Murojaatnoma yuborildi!
' .$wx. ' ta xabar admin va supermoderatorlarga yuborildi!'; $type_r = 3; } //Отправка сообщений всем парням if ($_POST['sel'] == 'm') { $colm = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `sex`='m' AND `lastdate`> '" . (time() - 2592000) . "'"), 0); $asp = mysql_query("SELECT `id` FROM `users` WHERE `sex`='m' ORDER BY `lastdate` DESC LIMIT $colm"); $wx = 0; while ($res = mysql_fetch_assoc($asp)) { $usid = $res['id']; if ($usname == $login) { continue; } mysql_query("INSERT INTO `cms_mail` SET `user_id` = '997',`from_id` = '" . $usid . "',`text` = '" . $soob . "',`time` = '" . time() . "'"); $wx++; } echo 'Murojaatnoma!
' .$wx. ' ta xabar yigitlarga yuborildi!'; $type_r = 4; } //Отправка сообщении всем девушкам на сайте :) elseif ($_POST['sel'] == 'zh') { $colzh = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `sex`='zh' AND `lastdate`> '" . (time() - 2592000) . "'"), 0); $asp = mysql_query("SELECT `id` FROM `users` WHERE `sex`='zh' ORDER BY `lastdate` DESC LIMIT $colzh"); $wx = 0; while ($res = mysql_fetch_assoc($asp)) { $usid = $res['id']; if ($usname == $login) { continue; } mysql_query("INSERT INTO `cms_mail` SET `user_id` = '997',`from_id` = '" . $usid . "',`text` = '" . $soob . "',`time` = '" . time() . "'"); $wx++; } echo 'Murojaatnoma yuborildi!
' .$wx. ' ta xabar qizlarga yuborildi!'; $type_r = 5; } echo '
'; //Запись статистики mysql_query("INSERT INTO `rass_stat` SET `time`='" . time() . "', `user_id`='997', `type`='" .$type_r."', `mess`='" .$soob. "';"); break; case 'stat': $colmes = mysql_result(mysql_query("SELECT COUNT(*) FROM `rass_stat`;"), 0); echo '
Statistika
'; echo ''; echo '
So\'ngi murojaatlar
'; if ($colmes == 0) { echo '

Xabarlar yo\'q!


» Qaytish
'; require_once ("incfiles/end.php"); exit; } $az = mysql_query("SELECT * FROM `rass_stat` ORDER BY `id` DESC LIMIT " .$start. ", " .$kmess. ";"); while ($ss = mysql_fetch_assoc($az)) { echo ($i % 2) ? '
' : '
'; $idu = $ss['user_id']; $ps = mysql_result(mysql_query("SELECT FROM `users` WHERE `id`='" .$idu. "' LIMIT 1;"), 0); echo 'Автор: ' .$ps. ' '; $col_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `rass_stat` WHERE `user_id`='" .$idu. "';"), 0); echo '[' .$col_p. ']
'; echo 'Vaqti: ' .date("d.m.y H:i", $ss['time']). '
'; echo 'Turi: '; switch($ss['type']) { case '1': echo 'Barchaga'; break; case '2': echo 'Adm va moderlarga'; break; case '3': echo 'Adm va SMDlarga'; break; case '4': echo 'Barcha yigitlarga'; break; case '5': echo 'Barcha qizlarga'; break; } echo '
'; echo "Xabar: " .$ss['mess']. "
"; $i++; } if ($colmes > $kmess) { echo ''; } echo '
» Admin Panel
'; break; } require_once ("../incfiles/end.php"); ?>