Файл: feedback.php
Строк: 326
<?
session_set_cookie_params(86400);
session_start();
$full_home_path = dirname(__FILE__);
require_once($full_home_path."/_rootload.php");
mconnect();
validateUser();
if (!EnableLanguages()) { error("Can not load languages."); mclose(); exit; }
if (!GetCurrentCurrency()) { print $_lang[ErrorGetCurrentCurrency]; mclose(); exit; }
head('utf-8',$_lang[FeedTitle]);
print "<H1 class=pagetitle>".$_lang[FeedTitle]."</H1><hr class=hr>";
if ($do == 'send') {
if (!$name) { $error = $_lang[FeedErrorNoName]; $do='';}
else if (!valid_email($email)) {$error=$_lang[FeedErrorBadEmail]; $do='';}
else if (!$to) {$error = $_lang[FeedErrorNoOtdel]; $do='';}
else if (!$message) {$error = $_lang[FeedErrorNoMessage]; $do='';}
else if (GetSetting("captcha_feedback") and $_SESSION['captchakey'] != $captchakeyin) {$error=$_lang[ErrorWrongCaptcha]; $do='';}
else {
if ($to == "testimonial") {
@mysql_query("insert into testimonials (uid,dt,ip,name,company,dolzhnost,email,icq,message) VALUES('".$_SESSION['userId']."',NOW(),'$ip','$name','$company','$dolzhnost','$email','$icq','".addslashes($message)."')") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
print $_lang[FeedTestimonialSuccess];
} else {
$to_email=GetSetting($to);
$subject_msg = "[feedback] $subject";
$message_msg = $_lang[FeedName].": $namern".$_lang[FeedCompany].": $companyrn".$_lang[FeedDolzhnost].": $dolzhnostrn".$_lang[FeedEmail].": $emailrn".$_lang[FeedICQ].": $icqrnrn".$_lang[FeedMessage].":rnrn$messagernrnIP: $ip";
WriteMailLog($subject_msg,$message_msg);
sendmail($to_email,'',$to_email,$subject_msg,$message_msg);
print $_lang[FeedSendSuccess];
}
}
}
if (!$do) {
$feedback_text=GetSetting("feedback_text");
if ($feedback_text) {
$feedback_text = preg_replace("/rn/ui", "<BR>", $feedback_text);
print "<br>$feedback_text<br><br>";
}
$phone=GetSetting("phone");
$phone2=GetSetting("phone2");
$phone3=GetSetting("phone3");
$phone4=GetSetting("phone4");
$phone5=GetSetting("phone5");
$phonec=GetSetting("phonec");
$phonec2=GetSetting("phonec2");
$phonec3=GetSetting("phonec3");
$phonec4=GetSetting("phonec4");
$phonec5=GetSetting("phonec5");
$icq1=GetSetting("icq");
$icq2=GetSetting("icq2");
$icq3=GetSetting("icq3");
$icq4=GetSetting("icq4");
$icq5=GetSetting("icq5");
$icqc1=GetSetting("icqc");
$icqc2=GetSetting("icqc2");
$icqc3=GetSetting("icqc3");
$icqc4=GetSetting("icqc4");
$icqc5=GetSetting("icqc5");
if ($icq1 or $icq2 or $icq3 or $icq4 or $icq5) {
print "<b>".$_lang[FeedContactViaICQ].":</b><br>";
if ($icq1) { print "<img src=http://status.icq.com/online.gif?icq=$icq1&img=27 border=0> $icq1"; if ($icqc1) { print " ($icqc1)"; } print "<BR>"; }
if ($icq2) { print "<img src=http://status.icq.com/online.gif?icq=$icq2&img=27 border=0> $icq2"; if ($icqc2) { print " ($icqc2)"; } print "<BR>"; }
if ($icq3) { print "<img src=http://status.icq.com/online.gif?icq=$icq3&img=27 border=0> $icq3"; if ($icqc3) { print " ($icqc3)"; } print "<BR>"; }
if ($icq4) { print "<img src=http://status.icq.com/online.gif?icq=$icq4&img=27 border=0> $icq4"; if ($icqc4) { print " ($icqc4)"; } print "<BR>"; }
if ($icq5) { print "<img src=http://status.icq.com/online.gif?icq=$icq5&img=27 border=0> $icq5"; if ($icqc5) { print " ($icqc5)"; } print "<BR>"; }
print "<BR>";
}
if ($phone or $phone2 or $phone3 or $phone4 or $phone5) {
print "<b>".$_lang[FeedContactPhones].":</b><br>";
if ($phone) { print "$phone"; if ($phonec) { print " ($phonec)"; } print "<BR>"; }
if ($phone2) { print "$phone2"; if ($phonec2) { print " ($phonec2)"; } print "<BR>"; }
if ($phone3) { print "$phone3"; if ($phonec3) { print " ($phonec3)"; } print "<BR>"; }
if ($phone4) { print "$phone4"; if ($phonec4) { print " ($phonec4)"; } print "<BR>"; }
if ($phone5) { print "$phone5"; if ($phonec5) { print " ($phonec5)"; } print "<BR>"; }
print "<BR>";
}
if ($error) {print "<font color=red>".$_lang[Error].": $error</font><BR><BR>";}
?>
<form method=post>
<input type=hidden name=do value=send>
<table class='rpTableBlank'>
<tr><td valign=middle align=right>* <? print $_lang[FeedName]?>:</td><td><input class=input type="text" name="name" size=30 value="<? print $name?>"></td></tr>
<tr><td valign=middle align=right><? print $_lang[FeedCompany]?>:</td><td><input class=input type="text" name="company" size=30 value="<? print $company?>"></td></tr>
<tr><td valign=middle align=right><? print $_lang[FeedDolzhnost]?>:</td><td><input class=input type="text" name="dolzhnost" size=30 value="<? print $dolzhnost?>"></td></tr>
<tr><td valign=middle align=right>* <? print $_lang[FeedEmail]?>:</td><td><input class=input type="text" name="email" size=30 value="<? print $email?>"></td></tr>
<tr><td valign=middle align=right><? print $_lang[FeedICQ]?>:</td><td><input class=input type="text" name="icq" size=30 value="<? print $icq?>"></td></tr>
<tr><td valign=middle align=right><BR>* <? print $_lang[FeedOtdel]?>:</td><td><BR><select class=input name="to"><option></option>
<?
if (GetSetting("manager_email")) {print "<option value=manager_email>".$_lang[FeedManager]."</option>";}
if (GetSetting("support_email")) {print "<option value=support_email>".$_lang[FeedSupport]."</option>";}
if ($_SESSION['userId'] and GetSetting("testimonialsEnable")) {print "<option value=testimonial>".$_lang[FeedTestimonial]."</option>";}
?>
</select></td></tr>
<tr><td valign=middle align=right><? print $_lang[FeedSubject]?>:</td><td><input class=input type="text" name="subject" size=30 value="<? print $subject?>"></td></tr>
<tr><Td valign=top align=right>* <? print $_lang[FeedMessage]?>:</td><Td><textarea class=input name=message cols=40 rows=5><? print $message?></textarea></td></tr>
<? if (GetSetting("captcha_feedback")) { ?>
<tr><td></td><td class="styleHelp"><img name="captcha" src="captcha.php" align="left" style="margin-right: 10px;"> <? print $_lang[CaptchaNeVidno]?> <A class=rootlink href="" onclick="document.captcha.src = document.captcha.src + '?' + (new Date()).getTime(); return false;"><? print $_lang[CaptchaObnovit]?></a></td>
<tr><td align=right>* <? print $_lang[Captcha]?>:</td><td><input class=input type="text" name="captchakeyin" size=10 value=""></td></tr>
<? } ?>
<tr><Td colspan=2 align=center><input class=button type=submit value='<? print $_lang[Send]?>'></td></tr>
</table>
</form><BR>
<?
print "<code class=warn>*</code> - ".$_lang[Required];
}
foot('utf-8');
mclose();
?>