Вход Регистрация
Файл: test.kolhozu.keo.su/inc/mailing_ct.php
Строк: 24
<?
if(isset($_POST['text']))
{
$text=$_POST['text'];
if(
strlen2($text)<1)echo err_game("Введите текст рассылки.");
else
{
if(
$_POST['onlyDirection']==1)$d=" AND (`status` < '3' OR `status` = '3')";else $d=NULL;
$q=mysql_query("SELECT * FROM `kolhoz_collective_user` WHERE `id_collective` = '$ct[id]' AND `id_user` != '$ku[id]'$d");
$msg="Рассылка компании
$text";
while(
$post=mysql_fetch_array($q))
{
$uk=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_user` WHERE `id` = '$post[id_user]'"));
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$uk[id]', `id_kont` = '$ku[id]', `msg` = '".my_esc($msg)."', `time` = '$time', `type` = 'to'");
}
header("Location:?collective=$ct[id]");
exit;
}
}
echo 
"<div class='small ptm'>";
echo 
"<div style='padding-top:4px'>";
echo 
"<div class='event' style='height:2px'>";
echo 
"<div class='eventlight' style='height:2px;width:".rand(75,95)."%'>";
echo 
"</div>";
echo 
"</div>";
echo 
"<ul class='block'>";
echo 
"<li>";
echo 
"<div class='event'><h1><a href='?collective=$ct[id]'>".hsc($ct['name'])."</a> / Громкоговоритель</h1></div>
<div class='content'>
<div class='block'>
<div></div>
<div class='minor'>Вы можете отправить сообщение всем участникам вашей компании.</div>"
;
echo 
"<form method='post'>
<div>
<label>
<input type='checkbox' name='onlyDirection'>
Правлению компании
</label>
</div>
<div>
<label>Текст:<br>
<textarea rows='5' class='wide' name='text'></textarea>
</label>
</div>
<div>
<input type='submit' value='Отправить'>
</div>
</form>
</div>"
;
include_once 
'inc/foot.php';
?>
Онлайн: 0
Реклама