CMXX - Dealers
This commit is contained in:
@@ -1163,4 +1163,44 @@ function decodeVIN(){
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function toggleClosed(day, skipToggle = false) {
|
||||
const checkbox = document.getElementById(`closed_${day}`);
|
||||
const startInput = document.getElementById(`start_${day}`);
|
||||
const endInput = document.getElementById(`end_${day}`);
|
||||
|
||||
if (checkbox.checked) {
|
||||
// If closed, disable time inputs and set hidden field for null value
|
||||
startInput.disabled = true;
|
||||
endInput.disabled = true;
|
||||
|
||||
// Remove the time inputs from form submission
|
||||
startInput.name = "";
|
||||
endInput.name = "";
|
||||
|
||||
// Add a hidden field to explicitly set the day to null
|
||||
if (!document.getElementById(`null_${day}`)) {
|
||||
const hiddenField = document.createElement('input');
|
||||
hiddenField.type = 'hidden';
|
||||
hiddenField.id = `null_${day}`;
|
||||
hiddenField.name = `opening_hours[${day}]`;
|
||||
hiddenField.value = 'null';
|
||||
checkbox.parentNode.appendChild(hiddenField);
|
||||
}
|
||||
} else {
|
||||
// If open, enable time inputs
|
||||
startInput.disabled = false;
|
||||
endInput.disabled = false;
|
||||
|
||||
// Restore the time input names for form submission
|
||||
startInput.name = `opening_hours[${day}][start]`;
|
||||
endInput.name = `opening_hours[${day}][end]`;
|
||||
|
||||
// Remove the hidden null field if it exists
|
||||
const hiddenField = document.getElementById(`null_${day}`);
|
||||
if (hiddenField) {
|
||||
hiddenField.parentNode.removeChild(hiddenField);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -437,20 +437,14 @@ function template_footer($js_script = '') {
|
||||
$user_mail = $_SESSION['email'] ?? '';
|
||||
$veliti_cim = '';
|
||||
if (veliti_cim){
|
||||
$veliti_cim = '<iframe src="https://change.veliti.nl/request_popup.php?language='.$lancode.'&email='.$user_mail.'" style="border: solid 1px;border-radius: 5px;min-width:400px;min-height:400px;"></iframe>';
|
||||
}
|
||||
|
||||
// DO NOT INDENT THE BELOW CODE
|
||||
echo <<<EOT
|
||||
</main>
|
||||
<button id="support_btn" class="btn" style="opacity: 0.8;position: fixed;bottom: 23px;right: 28px;background:#4a79b400;font-size:36px;z-index:999;" onclick="openForm()"><img src="./assets/images/tss-persoon.svg" alt="tss-persoon" height="115"></button>
|
||||
<div class="form-popup" id="request">$veliti_cim
|
||||
$veliti_cim = '
|
||||
<button id="support_btn" class="btn" style="opacity: 0.8;position: fixed;bottom: 23px;right: 28px;background:#4a79b400;font-size:36px;z-index:999;" onclick="openForm()"><img src="./assets/images/tss-persoon.svg" alt="tss-persoon" height="115"></button>
|
||||
<div class="form-popup" id="request">
|
||||
<iframe src="https://change.veliti.nl/request_popup.php?language='.$lancode.'&email='.$user_mail.'" style="border: solid 1px;border-radius: 5px;min-width:400px;min-height:400px;"></iframe>
|
||||
<div class="close">
|
||||
<button type="button" style="border: solid 1px;" onclick="closeForm()">X</button>
|
||||
</div>
|
||||
</div>
|
||||
<script src="./assets/admin.js"></script>
|
||||
{$js_script}
|
||||
<script>
|
||||
function openForm() {
|
||||
document.getElementById("request").style.display = "block";
|
||||
@@ -460,6 +454,16 @@ echo <<<EOT
|
||||
document.getElementById("request").style.display = "none";
|
||||
}
|
||||
</script>
|
||||
';
|
||||
}
|
||||
|
||||
// DO NOT INDENT THE BELOW CODE
|
||||
echo <<<EOT
|
||||
</main>
|
||||
$veliti_cim
|
||||
<script src="./assets/admin.js"></script>
|
||||
{$js_script}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
EOT;
|
||||
@@ -860,6 +864,7 @@ function getWhereclauselvl2($table_name,$permission,$partner,$method){
|
||||
"config" => "pc.accounthierarchy",
|
||||
"software" => "p.accounthierarchy",
|
||||
"transactions" => "tx.accounthierarchy",
|
||||
"dealers" => "d.accounthierarchy",
|
||||
"categories" => "c.accounthierarchy"
|
||||
];
|
||||
|
||||
@@ -2090,7 +2095,30 @@ if(($imageFileType == "jpg" || $imageFileType == "png" || $imageFileType == "jpe
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// UPLOAD PICTURE for PRODUCTS
|
||||
// UPLOAD PICTURE for DEALERS
|
||||
//------------------------------------------
|
||||
function uploadDealers($name){
|
||||
|
||||
$target_dir = dirname(__FILE__)."/images/dealers/";
|
||||
$input_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
|
||||
$imageFileType = strtolower(pathinfo($input_file,PATHINFO_EXTENSION));
|
||||
$target_file = $target_dir . $name.'.jpg';
|
||||
$file_input_check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
|
||||
|
||||
//Do when JPG or PNG or JPEG or GIF and smaller than 5MB
|
||||
if(($imageFileType == "jpg" || $imageFileType == "png" || $imageFileType == "jpeg" || $imageFileType == "gif" || $imageFileType == "png") && $_FILES["fileToUpload"]["size"] < 5000000 && $file_input_check !== false) {
|
||||
//Upload picture
|
||||
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
|
||||
echo "Done";
|
||||
} else {
|
||||
echo "Error";
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// UPLOAD PICTURE for CARTEST
|
||||
//------------------------------------------
|
||||
function uploadrequest($key){
|
||||
$target_dir = dirname(__FILE__)."/images/cartests/";
|
||||
@@ -2106,8 +2134,7 @@ function uploadrequest($key){
|
||||
$_POST['questions'][$key] = $location;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//------------------------------------------
|
||||
// displayImages
|
||||
@@ -3980,4 +4007,394 @@ function getDomainName($hostname) {
|
||||
else {
|
||||
return $hostname;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================
|
||||
// encode ID to UUID
|
||||
//=======================================
|
||||
function encodeUuid($number) {
|
||||
$alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
$base = strlen($alphabet);
|
||||
|
||||
$encoded = '';
|
||||
while ($number) {
|
||||
$encoded = $alphabet[$number % $base] . $encoded;
|
||||
$number = floor($number / $base);
|
||||
}
|
||||
|
||||
$encoded = $encoded ?: '0';
|
||||
|
||||
// Pad with leading zeros from the alphabet (which is '0') if shorter than 5 characters
|
||||
while (strlen($encoded) < 5) {
|
||||
$encoded = '0' . $encoded;
|
||||
}
|
||||
|
||||
return $encoded;
|
||||
}
|
||||
//=======================================
|
||||
// decode UUID to ID
|
||||
//=======================================
|
||||
function decodeUuid($encoded) {
|
||||
$alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
$base = strlen($alphabet);
|
||||
|
||||
$number = 0;
|
||||
$length = strlen($encoded);
|
||||
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$char = $encoded[$i];
|
||||
$position = strpos($alphabet, $char);
|
||||
|
||||
if ($position === false) {
|
||||
// Character not found in alphabet
|
||||
return false;
|
||||
}
|
||||
|
||||
$number = $number * $base + $position;
|
||||
}
|
||||
|
||||
return $number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate marketing content for a spa/hot tub company based on business criteria
|
||||
*
|
||||
* @param string $companyName The name of the company
|
||||
* @param string $city The city location
|
||||
* @param bool $gardenCenter Whether the company is a garden center
|
||||
* @param string $brandType Single brand or Multi brand
|
||||
* @param string $showroomSize Normal, Large, or Extra Large
|
||||
* @param string $offering Economy-Premium or Premium-Highend
|
||||
* @param string $dealerType Local, Professional, or Corporate
|
||||
* @param bool $multipleLocations Whether the company has multiple locations
|
||||
* @return array An array containing short description, long description, and unique selling points
|
||||
*/
|
||||
function generateSpaCompanyContent($companyName, $city, $gardenCenter, $brandType, $showroomSize, $offering, $dealerType, $multipleLocations) {
|
||||
// Determine content template to use based on criteria combination
|
||||
$templateIndex = determineTemplateIndex($gardenCenter, $brandType, $offering, $dealerType, $multipleLocations);
|
||||
|
||||
// Get content templates
|
||||
$shortDescTemplates = getShortDescriptionTemplates();
|
||||
$longDescTemplates = getLongDescriptionTemplates();
|
||||
$uspTemplates = getUniqueSellingPointsTemplates();
|
||||
|
||||
// Replace placeholders in templates
|
||||
$shortDescription = str_replace(
|
||||
['{CompanyName}', '{City}', '{BrandType}', '{ShowroomSize}'],
|
||||
[$companyName, $city, $brandType, $showroomSize],
|
||||
$shortDescTemplates[$templateIndex]
|
||||
);
|
||||
|
||||
$longDescription = str_replace(
|
||||
['{CompanyName}', '{City}', '{BrandType}', '{ShowroomSize}'],
|
||||
[$companyName, $city, $brandType, $showroomSize],
|
||||
$longDescTemplates[$templateIndex]
|
||||
);
|
||||
|
||||
$usps = [];
|
||||
foreach ($uspTemplates[$templateIndex] as $usp) {
|
||||
$usps[] = str_replace(
|
||||
['{CompanyName}', '{City}', '{BrandType}', '{ShowroomSize}'],
|
||||
[$companyName, $city, $brandType, $showroomSize],
|
||||
$usp
|
||||
);
|
||||
}
|
||||
|
||||
return [
|
||||
'short_description' => $shortDescription,
|
||||
'long_description' => $longDescription,
|
||||
'usp1' => $usps[0],
|
||||
'usp2' => $usps[1],
|
||||
'usp3' => $usps[2]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine which template to use based on company criteria
|
||||
*/
|
||||
function determineTemplateIndex($gardenCenter, $brandType, $offering, $dealerType, $multipleLocations) {
|
||||
// This is a simplified method to select a template
|
||||
// In a real implementation, you might want more sophisticated logic
|
||||
if ($gardenCenter) {
|
||||
if (strpos($offering, 'Premium') !== false) {
|
||||
return 3; // Garden Center Premium
|
||||
} else {
|
||||
return 7; // Garden Center High-End
|
||||
}
|
||||
}
|
||||
|
||||
if ($dealerType == 'Local') {
|
||||
if ($brandType == 'Single brand') {
|
||||
return strpos($offering, 'Economy') !== false ? 0 : 4; // Local Economy Single Brand or Local High-End Single Brand
|
||||
}
|
||||
}
|
||||
|
||||
if ($dealerType == 'Professional') {
|
||||
if ($brandType == 'Single brand') {
|
||||
return 9; // Professional Single Brand Specialist
|
||||
} else {
|
||||
return strpos($offering, 'Economy') !== false ? 5 : 1; // Professional Economy Multi-Brand or Professional Premium Multi-Brand
|
||||
}
|
||||
}
|
||||
|
||||
if ($dealerType == 'Corporate') {
|
||||
if ($multipleLocations) {
|
||||
return 2; // Corporate High-End Multi-Location
|
||||
} else {
|
||||
return 8; // Corporate Premium Multi-Brand
|
||||
}
|
||||
}
|
||||
|
||||
if ($multipleLocations && strpos($offering, 'Economy') !== false) {
|
||||
return 6; // Multi-Location Economy Single Brand
|
||||
}
|
||||
|
||||
// Default to template 0 if no conditions match
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all short description templates
|
||||
*/
|
||||
function getShortDescriptionTemplates() {
|
||||
return [
|
||||
// 0. Local Economy Single Brand
|
||||
"{CompanyName} is {City}'s trusted provider of quality hot tubs and spas at affordable prices, featuring the complete {BrandType} collection in our {ShowroomSize} showroom.",
|
||||
|
||||
// 1. Professional Premium Multi-Brand
|
||||
"{CompanyName} brings premium spa experiences to {City} with our curated selection of luxury brands in our {ShowroomSize} professional showroom.",
|
||||
|
||||
// 2. Corporate High-End Multi-Location
|
||||
"With locations across the region including {City}, {CompanyName} delivers exceptional high-end spa solutions backed by corporate reliability and service excellence.",
|
||||
|
||||
// 3. Garden Center Premium
|
||||
"{CompanyName} combines garden expertise with premium spa offerings in {City}, creating the perfect outdoor relaxation destinations within our {ShowroomSize} garden center.",
|
||||
|
||||
// 4. Local High-End Single Brand
|
||||
"{CompanyName} is {City}'s exclusive dealer for {BrandType} luxury spas, offering personalized service in an intimate {ShowroomSize} showroom experience.",
|
||||
|
||||
// 5. Professional Economy Multi-Brand
|
||||
"As {City}'s professional spa specialists, {CompanyName} presents affordable solutions from leading brands in our {ShowroomSize} showroom designed for every budget.",
|
||||
|
||||
// 6. Multi-Location Economy Single Brand
|
||||
"{CompanyName} makes quality relaxation accessible across multiple locations including {City}, specializing exclusively in the reliable {BrandType} collection.",
|
||||
|
||||
// 7. Garden Center High-End
|
||||
"Elevate your garden oasis with {CompanyName}'s selection of high-end spas and hot tubs, showcased within our {ShowroomSize} {City} garden center.",
|
||||
|
||||
// 8. Corporate Premium Multi-Brand
|
||||
"{CompanyName} combines corporate expertise with personalized service in {City}, offering premium spa solutions from the industry's most respected brands.",
|
||||
|
||||
// 9. Professional Single Brand Specialist
|
||||
"{City}'s dedicated {BrandType} specialists at {CompanyName} provide expert guidance and professional support in our {ShowroomSize} showroom."
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all long description templates
|
||||
*/
|
||||
function getLongDescriptionTemplates() {
|
||||
return [
|
||||
// 0. Local Economy Single Brand
|
||||
"Welcome to {CompanyName}, {City}'s dedicated hot tub and spa center where affordability meets quality. Our {ShowroomSize} showroom exclusively features the complete {BrandType} line, offering reliable relaxation solutions for every home and budget. As a locally owned business, we take pride in providing personalized service to our neighbors while maintaining competitive pricing. Our knowledgeable staff guides you through the entire process from selection to installation, ensuring your perfect spa experience.",
|
||||
|
||||
// 1. Professional Premium Multi-Brand
|
||||
"{CompanyName} has established itself as {City}'s premier destination for premium spa experiences. Our professional team showcases a carefully selected range of luxury brands in our {ShowroomSize} showroom, each chosen for superior craftsmanship and innovative features. We combine technical expertise with a consultative approach, helping clients discover the perfect spa solution for their lifestyle and wellness goals. From initial design consultation through professional installation and ongoing maintenance, our comprehensive service ensures a seamless ownership experience.",
|
||||
|
||||
// 2. Corporate High-End Multi-Location
|
||||
"With our flagship location in {City} and showrooms across the region, {CompanyName} delivers unparalleled access to high-end spa solutions. Our corporate structure ensures consistent quality, competitive pricing, and exceptional service at every location. The {ShowroomSize} {City} showroom features our complete collection of luxury spa brands, each representing the pinnacle of design, technology, and comfort. Our team of spa professionals provides expert guidance backed by our company-wide commitment to customer satisfaction and long-term support.",
|
||||
|
||||
// 3. Garden Center Premium
|
||||
"At {CompanyName}, we've expanded our {City} garden expertise to include premium spa and hot tub solutions that complement your outdoor living space. Our {ShowroomSize} garden center now showcases a thoughtfully curated selection of quality spas designed to transform your backyard into a year-round wellness retreat. Our unique perspective combines landscaping knowledge with spa technology expertise, allowing us to help you create integrated outdoor environments where garden beauty meets relaxation therapy. Visit our {City} location to explore how our premium spa offerings can enhance your garden sanctuary.",
|
||||
|
||||
// 4. Local High-End Single Brand
|
||||
"{CompanyName} brings exclusive {BrandType} luxury spas to discerning clients throughout {City}. Our intimate {ShowroomSize} showroom creates a personalized shopping experience where you can explore every detail of these exceptional wellness products. As {City}'s dedicated {BrandType} specialists, we offer unmatched product knowledge and customization options not available elsewhere. Our commitment to white-glove service extends from your first consultation through years of ownership, with dedicated support from our team who knows your installation personally.",
|
||||
|
||||
// 5. Professional Economy Multi-Brand
|
||||
"{CompanyName} was founded on the belief that quality relaxation should be accessible to everyone in {City}. Our {ShowroomSize} showroom features carefully selected spa brands that deliver reliable performance without premium price tags. Our professional team applies the same expertise and attention to detail regardless of your budget, helping you navigate options to find the perfect balance of features and affordability. We handle everything from site preparation to installation and maintenance education, ensuring a stress-free experience that matches our stress-relieving products.",
|
||||
|
||||
// 6. Multi-Location Economy Single Brand
|
||||
"With {CompanyName}'s expanding presence across the region, including our {City} location, we've streamlined operations to bring you exceptional value through our exclusive partnership with {BrandType}. Our {ShowroomSize} showrooms showcase the complete range of these reliable spas, with consistent pricing and service standards at every location. By focusing on a single trusted manufacturer, we've developed specialized expertise that benefits our customers through knowledgeable guidance, efficient service, and optimized inventory that ensures prompt delivery and installation.",
|
||||
|
||||
// 7. Garden Center High-End
|
||||
"{CompanyName} has evolved our {City} garden center concept to include a curated collection of high-end spas and hot tubs that represent the perfect fusion of nature and luxury. Our {ShowroomSize} showroom displays these premium wellness products in contextual settings that help you envision the transformation of your own outdoor space. Our unique approach combines horticultural expertise with spa technology knowledge, allowing us to create integrated relaxation environments that function beautifully through every season. Experience the difference at our {City} location, where garden artistry meets wellness innovation.",
|
||||
|
||||
// 8. Corporate Premium Multi-Brand
|
||||
"As {City}'s corporate-backed premium spa provider, {CompanyName} combines the reliability of organizational strength with the personal touch of dedicated local experts. Our {ShowroomSize} showroom presents a comprehensive selection of premium brands, each meeting our rigorous standards for quality, innovation, and value. Our structured approach ensures consistency through every phase of ownership, from transparent pricing and professional needs assessment through expert installation and scheduled maintenance programs. Experience the confidence that comes from working with {City}'s most established spa provider.",
|
||||
|
||||
// 9. Professional Single Brand Specialist
|
||||
"{CompanyName} has dedicated our {City} business to becoming the region's foremost experts in {BrandType} spas and hot tubs. Our {ShowroomSize} showroom is designed to showcase every model and feature in this exceptional line, with working displays that demonstrate the unique benefits of these wellness systems. Our professional staff undergoes specialized factory training, making them uniquely qualified to help you select, customize, and maintain your {BrandType} spa. Choose {City}'s only dedicated {BrandType} specialists for an ownership experience as refined as the products we represent."
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all unique selling points templates
|
||||
*/
|
||||
function getUniqueSellingPointsTemplates() {
|
||||
return [
|
||||
// 0. Local Economy Single Brand
|
||||
[
|
||||
"Exclusive {BrandType} dealer offering the full product line at competitive prices",
|
||||
"Locally owned with personalized service from neighbors who care about your experience",
|
||||
"Complete solutions from selection through installation with no hidden costs"
|
||||
],
|
||||
|
||||
// 1. Professional Premium Multi-Brand
|
||||
[
|
||||
"Curated selection of premium brands chosen for superior quality and innovation",
|
||||
"Professional consultation process that matches your lifestyle with the perfect spa",
|
||||
"Comprehensive service from design consultation through lifetime maintenance"
|
||||
],
|
||||
|
||||
// 2. Corporate High-End Multi-Location
|
||||
[
|
||||
"Regional presence with consistent high-end offerings across all locations",
|
||||
"Corporate buying power delivering competitive pricing on luxury products",
|
||||
"Standardized excellence in customer care backed by substantial resources"
|
||||
],
|
||||
|
||||
// 3. Garden Center Premium
|
||||
[
|
||||
"Integrated approach to outdoor living combining garden expertise with spa technology",
|
||||
"Contextual showroom displays demonstrating how spas enhance garden environments",
|
||||
"Year-round wellness solutions that complement your existing garden investments"
|
||||
],
|
||||
|
||||
// 4. Local High-End Single Brand
|
||||
[
|
||||
"Exclusive {City} source for the complete {BrandType} luxury collection",
|
||||
"Intimate showroom experience with personalized attention to your specific needs",
|
||||
"Specialized knowledge of customization options not available at general retailers"
|
||||
],
|
||||
|
||||
// 5. Professional Economy Multi-Brand
|
||||
[
|
||||
"Carefully vetted affordable brands that maximize features while minimizing cost",
|
||||
"Professional guidance typically reserved for luxury customers, at every price point",
|
||||
"Transparent pricing with no compromise on installation quality or service"
|
||||
],
|
||||
|
||||
// 6. Multi-Location Economy Single Brand
|
||||
[
|
||||
"Specialized {BrandType} expertise developed through exclusive brand focus",
|
||||
"Consistent pricing and service standards across all regional locations",
|
||||
"Optimized inventory management ensuring faster delivery and installation"
|
||||
],
|
||||
|
||||
// 7. Garden Center High-End
|
||||
[
|
||||
"Unique perspective integrating luxury spas into complete garden environments",
|
||||
"Seasonal expertise ensuring your spa enhances your outdoor space year-round",
|
||||
"One-stop resource for creating cohesive outdoor relaxation destinations"
|
||||
],
|
||||
|
||||
// 8. Corporate Premium Multi-Brand
|
||||
[
|
||||
"Organizational strength providing stability and reliability throughout ownership",
|
||||
"Structured approach from consultation through installation and maintenance",
|
||||
"Corporate accountability backing every product sold and service performed"
|
||||
],
|
||||
|
||||
// 9. Professional Single Brand Specialist
|
||||
[
|
||||
"Deep {BrandType} expertise through specialized factory training and certification",
|
||||
"Complete demonstration capability showing every model in working condition",
|
||||
"Unmatched product knowledge of the complete {BrandType} feature set and options"
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// Generate dealer information ++++++++++++++
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
function generateDealerInformation($token){
|
||||
|
||||
//INCLUDE US LANGUAGE
|
||||
include dirname(__FILE__,2).'/settings/translations/translations_US.php';
|
||||
|
||||
//GET ALL DEALERS
|
||||
$api_url = '/v2/dealers/list=';
|
||||
$responses = ioAPIv2($api_url,'',$token);
|
||||
$log_results =[];
|
||||
|
||||
if(!empty($responses)){
|
||||
//decode the API response
|
||||
$responses = json_decode($responses,true);
|
||||
|
||||
//loop through translation records and create variables
|
||||
foreach ($responses as $response){
|
||||
|
||||
$new_content = [];
|
||||
//Generate content for missing data
|
||||
$keysToCheck = ['short_description', 'long_description', 'usp1', 'usp2', 'usp3'];
|
||||
|
||||
foreach ($keysToCheck as $key) {
|
||||
|
||||
$gc = ($response['garden_center'] == 0 ? false : true);
|
||||
$ml = ($response['locations'] == 0 ? false : true);
|
||||
|
||||
//GENERATE DATA
|
||||
$generated_content = generateSpaCompanyContent(
|
||||
$response['name'], // Company name
|
||||
$response['city'], // City
|
||||
$gc, // Garden center (yes/no)
|
||||
${'brand_type_'.$response['brand_type']}, // Brand type
|
||||
${'showroom_size_'.$response['showroom_size']}, // Showroom size
|
||||
${'focus_offering_'.$response['focus_offering']}, // Offering
|
||||
${'dealer_type_'.$response['dealer_type']}, // Dealer type
|
||||
$ml // Multiple locations
|
||||
);
|
||||
|
||||
if (isset($response[$key]) && (empty($response[$key]) || $response[$key] == '')) {
|
||||
$new_content['rowID'] = encodeUuid($response['rowID']);
|
||||
$new_content[$key] = $generated_content[$key];
|
||||
}
|
||||
}
|
||||
|
||||
//GET ALL POST DATA
|
||||
$payload = json_encode($new_content, JSON_UNESCAPED_UNICODE);
|
||||
//API call
|
||||
$api_call = ioAPIv2('/v2/dealers', $payload,$token);
|
||||
$api_response = json_decode($api_call ,true);
|
||||
|
||||
//Provide feedback
|
||||
$log_results[$response['rowID']] = $api_response['rowID'].' '.$api_response['status'];
|
||||
}
|
||||
}
|
||||
return $log_results;
|
||||
}
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// Function to check if origin matches allowed patterns
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
function isOriginAllowed($origin, $allowedPatterns) {
|
||||
if (empty($origin)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Parse the origin to get the host part
|
||||
$parsedOrigin = parse_url($origin);
|
||||
$host = $parsedOrigin['host'] ?? '';
|
||||
|
||||
if (empty($host)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the host matches any of our patterns (exact match or subdomain)
|
||||
foreach ($allowedPatterns as $pattern) {
|
||||
// Check for exact match
|
||||
if ($host === $pattern) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for subdomain match (domain.example.com)
|
||||
$patternWithDot = '.' . $pattern;
|
||||
if (substr($host, -strlen($patternWithDot)) === $patternWithDot) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BIN
assets/images/main/background_section.jpg
Normal file
BIN
assets/images/main/background_section.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 587 KiB |
16
assets/images/marker-shadow.svg
Normal file
16
assets/images/marker-shadow.svg
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
viewBox="0 0 817.2 820" style="enable-background:new 0 0 817.2 820;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.shadow{fill-rule:evenodd;clip-rule:evenodd;fill:url(#gradient); fill-opacity:0.7; filter: blur(15px);}
|
||||
</style>
|
||||
<radialGradient id="gradient" cx="526.5995" cy="486.8359" r="478.1535" fx="275.8764" fy="893.9829" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" style="stop-color:#5C5C5C;stop-opacity:0.9477"/>
|
||||
<stop offset="0.1123" style="stop-color:#474747;stop-opacity:0.7805"/>
|
||||
<stop offset="0.3403" style="stop-color:#202020;stop-opacity:0.4413"/>
|
||||
<stop offset="0.5232" style="stop-color:#090909;stop-opacity:0.1692"/>
|
||||
<stop offset="0.6369" style="stop-color:#000000;stop-opacity:0"/>
|
||||
</radialGradient>
|
||||
<path class="shadow" d="M778.8,483.2c-34.3,52.8-101.9,94.1-150.3,124.6L255.7,820L169,522l170.8-299.6l0-0.1l9.8-17.3
|
||||
C421.3,94.6,585,56.3,702.5,132.5S850.3,372.8,778.8,483.2z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
20
assets/images/marker.svg
Normal file
20
assets/images/marker.svg
Normal file
@@ -0,0 +1,20 @@
|
||||
<svg viewBox="0 0 500 820" version="1.1" xmlns="http://www.w3.org/2000/svg" xml:space="preserve"
|
||||
style="fill-rule: evenodd; clip-rule: evenodd; stroke-linecap: round;">
|
||||
<defs>
|
||||
<linearGradient x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.30025e-15,-37.566,37.566,2.30025e-15,416.455,540.999)" id="map-marker-38-f">
|
||||
<stop offset="0" stop-color="rgb(18,111,198)"/>
|
||||
<stop offset="1" stop-color="rgb(76,156,209)"/>
|
||||
</linearGradient>
|
||||
<linearGradient x1="0" y1="0" x2="1" y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.16666e-15,-19.053,19.053,1.16666e-15,414.482,522.486)"
|
||||
id="map-marker-38-s">
|
||||
<stop offset="0" stop-color="rgb(46,108,151)"/>
|
||||
<stop offset="1" stop-color="rgb(56,131,183)"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g transform="matrix(19.5417,0,0,19.5417,-7889.1,-9807.44)">
|
||||
<path fill="#FFFFFF" d="M421.2,515.5c0,2.6-2.1,4.7-4.7,4.7c-2.6,0-4.7-2.1-4.7-4.7c0-2.6,2.1-4.7,4.7-4.7 C419.1,510.8,421.2,512.9,421.2,515.5z"/>
|
||||
<path d="M416.544,503.612C409.971,503.612 404.5,509.303 404.5,515.478C404.5,518.256 406.064,521.786 407.194,524.224L416.5,542.096L425.762,524.224C426.892,521.786 428.5,518.433 428.5,515.478C428.5,509.303 423.117,503.612 416.544,503.612ZM416.544,510.767C419.128,510.784 421.223,512.889 421.223,515.477C421.223,518.065 419.128,520.14 416.544,520.156C413.96,520.139 411.865,518.066 411.865,515.477C411.865,512.889 413.96,510.784 416.544,510.767Z" stroke-width="1.1px" fill="url(#map-marker-38-f)" stroke="url(#map-marker-38-s)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user