Thanks for your premium order

[insert_php]
//get basic page variables
$self=$_SERVER[‘PHP_SELF’];
$thispath=dirname($_SERVER[‘PHP_SELF’]);
$sitebasepath=$_SERVER[‘DOCUMENT_ROOT’];
// Capture POST values and sanitize
$FirstName = stripslashes(filter_var($_POST[‘FirstName’], FILTER_SANITIZE_STRING));
$LastName = stripslashes(filter_var($_POST[‘LastName’], FILTER_SANITIZE_STRING));
$EmailAddress = stripslashes(filter_var($_POST[‘EmailAddress’], FILTER_SANITIZE_EMAIL));
$CompanyName1 = stripslashes(filter_var($_POST[‘CompanyName1’], FILTER_SANITIZE_STRING));
$CompanyName2 = stripslashes(filter_var($_POST[‘CompanyName2’], FILTER_SANITIZE_STRING));
$LogoColors = stripslashes(filter_var($_POST[‘LogoColors’], FILTER_SANITIZE_STRING));
$OrderDetails = stripslashes(filter_var($_POST[‘OrderDetails’], FILTER_SANITIZE_STRING));
$OrderID = stripslashes(filter_var($_POST[‘OrderID’], FILTER_SANITIZE_STRING));
$OrigOrderID = stripslashes(filter_var($_POST[‘OrigOrderID’], FILTER_SANITIZE_STRING));
$ImageName = stripslashes(filter_var($_POST[‘ImageName’], FILTER_SANITIZE_STRING));
$UserID = stripslashes(filter_var($_POST[‘UserID’], FILTER_SANITIZE_STRING));

// Specify db credentials
$dbhost = ‘flmrds.chckpdilwthq.us-east-1.rds.amazonaws.com’;
$dbuser = ‘flm_dbo’;
$dbpass = ‘SwbOj21%%’;
$dbase = ‘flmdb’;

$mysqli = new mysqli($dbhost, $dbuser, $dbpass, $dbase) ;

// Validate recaptcha

if (is_file(‘/var/www/html/logo-maker/premium/recaptchalib.php’))
{
echo “SUCCESS!!”;
}
require_once(‘/var/www/html/logo-maker/premium/recaptchalib.php’);
$privatekey = “6LedJu8SAAAAAKRQFn5OK8ReVbvDm8sQ9qcqnXUf”;
$resp = recaptcha_check_answer ($privatekey,
$_SERVER[“REMOTE_ADDR”],
$_POST[“recaptcha_challenge_field”],
$_POST[“recaptcha_response_field”]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die (“The reCAPTCHA wasn’t entered correctly. Go back and try it again.”);
}

else

// If Order already exists (only happens if someone re-submits the same form) tell user order already submitted and they should contact us. else continue with process

if ($stmt = $mysqli->prepare(“SELECT order_id FROM `flm_premium_orders` WHERE order_id = ?”))
{
// Bind the variables to the parameter as strings.
$stmt->bind_param(“s”, $OrderID);

// Execute the statement.
$stmt->execute();

mysqli_stmt_store_result($stmt);
$rows = mysqli_stmt_num_rows($stmt);
}

