| Server IP : 13.126.101.145 / Your IP : 216.73.217.50 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.3.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/rentals_updated/wp-content/themes/hello-elementor-child/custom/ |
Upload File : |
<?php
include('../../../../wp-config.php');
global $wpdb;
//print_r($_POST);exit;
$full_name = $_POST['full_name'];
$lead_email = $_POST['lead_email'];
$lead_phone = $_POST['lead_phone'];
$location = $_POST['location'];
$region = getRegionBuy($location);
$product_name = $_POST['product_name'];
$subsidary_products = $_POST['subsidary_products'];
$remarks = $_POST['remarks'];
$date = date('Y-m-d H:i:s');
$user_ID = get_current_user_id();
// to store data in leads table
$result = $wpdb->insert('wp_buyequipment_enquiry', array(
'full_name' => $full_name,
'user_id' => $user_ID ?? 0,
'lead_email' => $lead_email,
'lead_phone' => $lead_phone,
'location' => $location,
'region' => $region,
'product_name' => $product_name,
'subsidary_products' => $subsidary_products,
'remarks'=> $remarks,
'created_on' => $date
));
if($result == 1){
echo 1;
}else{
echo 2;
}
function getRegionBuy($location) {
$south = ['Karnataka', 'Kerala', 'Tamil Nadu'];
$east = ['Andhra Pradesh', 'Telangana'];
$west = ['Maharashtra', 'Goa', 'Gujarat'];
$north = ['Madhya Pradesh', 'Chhattisgarh'];
if (in_array($location, $south)) {
return 'South';
} elseif (in_array($location, $north)) {
return 'North';
} elseif (in_array($location, $east)) {
return 'East';
} elseif (in_array($location, $west)) {
return 'West';
} else {
return 'Others';
}
}