Файловый менеджер - Редактировать - /home/d46091/foodlicenceonline.net/mail.php
Назад
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); require_once('include/connection.php'); session_start(); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; date_default_timezone_set('Asia/Kolkata'); $date = date('d-m-Y'); $crm_website = strtoupper($_SERVER['SERVER_NAME']); require 'vendor/autoload.php'; $mobile_number = filter_var($_POST['mobile_number'], FILTER_SANITIZE_NUMBER_INT); // Validate mobile number starts with 9, 8, 7, or 6 if (!preg_match('/^[6-9]\d{9}$/', $mobile_number)) { die('Invalid mobile number. It must start with 9, 8, 7, or 6 and be 10 digits long.'); } $applicant_name = urlencode($_POST['applicant_name']); // $mobile_number = urlencode($_POST['mobile_number']); $email_id = urlencode($_POST['email_id']); $form_name = urlencode($_POST['form_name']); // Tech Lounge if (isset($_POST['form_id'])&& $_POST['form_id'] == 'fssai_enquiry') { $sql=" INSERT INTO fssai ( form_name, applicant_name, mobile_number, email_id, state, selected_product, form_created_on ) VALUES ( '".$_POST["form_name"]."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$_POST["state"]."', '".$_POST["product"]."', '".$date."' )"; if (!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; // ---------------------------------- function generate($length = 7) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars) - 1)]; } return 'ORDER_' . $token; } $post = [ 'api_key' => 123456, 'formId' => $_SESSION["form_id"], 'vendor' => 'TTG', 'business' => 'FSSAI', 'website' => 'foodlicenceonline.net', 'amount' => '--', 'status' => 'Unpaid', 'name' => $_POST['applicant_name'], 'mobile' => $_POST['mobile_number'], 'email' => $_POST['email_id'], 'state' => '--', 'formName' => $_POST['form_name'], 'orderId' => 'ENQUIRY_'.generate(), ]; $ch = curl_init('https://newcrm.techlounge.co.in/v1/form-data-send-to-crm'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); curl_close($ch); // -------------------------------------- $ch = curl_init('https://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website='.$crm_website.'&amount=ENQUIRY&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.urlencode($_POST["product"]).''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Mailer $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'foodlicenceonline.net'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@foodlicenceonline.net'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@foodlicenceonline.net", "FOOD LICENCE"); $mail->addAddress("".$_POST["email_id"].""); $mail->isHTML(true); $mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully"; $mail->Body = " Dear <strong>".$_POST["applicant_name"]."</strong>, <br><br> Thank you for submitting your request for ".$_POST["form_name"]." on our website. <br><br> This mail is an acknowledgement of successful submission of your application, on our website. This mail does not confirm the payment status against the submitted application. <br><br> Click on the link below to make payment. <br><br> Regards,<br> Team Processing,<br> For Queries: info@foodlicenceonline.net "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@foodlicenceonline.net"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Submitted"; $mail->Body = " APPLICANT NAME: ".$_POST["applicant_name"]."<br> MOBILE NUMBER: ".$_POST['mobile_number']."<br> EMAIL ID: ".$_POST['email_id']."<br> "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } echo "<script>alert('Thanks For submiting your enquiry, Our Team Will assist you shortly.')</script>"; echo "<script>setTimeout(\"location.href = './';\",300);</script>"; } if (isset($_POST['form_id'])&& $_POST['form_id'] == 'water_testing') { $sql=" INSERT INTO fssai ( form_name, applicant_name, mobile_number, email_id, business_name, business_address, state, district, pincode, licence_type, form_created_on ) VALUES ( '".$_POST["form_name"]."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$_POST["business_name"]."', '".$_POST["office_address"]."', '".$_POST["office_state"]."', '".$_POST["office_district"]."', '".$_POST["pincode"]."', '".$_POST["check_licence"]."', '".$date."' )"; if (!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } else { $formType = $_POST["check_licence"].' Water Testing Form'; $_SESSION["form_id"] = $conn->insert_id; $ch = curl_init('https://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website='.$crm_website.'&amount=ENQUIRY&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.urlencode($formType).''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); // Mailer $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'foodlicenceonline.net'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@foodlicenceonline.net'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@foodlicenceonline.net", "FOOD LICENCE"); $mail->addAddress("".$_POST["email_id"].""); $mail->isHTML(true); $mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully"; $mail->Body = " Dear <strong>".$_POST["applicant_name"]."</strong>, <br><br> Thank you for submitting your request for ".$_POST["form_name"]." on our website. <br><br> This mail is an acknowledgement of successful submission of your application, on our website. This mail does not confirm the payment status against the submitted application. <br><br> Regards,<br> Team Processing,<br> For Queries: info@foodlicenceonline.net "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@foodlicenceonline.net"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Submitted"; $mail->Body = " APPLICANT NAME: ".$_POST["applicant_name"]."<br> MOBILE NUMBER: ".$_POST['mobile_number']."<br> EMAIL ID: ".$_POST['email_id']."<br> "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } echo "<script>alert('Thanks For submiting your enquiry, Our Team Will assist you shortly.')</script>"; echo "<script>setTimeout(\"location.href = './';\",300);</script>"; function generate($length = 7) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars) - 1)]; } return 'ORDER_' . $token; } } if (isset($_POST['form_id'])&& $_POST['form_id'] == 'annual_return_enquiry') { $sql=" INSERT INTO fssai ( form_name, applicant_name, mobile_number, email_id, existing_licence_number, state, total_amount, form_created_on ) VALUES ( '".$_POST["form_name"]."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$_POST['existing_licence_number']."', '".$_POST["office_state"]."', '".$product_price."', '".$date."' )"; 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://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website='.$crm_website.'&amount=ANNUAL_RETURN_ENQUIRY&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$_POST["office_state"].'&formName='.$form_name.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $data = [ 'name' => preg_replace('/[^A-Za-z0-9\s]/', '', $_POST['applicant_name']), 'email' => $_POST['email_id'], 'mobile' => $_POST['mobile_number'], 'status' => 'Unpaid', 'order_id' => $orderId, 'payment_id' => '', 'created_on' => $date = date('Y-m-d H:i:s'), ]; // print_r($data); // die(); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.cashfree.com/pg/orders', 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 => '{ "order_id": "'.$orderId.'", "order_amount": "'.$product_price.'", "order_currency": "INR", "order_note": "Additional order info", "customer_details": { "customer_id": "12345", "customer_name": "'.str_replace('/', '', $data['name']).'", "customer_email": "'.$data['email'].'", "customer_phone": "'.$data['mobile'].'" },"order_meta": { "return_url": "https://foodlicenceonline.net/cashfree/return-annual.php?order_id={order_id}" } }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'x-client-id: ' . $clientId, 'x-client-secret: ' . $clientSecret, 'x-api-version: 2022-01-01' ), )); $response = curl_exec($curl); curl_close($curl); // echo $response; // $jsons = json_decode($response); // echo '<pre>'; // print_r($jsons); // die(); $response_array = json_decode($response, true); $pay_link = $response_array['payment_link']; // $payment_session_id = $response_array['payment_session_id']; // $paymentSessionId = $payment_session_id; header('Location:'.$pay_link.''); die(); die(); } echo "<script>alert('Thanks For submiting your enquiry, Our Team Will assist you shortly.')</script>"; echo "<script>setTimeout(\"location.href = './';\",300);</script>"; } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка