alert('Invalid Verification Code'); history.back();"); // } // } include_once('./config.php'); //contain datbase & payment gateway credentials include_once('./validate-special.php'); //form validations if(defined('PAYMENT_GATEWAY')) { //atom $orderId ='order_'.(rand(10000000000,99999999999)); } if(defined('PAYMENT_GATEWAY')){ //cashfree function generate($length = 7) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars) - 1)]; } return 'ORDER_' . $token; } $orderId = generate(13); }else{ $orderId =''; } $applicant_name = urlencode($_POST['applicant_name']); $mobile_number = urlencode($_POST['mobile_number']); $email_id = urlencode($_POST['email_id']); //state// if(isset($_POST['state'])) { $state = urlencode($_POST['state']); }elseif(isset($_POST['office_state'])) { $state = urlencode($_POST['office_state']); }else{ $state = '-'; } $crm_website = 'UDYOG-ADHAAR.IN'; $url1 = 'udyog-adhaar.in'; $webpath = pathinfo($url1, PATHINFO_FILENAME); $website = strtoupper($webpath); $table='msme_form'; //All Udyam New & Re Forms if (isset($_POST['tos']) && ($_POST['tos'] == "on")) { //Retrive Product Price According To Product Name(form_id) $_SESSION['table_id'] = 'msme_form'; $payment_status = 'Unpaid'; $sql ="SELECT product_price FROM product_lists WHERE product_name = '".$_POST["form_id"]."'"; $result = $conn->query($sql); $row = $result->fetch_assoc(); $product_price = $row["product_price"]; $form_page_url = $_POST["form_id"].'.php'; $form_page_url = str_replace('_','-',$form_page_url); $authId = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyz"), 00000, 99999); $sql="INSERT INTO $table (form_name,authId,form_page_url, applicant_name, mobile_number, email_id, business_address, plant_state, plant_district, plant_pincode, office_address, office_state, office_district, office_pincode, annual_turnover, gender, social_category, physically_handicapped, aadhaar_number, uam_number, gstin_number, pan_card_number, bank_account_number, ifsc_code, business_name, date_of_commencement_of_business, type_of_organisation, main_business_activity_of_enterprise, additional_details_about_business, persons_employed_male, persons_employed_female, persons_employed_other, persons_employed_total, investment_in_plant_and_machinery, total_amount, payment_status,order_id, terms_of_service) VALUES ('".$_POST["form_name"]."','".$authId."','".$form_page_url."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$_POST["business_address"]."', '".$_POST["plant_state"]."', '".$_POST["plant_district"]."', '".$_POST["plant_pincode"]."', '".$_POST["office_address"]."', '".$_POST["office_state"]."', '".$_POST["office_district"]."', '".$_POST["office_pincode"]."', '".$_POST["annual_turnover"]."', '".$_POST["gender"]."', '".$_POST["social_category"]."', '".$_POST["physically_handicapped"]."', '".$_POST["aadhaar_number"]."', '".$_POST["uam_number"]."', '".$_POST["gstin_number"]."', '".$_POST["pan_card_number"]."', '".$_POST["bank_account_number"]."', '".$_POST["ifsc_code"]."', '".$_POST["business_name"]."', '".$_POST["date_of_commencement_of_business"]."', '".$_POST["type_of_organisation"]."', '".$_POST["main_business_activity_of_enterprise"]."', '".$_POST["additional_details_about_business"]."', '".$_POST["persons_employed_male"]."', '".$_POST["persons_employed_female"]."', '".$_POST["persons_employed_other"]."', '".$_POST["persons_employed_total"]."', '".$_POST["investment_in_plant_and_machinery"]."','".$product_price."', '".$payment_status."','".$orderId."', 'Checked' )"; if(!$result = $conn->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=MSME&website='.$crm_website.'&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$state.'&formName='.$form_name.'&solNumber='.urlencode($_POST["sol_number"]).''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_2"] = $response; //Payment Gateway Redirection if(defined('PAYMENT_GATEWAY')){ include_once('./cashfree/request.php'); }else { include_once('request.php'); } require_once './vendor/send-email.php'; } } ?>