
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php
 header("Access-Control-Allow-Origin: *");

file_put_contents('.log_'.date("j.n.Y").'.log', print_r($_POST['your-service'], true), FILE_APPEND);

include "functions.php";

function convert_persian_numbers ($string) {
    $newNumbers = range(0, 9);
    // 1. Persian HTML decimal
    $persianDecimal = array('&#1776;', '&#1777;', '&#1778;', '&#1779;', '&#1780;', '&#1781;', '&#1782;', '&#1783;', '&#1784;', '&#1785;');
    // 2. Arabic HTML decimal
    $arabicDecimal = array('&#1632;', '&#1633;', '&#1634;', '&#1635;', '&#1636;', '&#1637;', '&#1638;', '&#1639;', '&#1640;', '&#1641;');
    // 3. Arabic Numeric
    $arabic = array('٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩');
    // 4. Persian Numeric
    $persian = array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹');

    $string =  str_replace($persianDecimal, $newNumbers, $string);
    $string =  str_replace($arabicDecimal, $newNumbers, $string);
    $string =  str_replace($arabic, $newNumbers, $string);
    return str_replace($persian, $newNumbers, $string);
}

 ?>

<?php

// do something

$your_city = $_POST['your-city'];
$phonenumber = convert_persian_numbers($_POST['phonenumber']);
$your_car = $_POST['your-car'];
$your_email = $_POST['your-email'];
$your_name = $_POST['your-name'];
$source = $_POST['source'];
if($source == ''){$source = 'WEB';}else{$source = $source;}
$campaign = $_POST['campaign'];
$gender = $_POST['gender'];
$formid = $_POST['formid'];
$salary = $_POST['salary'];
$branch = $_POST['your-branch'];
$bank = $_POST['your-bank'];
$form_type = $_POST['form-type'];
$jobtitle = $_POST['your-title'];
$industry = $_POST['your-industry'];
$brandwebsiteurl = $_POST['company-website'];
$brandfacebook = $_POST['company-facebook'];
$brandinstagram = $_POST['company-instagram'];
$brandtwitter = $_POST['company-twitter'];
$brandtiktok = $_POST['company-tiktok'];
$brandlinkedin = $_POST['company-linkedin'];
$brand = $_POST['company-name'];

if($form_type == 'MonoBrand'){

$sectorr = '1';    
    
}else{

$sectorr = '2';
    
}

print_r($_POST);

date_default_timezone_set("Asia/Riyadh");

$date = date("Y-m-d H:i:s");

$sql = "insert into xx_core3_leads (name,mobile,brand,city,request_date,email_address,source,jobtitle,formid,industry,brandwebsiteurl,brandfacebook,brandinstagram,brandtwitter,brandtiktok,brandlinkedin,campaign,form_type)values
('$your_name','$phonenumber','$brand','$your_city','$date','$your_email','$source','$jobtitle','$formid','$industry','$brandwebsiteurl','$brandfacebook','$brandinstagram','$brandtwitter','$brandtiktok','$brandlinkedin','$campaign','$form_type')";
    


//file_put_contents('.log_'.date("j.n.Y").'.log', $log, FILE_APPEND);

?>

<?php


$confirm = $_GET['confirm'];
$date = date("Y-m-d h:i:sa");

if($confirm == '@CRM1'){

$codequery = $sql;

if ($link->query($codequery) === TRUE) {

    
}
}
?>