Файл: region_clean/mailadmin.php
Строк: 242
<?php
#######################################
## Mod By KoT (borispol) [76-75-072] ##
#######################################
require_once "start.php";
require_once "sid.php";
header("Cache-Control: no-cache");
if ($ver == "wml") header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");
require_once "inc.php";
$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require_once "version.php";
if (isset($rm) and !ctype_digit($rm)) { header('Location: index.php?isset=403'); }
$go = isset($_GET['go']) ? $_GET['go'] : NULL;
if (isset($go)) {
@$to = str_replace(chr("13"), " ", $to);
@$to = str_replace(chr("10"), " ", $to);
@$to = str_replace("\n", " ", $to);
@$to = str_replace(" ", " ", $to);
@$to = substr($to,0,100);
@$to = str_replace(" ", " ", $to);
@$to = ereg_replace(" +"," ",$to);
@$to = trim(" $to ");
if (!eregi("^[a-z0-9._-]+@[a-z0-9._-]+.[a-z]{2,4}$", $to))$err="Неверный формат e-mail адреса";
@$subject = str_replace(chr("13"), " ", $subject);
@$subject = str_replace(chr("10"), " ", $subject);
@$subject = str_replace("\n", " ", $subject);
@$subject = str_replace(" ", " ", $subject);
@$subject = str_replace(" ", " ", $subject);
@$subject = ereg_replace(" +"," ",$subject);
@$subject = trim(" $subject ");
@$subject = str_replace("", "", $subject);
@$subject = str_replace("", "", $subject);
@$subject = str_replace("", "", $subject);
@$subject = str_replace("", "", $subject);
@$subject = str_replace("", "", $subject);
@$subject = str_replace("", "", $subject);
@$subject = str_replace("\", "", $subject);
@$mail = str_replace(chr("13"), " ", $mail);
@$mail = str_replace(chr("10"), " ", $mail);
@$mail = str_replace("\n", " ", $mail);
@$mail = str_replace(" ", " ", $mail);
@$mail = str_replace(" ", " ", $mail);
@$mail = ereg_replace(" +"," ",$mail);
@$mail = trim(" $mail ");
@$mail = str_replace("", "", $mail);
@$mail = str_replace("", "", $mail);
@$mail = str_replace("", "", $mail);
@$mail = str_replace("", "", $mail);
@$mail = str_replace("", "", $mail);
@$mail = str_replace("", "", $mail);
@$mail = str_replace("\", "", $mail);
@$body = str_replace(chr("13"), " ", $body);
@$body = str_replace(chr("10"), " ", $body);
@$body = str_replace("\n", " ", $body);
@$body = str_replace(" ", " ", $body);
@$body = str_replace(" ", " ", $body);
@$body = ereg_replace(" +"," ",$body);
@$body = trim(" $body ");
@$body = str_replace("", "", $body);
@$body = str_replace("", "", $body);
@$body = str_replace("", "", $body);
@$body = str_replace("", "", $body);
@$body = str_replace("", "", $body);
@$body = str_replace("", "", $body);
@$body = str_replace("\", "", $body);
if (@$body === '') $err="Не заполнено поле ввода "Письмо"";
if (!isset($_POST['otdel'])) {
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="ok" title="Сообщить об ошибке" ontimer="mailadmin.php?$ses&ref=$ref"><timer value="10"/>n
<p align="center">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Сообщить об ошибке</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=mailadmin.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
echo 'Ошибка! Не выбран отдел отправки.<br/>';
echo $fsize2;
include_once 'foot.php';
break;
}
if (!isset($err) and $_POST['otdel'] == 0) {
$select = mysql_query ("SELECT `user`,`id` FROM `users` WHERE `level`='8'");
$row2 = mysql_fetch_array ($select);
$nick = $row2['user'];
$usid = $row2['id'];
$data = date("d-M-Y [H:i]");
$kol = mt_rand(0,99999999);
$time = time();
mysql_query("Insert into zapiski set klu4='".$kol."', who ='".$user."', idwho ='".$id."', message = '".$body ."', towhom = '".$nick."', idtowhom = '".$usid."', time = '".$time."', readd = '0', topic = '".$subject."', date='".$data."'");
$user = utf_to_win($user);
$user = substr($user,0,11);
$subject = utf_to_win($subject);
$subject = substr($subject,0,100);
$body = utf_to_win($body);
$body = substr($body,0,1000);
$mail = utf_to_win($mail);
$mail = substr($mail,0,100);
$now = date("j-m-Y");
$body = "Тебе письмо письмо от: Юзера: $user n Обратная связь: $mail n Сообщение: $body n Дата: $now n Письмо отправлено с чата Soc4at.Ru";
$subject = convert_cyr_string($subject, 'w','k');
$body = convert_cyr_string($body, 'w','k');
$mail = convert_cyr_string($mail, 'w','k');
$adds = "From: ".$mailadmin." n";
$adds .= "X-sender: < ".$mailadmin." >n";
$adds .= "Content-Type: text/plain; charset=koi8-rn";
mail ($to,$subject,$body,$adds);
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="ok" title="Сообщить об ошибке" ontimer="enter.php?$ses&ref=$ref"><timer value="10"/>n
<p align="center">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Сообщить об ошибке</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
echo 'Оповещание успешно отправлено!<br/>';
echo $fsize2;
include_once 'foot.php';
exit;
} elseif (!isset($err) and $_POST['otdel'] == 1) {
$select = mysql_query ("SELECT `user`,`id` FROM `users` WHERE `level`='7'");
$row2 = mysql_fetch_array ($select);
$nick = $row2['user'];
$usid = $row2['id'];
$data = date("d-M-Y [H:i]");
$kol = mt_rand(0,99999999);
$time = time();
mysql_query("Insert into zapiski set klu4='".$kol."', who ='".$user."', idwho ='".$id."', message = '".$body ."', towhom = '".$nick."', idtowhom = '".$usid."', time = '".$time."', readd = '0', topic = '".$subject."', date='".$data."'");
$user = utf_to_win($user);
$user = substr($user,0,11);
$subject = utf_to_win($subject);
$subject = substr($subject,0,100);
$body = utf_to_win($body);
$body = substr($body,0,1000);
$mail = utf_to_win($mail);
$mail = substr($mail,0,100);
$now = date("j-m-Y");
$body = "Тебе письмо письмо от: Юзера: $user n Обратная связь: $mail n Сообщение: $body n Дата: $now n Письмо отправлено с чата Soc4at.Ru";
$subject = convert_cyr_string($subject, 'w','k');
$body = convert_cyr_string($body, 'w','k');
$mail = convert_cyr_string($mail, 'w','k');
$adds = "From: ".$mailadmin." n";
$adds .= "X-sender: < ".$mailadmin." >n";
$adds .= "Content-Type: text/plain; charset=koi8-rn";
mail ($to,$subject,$body,$adds);
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="ok" title="Сообщить об ошибке" ontimer="enter.php?$ses&ref=$ref"><timer value="10"/>n
<p align="center">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Сообщить об ошибке</title>
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=enter.php?$ses&ref=$ref">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">";
}
echo $fsize1;
echo 'Оповещание успешно отправлено!<br/>';
echo $fsize2;
include_once 'foot.php';
exit;
}
}
$yourmail = $row['mail'];
$user = $row['user'];
if (strstr($yourmail,"<a href=""))
{
$t = strpos($yourmail,"">");
$yourmail = substr($yourmail,0,$t);
$e = strlen($yourmail);
$yourmail = substr($yourmail,51,$e);
}
if ($ver == "wml") {
echo $xml;
echo $dtd;
echo "<wml>n
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n
<card id="send" title="Сообщить об ошибке">n
<p align="center">n";
} else {
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link rel="stylesheet" type="text/css" href="css/$css.css"/>
<title>Сообщить об ошибке</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>
<div align="center">
<form action=mailadmin.php?$ses&go=send method=post title="Сказать">n";
}
if (isset($err)) echo $err . '<br/>';
$adr = $to;
echo $fsize1;
if ($ver == "xhtml") echo '<div class = "d1">';
echo 'Постарайся как можно подробнее описать суть проблемы/ошибки.<br/>
При каких обстятельствах она возникает, на каком разделе сайта. Можете так же указать свои контактные данные для обратной связи.<br/>';
if ($ver == "xhtml") echo '</div>';
echo $divide;
echo 'Тема:<br/>';
echo $fsize2;
echo '<input name="subject" maxlength="100" title="subject"/><br/>';
echo $fsize1;
echo 'Письмо:<br/>';
echo $fsize2;
echo '<input name="body" title="body"/><br/>';
echo $fsize1;
echo '<div class="d1"><b>Отдел:</b><br/>';
echo $fsize2;
echo '<input type="radio" name="otdel" checked="checked" value="0"/> Администратор<br/>
<input type="radio" name="otdel" value="1"/> Тех.Поддержка</div>';
echo $fsize1;
echo 'Твой e-mail:<br/>';
echo $fsize2;
echo '<input name="mail" maxlength="100" value="'.$yourmail.'" title="body"/><br/>';
if ($ver == "wml") {
echo $fsize1;
echo "<anchor title="Sign">Отправить<go href="mailadmin.php?$ses&go=send" method="post">n
<postfield name="to" value="".$mailadmin.""/>n
<postfield name="subject" value="$(subject)"/>n
<postfield name="body" value="$(body)"/>n
<postfield name="otdel" value="$(otdel)"/>n
<postfield name="mail" value="$(mail)"/>n
<postfield name="user" value="$user"/>n
</go></anchor><br/>n";
echo $fsize2;
} else {
echo "<input type=hidden name="to" value="".$mailadmin.""/>n
<input type=submit class="ibutton" value="Отправить"/></form><br/>n";
}
echo $fsize1;
echo $divide;
if (isset($rm))echo "<div class = 'd1'><a href="chat.php?$ses&rm=$rm">В чат</a></div>n";
else echo "<div class = 'd1'><a href="enter.php?$ses&ref=$ref">Прихожая</a></div>n";
echo $fsize2;
include_once 'foot.php';
?>