query($sql)) {
die('There was an error running the query [' . $conn->error . ']');
} else {
$_SESSION["form_id"] = $conn->insert_id;
$form_name = urlencode($_POST["form_name"]);
$ch = curl_init('https://crm2.techlounge.co.in/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=DL&website=DRIVINGLICENCEHELP.COM&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$state.'&formName='.$form_name.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$_SESSION["panel_form_id_2"] = $response;
$_SESSION['form_name'] = $_POST['form_name'];
$_SESSION['applicant_name'] = $_POST['applicant_name'];
$_SESSION['mobile_number'] = $_POST['mobile_number'];
$_SESSION['email_id'] = $_POST['email_id'];
$_SESSION['total_amount'] = $product_price;
$_SESSION['order_id'] = generateTxnId(17);
include_once("editable/submit-form.php");
// Easebuzz Payment
$easebuzzObj = new Easebuzz($MERCHANT_KEY, $SALT, $ENV);
$postData = array (
"txnid" => "".$_SESSION['order_id']."",
"amount" => "".$product_price.".00"."",
"firstname" => "".$_POST["applicant_name"]."",
"email" => "".$_POST["email_id"]."",
"phone" => "".$_POST["mobile_number"]."",
"productinfo" => "".$_POST["form_name"]."",
"surl" => "https://drivinglicencehelp.com/response.php",
"furl" => "https://drivinglicencehelp.com/response.php",
"udf1" => "".$_SESSION["form_id"]."",
"udf2" => "licence_guide_book_form",
);
$easebuzzObj->initiatePaymentAPI($postData);
// Mailer
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'drivinglicencehelp.com';
$mail->SMTPAuth = true;
$mail->Username = 'no-reply@drivinglicencehelp.com';
$mail->Password = 'freeDOM@611#';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom("no-reply@drivinglicencehelp.com", "Driving Licence Registration");
$mail->addAddress("".$_POST["email_id"]."");
$mail->isHTML(true);
$mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully";
$mail->Body = "
Dear ".$_POST["applicant_name"].",
Thank you for submitting your application for ".$_POST["form_name"]." on our website.
";
$mail->send();
$mail->ClearAllRecipients();
$mail->addAddress("no-reply@drivinglicencehelp.com");
$mail->isHTML(true);
$mail->Subject = "New ".$_POST["form_name"]." Form Submitted";
$mail->Body = "APPLICANT NAME: ".$_POST["applicant_name"]."
MOBILE NUMBER: ".$_POST['mobile_number']."
EMAIL ID: ".$_POST['email_id']."
";
$mail->send();
}
catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
}
}
// Enquiry
if(isset($_POST["submit"])) {
$sql="
INSERT INTO licence_guide_book_form (
form_name,
applicant_name,
mobile_number,
email_id,
form_created_on
)
VALUES (
'".$_POST["form_name"]."',
'".$_POST["applicant_name"]."',
'".$_POST["mobile_number"]."',
'".$_POST["email_id"]."',
'".$date."'
)";
if(!$result = $conn->query($sql)){
die('There was an error running the query [' . $conn->error . ']');
}
else
{
$_SESSION["form_id"] = $conn->insert_id;
$product_price = 'ENQUIRY';
$ch = curl_init('https://crm2.techlounge.co.in/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=DL&website=DRIVINGLICENCEHELP.COM&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$state.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$_SESSION["panel_form_id_2"] = $response;
$form_name = urlencode($_POST["form_name"]);
// Mailer
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'drivinglicencehelp.com';
$mail->SMTPAuth = true;
$mail->Username = 'no-reply@drivinglicencehelp.com';
$mail->Password = 'freeDOM@611#';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom("no-reply@drivinglicencehelp.com", "Driving Licence Registration");
$mail->addAddress("".$_POST["email_id"]."");
$mail->isHTML(true);
$mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully";
$mail->Body = "
Dear ".$_POST["applicant_name"].",
Thank you for submitting your application for ".$_POST["form_name"]." on our website.
";
$mail->send();
$mail->ClearAllRecipients();
$mail->addAddress("no-reply@drivinglicencehelp.com");
$mail->isHTML(true);
$mail->Subject = "New ".$_POST["form_name"]." Form Submitted";
$mail->Body = "APPLICANT NAME: ".$_POST["applicant_name"]."
MOBILE NUMBER: ".$_POST['mobile_number']."
EMAIL ID: ".$_POST['email_id']."
";
$mail->send();
}
catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
echo "";
echo "";
}
}
?>