$query = "SELECT * FROM industries ORDER BY industry_name";
$query_result = mysql_query($query) or die ('This query could not be performed');
while ($row = mysql_fetch_array($query_result,MYSQL_ASSOC)){
$industries[] = $row;
}
if(isset($_POST['name'])){
$name=$_POST['name'];
$company=htmlspecialchars($_POST['company']);
$position=$_POST['position'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$state=$_POST['state'];
$industry=$_POST['industry'];
$phoneSystem=$_POST['phoneSystem'];
$businessType=$_POST['businessType'];
$handset=$_POST['handset'];
$lines=$_POST['lines'];
$splrequirements= $_POST['splrequirements'];
$interests[] = $_POST['interest'];
if(count($interests[0]) != 0){
foreach($interests[0] as $int){
$interest .= $int."\n";
}
}
if(isset($_SESSION['gkw'])){
$keyword=$_SESSION['gkw'];
}else{
$keyword="";
}
require_once "mailer/lib/Swift.php";
require_once "mailer/lib/Swift/Connection/SMTP.php";
//Connect to localhost on port 25
$swift = new Swift(new Swift_Connection_SMTP("localhost"));
$HTMLMessage .= "CONTACT DETAILS\n".
"Full Name :".$name."\n".
"Company Name :".$company."\n".
"Industry :".$industry."\n".
"Position :".$position."\n".
"Phone :".$phone."\n".
"Email address :".$email."\n".
"State :".$state."\n".
"REQUIREMENTS: "."\n".
"I require a :".$phoneSystem."\n".
"I need this because :".$businessType."\n".
"Company Size :".$handset."\n".
"No. of lines :".$lines."\n".
"Special Requirement :".$splrequirements."\n".
"OTHER INTERESTS :"."\n".
"I'm interested in :".$interest."\n".
"Keyword : ".$keyword."";
$requirements ="REQUIREMENTS :".
"
I require a :".$phoneSystem.
"
I need this because :".$businessType.
"
Company Sizet :".$handset.
"
No. of lines :".$lines.
"
Requirements :".$splrequirements.
"
I'm interested in :".$interest;
$querystr="Insert into equote(domain,name,company,industry,position,phone,email,state,quote_date,requirements,keyword) values('Alcatel','".
$name."','".$company."','".$industry."','".$position."','".$phone."','".$email."','".$state."','".date("Y-m-d H:i")."','".htmlspecialchars(addslashes($requirements))."','".
$keyword."')";
$result = mysql_query($querystr);
/*
if($industry != ""){
$query = "SELECT * FROM industries WHERE industry_name='$industry'";
$query_result = mysql_query($query);
$row = mysql_fetch_array($query_result,MYSQL_ASSOC);
if(count($row) != 0){
$casestudy=$row['attachment'];
$emailcontent=$row['email_content'];
}else{
$casestudy="";
$emailcontent="";
}
}
*/
$message = new Swift_Message("E-quote from Alcatel");
//Create the message
$message->attach(new Swift_Message_Part($HTMLMessage));
//Now check if Swift actually sends it
$swift->send($message, "sales@itelecom.com.au", new Swift_Address("info@alcatel-phones.com.au", 'Alcatel Admin'));
$swift->send($message, "leads@itelecom.com.au", new Swift_Address("info@alcatel-phones.com.au", 'Alcatel Admin'));
$swift->send($message, "simon@itelecom.com.au", new Swift_Address("info@alcatel-phones.com.au", 'Alcatel Admin'));
/*
if($handset == "")
$options="phone system division";
if($handset == "Micro" || $handset == "Small")
$options="small business division";
if($handset == "Medium")
$options="medium business division";
if($handset == "Corporate")
$options="corporate division";
$customer_message="".
"
Hi ".$name.",
Thanks for your enquiry. I have passed your details onto our ".$options.", and one of our senior consultants will be in touch within 24
hours so we can prepare a tailored quote, make everything as easy as possible and ensure you get the free bonuses on offer this month.
";
$customer_message .= $emailcontent;
$customer_message .= "
Regards,
Pete Williams
Pete Williams
T - 1800 850 214
F - 1300 736 763
E - pete@itelecom.com.au
www.itelecom.com.au
(C) Copyright protected Infiniti Telecommunications Pty Ltd 2008
Disclaimer
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. Any opinions expressed in this email are those of the individual and not necessarily the Company. If you receive this transmission in error, please email this to info@itelecom.com.au. Please then delete this email and destroy any copies of it.
";
//Add Subject
$message = new Swift_Message("Thanks For Your Enquiry");
//Create the message
$message->attach(new Swift_Message_Part($customer_message, "text/html"));
$message->attach(new Swift_Message_Attachment(file_get_contents("http://www.infinititelecommunications.com.au/brochures/FreeBuyersGuide.pdf"), "FreeBuyersGuide.pdf", "application/pdf"));
//ATTACH CASE STUDY PDF TO THE EMAIL
if($casestudy != ""){
$casestudypdf="http://www.infinititelecommunications.com.au/brochures/".$casestudy;
$message->attach(new Swift_Message_Attachment(file_get_contents($casestudypdf), $casestudy , "application/pdf"));
}
$swift->send($message,$email, new Swift_Address("pete@itelecom.com.au", 'Pete Williams'));
*/
$sent=true;
}
?>