session_start();
include_once("../include/cms_admin.inc.php");
include_once("../include/send_mail.inc.php");
include_once("class.Chinese.php");
date_default_timezone_set('Asia/Hong_Kong');
$conn = connectdb();
$txtName=$_POST['txtName'];
$txtTel=$_POST['txtTel'];
$txtq=$_POST['txtq'];
$txtbox=$_POST['txtbox'];
$ROOT_URL = "http://www.fpi.com.hk";
$sql = "select * from fpi_form3";
$result3 = mysql_query($sql, $conn);
if ($myrow3 = mysql_fetch_object($result3)) {
$msg = htmlspecialchars($myrow3->alert_chi);
$subject = htmlspecialchars($myrow3->subject_chi);
$msg2 = (LF2BR($myrow3->msg_chi));
$INFO_EMAIL = htmlspecialchars($myrow3->email);
}
$msgTxt1 = $msgTxt1."
親愛的 Admin,
";
$msgTxt2 = $msgTxt2."
親愛的".$txtName.",
";
$msgTxt = $msgTxt." |
";
$msgTxt = $msgTxt."| 姓名: | ".$txtName." |
";
$msgTxt = $msgTxt."| QQ: | ".$txtq." |
";
$msgTxt = $msgTxt."| 電話: | ".$txtTel." |
";
$msgTxt = $msgTxt."| Message: | ".$txtbox." |
";
$msgTxt = $msgTxt."
".$msg2;
$msgTxt1 = $msgTxt1."".$msgTxt."
";
$msgTxt2 = $msgTxt2."".$msgTxt."
";
$now = date("Y-m-d-H-i");
$status = "First in";
$source = "QQ";
$sp = "NA";
$tq = "NA";
$second = "NA";
$c = uniqid (rand (),true);
$sql = "INSERT INTO `fpi_qq` ( `txtName`, `txtTel`, `txtq`, `txtbox`, `date`)
VALUES ('$txtName', '$txtTel', '$txtq', '$txtbox', '$now')";
mysql_query($sql, $conn) or die(mysql_error() . "
" . $sql);
$sql2 = "INSERT INTO `fps_call` ( `Date`, `uid`, `Name`, `Source`, `Phone`, `QQMSN`, `Response`, `Status`, `SP_Demo`, `TQ_Demo`, `Second_call`, `Source2`, `Name2`, `Phone2`, `QQMSN2`) VALUES ('$now', '$c', '$txtName', '$source', '$txtTel', '$txtq', '$txtbox', '$status', '$sp', '$tq', '$second', '$source', '$txtName', '$txtTel', '$txtq')";
mysql_query($sql2, $conn) or die(mysql_error() . "
" . $sql2);
$chs2 = new Chinese("UTF8","BIG5",$subject);
$titleb = $chs2->ConvertIT();
$chs2 = new Chinese("UTF8","BIG5",$msgTxt2);
$msgTxt2 = $chs2->ConvertIT();
$chs2 = new Chinese("UTF8","BIG5",$msgTxt1);
$msgTxt1 = $chs2->ConvertIT();
if ($msgTxt != "") {
sendMail($titleb, $msgTxt1, $INFO_EMAIL, $INFO_EMAIL);
sendMail($titleb, $msgTxt2, $txtEmail, $INFO_EMAIL);
sendMail($titleb, $msgTxt1, "cs@fpigp.com", $INFO_EMAIL);
}
disconnectdb($conn);
if ($link2 == "") {
echo "
";
} else {
echo "
";
}
?>