HEX
Server: LiteSpeed
System: Linux s917.lon1.mysecurecloudhost.com 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: assibfaf (3034)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/assibfaf/customassignment.us/prox-inquiry.php
<?php
/**
 * @package    Proxim
 * @author     Davison Pro <davisonpro.coder@gmail.com | https://davisonpro.dev>
 * @copyright  2019 Proxim
 * @version    1.0.0
 * @since      File available since Release 1.0.0
 */

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'prox-bootstrap.php';

if (!defined('ABSPATH') ) {
    define('ABSPATH', dirname(__FILE__) . '/');
}

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'wp-config.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'wp-settings.php';

$app->registerStylesheet('wp-css', get_stylesheet_uri(), ['media' => 'all', 'server' => 'remote']);

$menu_locations = get_nav_menu_locations();
$header_mainID = $menu_locations['header_menu'];

$header_nav = wp_get_nav_menu_items($header_mainID);

$smarty = $app->container->smarty;

$smarty->assign([
    'header_nav' => $header_nav
]);

use Proxim\Tools;
use Proxim\Util\ArrayUtils;

$templateVars = array(
    'page' => [
        'title' => 'Place a New Inquiry',
        'description' => 'Place a New Inquiry'
    ],
    'app' => 'standalone-form',
    'orderformPurpose' => 'newInquiry',
    'target' => 'order',
);

$cookie = $app->container->cookie;

$defaultCountry = array();
if ( $cookie->country_code ) {
    $countries = $globals['countries'];
    $country_code = Tools::strtolower($cookie->country_code);

    if ( ArrayUtils::has($countries, $country_code) ) {
        $country = ArrayUtils::get($countries, $country_code);
        $defaultCountry = array(
            "id" => $country_code,
            "name" => ArrayUtils::get($country, 'name'),
            "code" => ArrayUtils::get($country, 'code'),
            "phoneCode" => ArrayUtils::get($country, 'phoneCode')
        );
    }
}

$templateVars = array_merge($templateVars, $defaultCountry);

$app->setVars($templateVars);

$app->setTemplate('inquiry');
$app->display();