session_start();
include_once("../include/cms_admin.inc.php");
include_once("../include/send_mail.inc.php");
include_once("class.Chinese.php");
$conn = connectdb();
$txtPhone=$_POST['phone'];
$txtSub0=null;
$txtSub1=null;
$txtSub2=null;
$txtSub3=null;
foreach ($_POST['sub0'] as $txtSub0);
foreach ($_POST['sub1'] as $txtSub1);
foreach ($_POST['sub2'] as $txtSub2);
foreach ($_POST['sub3'] as $txtSub3);
$result = mysql_query ("SELECT id FROM `fpi_account`") or die ("Invalid query");
$h = mysql_num_rows($result);
$uid1 = '88238668fps';
$uid2 = $h+1;
$uid3 = $uid1.$uid2;
$special = '20121127';
$txtName = addslashes(stripslashes(trim($txtName)));
$txtEmail = addslashes(stripslashes(trim($txtEmail)));
$txtTel = addslashes(stripslashes(trim($txtTel)));
$link2 = addslashes(stripslashes(trim($link2)));
$sql = "select * from fpi_form";
$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."
Dear Admin,
";
$msgTxt2 = $msgTxt2."
";
$msgTxt = $msgTxt."| 尊贵的客户 ".$txtName.", | |
";
$msgTxt = $msgTxt." |
";
$msgTxt = $msgTxt."| 姓名: | ".$txtName." |
";
$msgTxt = $msgTxt." |
";
$msgTxt = $msgTxt."| 身份证: | ".$txtIdcard." |
";
$msgTxt = $msgTxt." |
";
$msgTxt = $msgTxt."| 电邮: | ".$txtEmail." |
";
$msgTxt = $msgTxt." |
";
$msgTxt = $msgTxt."| 电话: | ".$txtTel." |
";
$msgTxt = $msgTxt." |
";
$msgTxt = $msgTxt."| 登记号码: | ".$uid3." |
";
$msgTxt = $msgTxt."
".$msg2;
$msgTxt1 = $msgTxt1."".$msgTxt."
";
$msgTxt2 = $msgTxt2."".$msgTxt."
";
$now = date("Y-m-d", time());
$sql = "INSERT INTO `fpi_account` ( `name`, `email`, `tel`, `idcard`, `qq`,`date2`, `phone`, `sub0`, `sub1` , `sub2`, `sub3`, `Special`)
VALUES ('$txtName', '$txtEmail', '$txtTel', '$txtIdcard', '$txtqq','$now', '$txtPhone', '$txtSub0', '$txtSub1', '$txtSub2', '$txtSub3', '$special')";
mysql_query($sql, $conn) or die(mysql_error() . "
" . $sql);
$chs2 = new Chinese("UTF8","UTF8",$subject);
$titleb = $chs2->ConvertIT();
$chs2 = new Chinese("UTF8","UTF8",$msgTxt2);
$msgTxt2 = $chs2->ConvertIT();
$chs2 = new Chinese("UTF8","UTF8",$msgTxt1);
$msgTxt1 = $chs2->ConvertIT();
$txtEmail_1 = 'itfps@fpigp.com';
if ($msgTxt != "") {
sendMail($titleb, $msgTxt1, $INFO_EMAIL, $INFO_EMAIL);
//mail($txtEmail, $titleb, $msgTxt2, $headers);
sendMail($titleb, $msgTxt2, $txtEmail, $INFO_EMAIL);
sendMail($titleb, $msgTxt1, $INFO_EMAIL, $INFO_EMAIL);
sendMail($titleb, $msgTxt2, $txtEmail_1, $INFO_EMAIL);
}
disconnectdb($conn);
if ($link2 == "") {
echo "
";
} else {
echo "
";
}
?>