Heray-Was-Here
Server : Apache
System : Linux hybrid3195.ca.ns.planethoster.net 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
User : alliancerealtynb ( 1004)
PHP Version : 7.4.33
Disable Function : noop
Directory :  /home/alliancerealtynb/dev.alliancerealty.nb.ca/wp-content/mu-plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alliancerealtynb/dev.alliancerealty.nb.ca/wp-content/mu-plugins/alliance.php
<?php
if (!function_exists('custom_alliance_style')) {
    function custom_alliance_style() {
        wp_enqueue_style('custom-alliance-style', plugins_url('alliance.css', __FILE__), [], '1.2');
    }
    add_action('wp_enqueue_scripts', 'custom_alliance_style');
}

if (!function_exists('ajax_get_proprietaire_infos')) {
    function ajax_get_proprietaire_infos() {
        if (!is_admin() || !is_user_logged_in() || !current_user_can('edit_posts')) {
            exit('Unauthorized');
        }

        if (empty($_REQUEST['id'])) {
            echo json_encode([
                'type' => 'error',
                'value' => 'Missing id'
            ]);
            exit;
        }

        $id = filter_var($_REQUEST['id'], FILTER_VALIDATE_INT);
        if (!$id) {
            echo json_encode([
                'type' => 'error',
                'value' => 'Invalid id'
            ]);
            exit;
        }

        global $wpdb;
        $contact = $wpdb->get_row("SELECT tel, email FROM `{$wpdb->prefix}wpl_addon_crm_contacts` WHERE id = $id");

        if (!empty($contact)) {
            echo json_encode([
                'type' => 'success',
                'value' => [
                    'tel' => $contact->tel,
                    'email' => $contact->email
                ]
            ]);
        } else {
            echo json_encode([
                'type' => 'error',
                'value' => 'Contact not found'
            ]);
        }

        exit;
    }
    add_action('wp_ajax_get_proprietaire_infos', 'ajax_get_proprietaire_infos');
}

add_filter('frm_currency', function($currency, $form) {
    $form_id = is_object($form) ? $form->id : $form;
    if ($form_id == 4) {
        $currency = [
            'name' => 'cad_fr',
            'symbol_left' => '',
            'symbol_right' => ' $',
            'symbol_padding' => '',
            'thousand_separator' => ' ',
            'decimal_separator' => ',',
            'decimals' => 2
        ];
    }
    return $currency;
}, 10, 2);

Hry