'; // echo $dateDiff; $sql=" INSERT INTO fssai ( form_name, form_page_url, applicant_name, email_id, mobile_number, business_name, nature_business, food_category, designition, office_address, state, pincode, turnover, years, total_amount, payment_status, order_id, terms_of_service, form_created_on, c_gateway, c_gateway_merchant, payment_stage ) VALUES ( '".$_POST["form_name"]."', 'index.php', '".mysqli_real_escape_string($conn,$_POST["applicant_name"])."', '".mysqli_real_escape_string($conn,$_POST["email_id"])."', '".mysqli_real_escape_string($conn,$_POST["mobile_number"])."', '".mysqli_real_escape_string($conn,$_POST["name_of_business"])."', '".mysqli_real_escape_string($conn,$_POST["nature_business"])."', '".mysqli_real_escape_string($conn,$_POST["food_category"])."', '".mysqli_real_escape_string($conn,$_POST["designition"])."', '".mysqli_real_escape_string($conn,$_POST["office_address"])."', '".mysqli_real_escape_string($conn,$_POST["state"])."', '".mysqli_real_escape_string($conn,$_POST["pincode"])."', '".mysqli_real_escape_string($conn,$_POST["turnover"])."', '".mysqli_real_escape_string($conn,$_POST["years"])."', '".$product_price."', '".$payment_status."', '".$orderId."', 'Checked', '".$date."', '".$currentPaymentGateway."', '".$merchantEmail."', '".$stage."' )"; if(!$result = $conn->query($sql)){ die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; $ch = curl_init('https://crm.techlounge.co.in/api.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website=foodlicenceapply.com&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_1"] = $response; $form_name = urlencode($_POST["form_name"]); $sales_executive =urlencode($_POST['sales_executive']); $sol_msg = urlencode('Payment Initiated By ').$sales_executive; $ch = curl_init('https://crm5.in/api/telesales-registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website=foodlicenceapply.com&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.$form_name.'&sales_executive='.$sales_executive.'&solNumber='.$sol_msg.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_5"] = $response; $ch = curl_init('https://crm11.in/api/telesales-registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website=FOODLICENCEAPPLY.COM&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.$form_name.'&sales_executive='.$sales_executive.'&solNumber='.$sol_msg.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_11"] = $response; //Payment Gateway Redirection if (defined('PAYMENT_GATEWAY') && $currentPaymentGateway == 'CASHFREE') { include_once('./cashfree/request.php'); } else if (defined('PAYMENT_GATEWAY') && $currentPaymentGateway == 'ATOM') { include_once('./atom/submit.php'); } else if (defined('PAYMENT_GATEWAY') && $currentPaymentGateway == 'PAYU') { include_once('./payu/payu-submit.php'); } else if (defined('PAYMENT_GATEWAY') && $currentPaymentGateway == 'RAZORPAY') { include_once('./razorpay/razorpay-submit.php'); } else if (defined('PAYMENT_GATEWAY') && $currentPaymentGateway == 'INSTAMOJO') { include_once('./instamojo/submit.php'); } function generateRandomInvoice($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomInvoice = ''; for ($i = 0; $i < $length; $i++) { $randomInvoice .= $characters[rand(0, $charactersLength - 1)]; } return $randomInvoice; } $invRandGenId = generateRandomInvoice(); $host_name = 'foodlicenceapply.com'; $email = $_POST['email_id']; // $payment_link ='https://paynw.xyz/Transaction.php?invId='.$invRandGenId.''; // $curls = curl_init(); // curl_setopt_array($curls, array( // CURLOPT_URL => 'https://paynw.xyz/submit.php', // CURLOPT_RETURNTRANSFER => true, // CURLOPT_ENCODING => '', // CURLOPT_MAXREDIRS => 10, // CURLOPT_TIMEOUT => 0, // CURLOPT_FOLLOWLOCATION => true, // CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, // CURLOPT_CUSTOMREQUEST => 'POST', // CURLOPT_POSTFIELDS => array('formIds' => $_SESSION["panel_form_id_2"], 'formName' => 'FSSAI Registration','name' => $applicant_name,'mobile' => $mobile_number,'email' => $email,'website' => $host_name,'invId' => $invRandGenId,'business'=>'FSSAI', 'kindOfBusiness' => $_POST["nature_business"], 'year' => $_POST["years"],'turnover' => $_POST['turnover'] ), // )); // $responses = curl_exec($curls); // curl_close($curls); // $responses; //payVid// $sql_select_cid = 'SELECT * FROM cid WHERE uid = "'.$_SESSION["form_id"].'"'; $result_select_cid = $conn->query($sql_select_cid); $row_select_cid = $result_select_cid ->fetch_assoc(); $uId = $row_select_cid['uid']; $cid = $row_select_cid['cid']; $sql_select_form = 'SELECT * FROM fssai WHERE id = "'.$uId.'"'; $result_select_form = $conn->query($sql_select_form); $row_select_form = $result_select_form->fetch_assoc(); $price = $row_select_form['total_amount']; $pageName = $row_select_form['page_name']; $rand =''; $payCondtn='&oid=true&oid=true'; $host_name = 'foodlicenceapply.com/'.$pageName; $payment_links = 'https://'.$host_name.'?cid='.$cid; header('Refresh: 0;URL=crequire("checkout/{$checkout}.php")'); // Mailer $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'foodlicenceapply.com'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@foodlicenceapply.com'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@foodlicenceapply.com", "FOOD LICENCE"); $mail->addAddress("".$_POST["email_id"].""); $mail->isHTML(true); $mail->Subject = "Ref : Your ".$_POST['form_name']." "; $mail->Body = "

Dear ".$_POST["applicant_name"]."

Thank you for submitting your application for ".$_POST["form_name"]." on our website.


This mail is an acknowledgement of successful submission of your application, however this mail does not confirm the payment status against the submitted application.


If you have already made payment, then please sit back and relax, your order will be queued up for processing. If any documents will be required, you will be intimated regarding the same on your registered email address.


Regards,
Team Processing,
For Order Status: order@foodlicenceapply.com

"; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@foodlicenceapply.com"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Form Submitted"; $mail->Body = " APPLICANT NAME: ".$_POST["applicant_name"]."
EMAIL ID: ".$_POST['email_id']."
MOBILE NUMBER: ".$_POST['mobile_number']."
NATURE OF BUSINESS: ".$_POST['nature_business']."
FOOD CATEGORY: ".$_POST['food_category']."
DESIGNATION: ".$_POST['designition']."
PINCODE: ".$_POST["pincode"]."
NUMBER OF YEARS: ".$_POST['years']." "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } } ?>