if ($rows > 0) // Dup exists. end process and notify user
{
echo ‘This order has already been submitted for processing. Please contact support at sales@thefreelogomakers.com’;
}
elseif ($rows == 0) // No Dup exists so proceed
{

{
// Your code here to handle a successful verification

// Display thank you to the user on the screen

echo ‘Step 2 of 2 …
‘;

echo ‘Thank you for your order ‘.$FirstName.’.
‘;
echo ‘Here are your order details. This information has also been emailed to you at ‘.$EmailAddress.’

‘;
echo ‘Order ID: ‘.$OrderID.’
‘;
echo ‘Logo Line 1: ‘.$CompanyName1.’
‘;
echo ‘Logo Optional Line 2: ‘.$CompanyName2.’
‘;
echo ‘Logo Colors: ‘.$LogoColors.’
‘;
echo ‘Order Details:
‘.$OrderDetails.’

‘;

// Insert records into database

if ($stmt = $mysqli->prepare(“INSERT INTO flm_premium_orders (order_id, orig_order_id, image_name, first_name, last_name, email_address, company_name_1, company_name_2, colors, order_details) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)”))
{
// Bind the variables to the parameter as strings.
$stmt->bind_param(“ssssssssss”, $OrderID, $OrigOrderID, $ImageName, $FirstName, $LastName, $EmailAddress, $CompanyName1, $CompanyName2, $LogoColors, $OrderDetails);

// Execute the statement.
$stmt->execute();

// Close the prepared statement.
$stmt->close();

}

// Update order status to premium saved
$orderstatus = “P_SAVED”;

if ($stmt = $mysqli->prepare(“UPDATE flm_pre_orders SET order_status = ? WHERE order_id = ?”))
{

// Bind the variables to the parameter as strings.
$stmt->bind_param(“ss”, $orderstatus, $OrderID);

// Execute the statement.
$stmt->execute();

}

// Email order confirmation to the customer
require ‘/var/www/html/logo-maker/premium/PHPMailerAutoload.php’;

$subject = ‘Logo Order Received – TheFreeLogoMakers – Premium Order #: ‘ .$OrderID;
$message_html = ‘Thank you for your logo order.

Logo Order Number: ‘.$OrderID.’
Our designers will start working on your logo as soon as your payment is finalized

Here are your logo order details:
Design Selected: ‘.$ImageName.’
Logo Design for Premium Order

Line 1 of the Design: ‘.$CompanyName1.’
Line 2 of the Design: ‘.$CompanyName2.’
Logo Colors Selected: ‘.$LogoColors.’
Order Details: ‘.$OrderDetails.’

Feel free to contact us with any questions about your logo order by responding to this email.
Once payment is received, you will begin to receive logo design samples usually within 24 hours
Just incase you have not done so, you can complete your payment at the following link ‘;

$sigstring = ‘


The Free Logo Makers Website
Easy. Instant. Logos
www.thefreelogomakers.com
Stay Connected with Us:
Email Our Support Team Email
View Tutorials on the free logo makers Youtube Channel TheFreeLogoMakers
Visit Our Facebook Page TheFreeLogomakers
Follow Us on Google+ +Thefreelogomakers
See us on Twitter @FreeLogoMaker
ee us on Pinterest Our Pins

‘;
$message_html = $message_html. $sigstring;

$message_plain = ‘Thank you for your logo order. Our designers will start working on your logo as soon as your payment is received. Feel free to contact us with any questions about your logo order by responding to this email. Once payment is received, you will begin to receive logo design samples usually within 24 hours. Mention your order number:’.$ordernumber.’in your correspondence to us’;

$mail = new PHPMailer;

$mail->ClearAddresses(); // prevent duplicate emails. Addition made in class.phpmailer.php – Line 756 is a new line

$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = ’email-smtp.us-east-1.amazonaws.com’; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = ‘AKIAJ6NOJFHFUDSCSMJA’; // SMTP username
$mail->Password = ‘AnjEjp3OrK5VSpqxiOpVSYDj72JffLT5XYSyR/Ckttvu’; // SMTP password
$mail->SMTPSecure = ‘tls’; // Enable encryption, ‘ssl’ also accepted

$mail->From = ‘sales@thefreelogomakers.com’;
$mail->FromName = ‘TheFreeLogoMakers’;
$mail->addAddress($EmailAddress); // Name is optional
$mail->addBCC (‘sales@thefreelogomakers.com’);

$mail->WordWrap = 50; // Set word wrap to 50 characters
//$mail->addAttachment($outfile); // Optional name
$mail->isHTML(true); // Set email format to HTML

$mail->Subject = $subject;
$mail->Body = $message_html; //’This is the HTML message body in bold!‘;
$mail->AltBody = $message_plain; //’This is the body in plain text for non-HTML mail clients’;

if(!$mail->send()) {
echo ‘Email could not be sent.’;
echo ‘Mailer Error: ‘ . $mail->ErrorInfo;
exit;

}

// Display code to pay now in PayPal

echo ‘Complete Your Order by submitting a payment for $99.00 using the Pay Now button below. Our designers will begin working on your logo order once your payment has been confirmed.

You should begin to receive logo design samples within 24 hours of your completed and paid order.‘;

echo ‘








‘;

// Close the database connection

$mysqli->close();
}

}
[/insert_php]