Ejemplo n.º 1
0
        <script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
	<link rel="stylesheet" href="/ui/jquery-ui.css">
	<link rel="stylesheet" type="text/css" href="../info/tooltip.css"/>
        <script src="/wp-content/themes/twentytwelve/js/bootstrap.min.js"></script>
	<script>
		var ajax_url = '<?php 
echo admin_url('admin-ajax.php');
?>
';
                
                <?php 
$user_id = get_current_user_id();
if ($user_id == 0) {
    echo 'var UserContacInfo = [];' . "\n";
} else {
    $user_info = tzs_get_user_meta($user_id);
    $meta = explode(';', $user_info['telephone']);
    echo 'var UserContacInfo = ["' . $user_info['fio'] . '", "' . $user_info['user_email'] . '", "' . $meta[0] . '"];' . "\n";
}
?>
                function onChatButtonClick() {
                    jivo_api.open();
                    
                    if (UserContacInfo.length > 0) {
                        jivo_api.setContactInfo(
                             {
                                name : UserContacInfo[0],
                                email : UserContacInfo[1],
                                phone : UserContacInfo[2]
                             }
                         );                        
Ejemplo n.º 2
0
function tzs_print_user_contacts($row, $form_type, $show_address = 0)
{
    $user_id = get_current_user_id();
    $user_info = tzs_get_user_meta($row->user_id);
    $output_tbody = '<div class="tbl_products_contact" title="Контактные данные ';
    switch ($form_type) {
        case 'products':
            if ($row->sale_or_purchase == 1) {
                $output_tbody .= 'продавца';
            } else {
                $output_tbody .= 'покупателя';
            }
            break;
        case 'trucks':
            $output_tbody .= 'перевозчика';
            break;
        case 'shipments':
            $output_tbody .= 'владельца груза';
            break;
        default:
    }
    $output_tbody .= '">';
    if ($user_info['company'] != '' || $user_info['fio'] != '') {
        $output_tbody .= '<a href="/company/?id=' . $row->user_id . '&type=' . $form_type . '">';
        if ($user_info['company'] != '') {
            $output_tbody .= $user_info['company'];
        } else {
            $output_tbody .= $user_info['fio'];
        }
        $output_tbody .= '</a>';
        if ($show_address) {
            if ($show_address == 1) {
                $meta = explode(',', $user_info['adress']);
                $output_tbody .= '<span>' . $meta[0] . '</span>';
            } else {
                $output_tbody .= '<span>' . $user_info['adress'] . '</span>';
            }
        } else {
            //$output_tbody .= '<span>&nbsp;</span>';
        }
        if ($user_id == 0 && $GLOBALS['tzs_au_contact_view_all'] == false) {
            $output_tbody .= '<div class="tzs_au_contact_view_all" phone-user-not-view="' . $row->user_id . '">Для просмотра контактов необходимо <a href="/account/login/">войти</a> или <a href="/account/registration/">зарегистрироваться</a></div>';
        }
        if ($user_info['company'] != '') {
            $phone_list = explode(';', $user_info['tel_fax']);
        } else {
            $phone_list = explode(';', $user_info['telephone']);
        }
        if ($show_address) {
            $rcnt = count($phone_list);
        } else {
            $rcnt = count($phone_list) > 3 ? 3 : count($phone_list);
        }
        for ($i = 0; $i < $rcnt; $i++) {
            $output_tbody .= '<div class="tbl_products_contact_phone" phone-user="******">
            <b>' . preg_replace("/^(.\\d{2})(\\d{3})(\\d{3})(\\d{2})(\\d{1,2})/", '$1 ($2)', $phone_list[$i]) . '</b>
            <span>' . preg_replace("/^(.\\d{2})(\\d{3})(\\d{3})(\\d{2})(\\d{1,2})/", '$1 ($2) $3-$4-$5', $phone_list[$i]) . '</span>
            <a onclick="showUserContacts(this, ' . $row->user_id . ', ';
            if ($user_id == 0 && $GLOBALS['tzs_au_contact_view_all'] == false) {
                $output_tbody .= 'true';
            } else {
                $output_tbody .= 'false';
            }
            $output_tbody .= ');">Показать</a>
            </div>';
        }
        if ($show_address && $user_info['user_email'] != '') {
            $output_tbody .= '<div class="tbl_products_contact_email" phone-user="******">
            <b>' . substr($user_info['user_email'], 0, 3) . 'XX@XX</b>
            <span>' . $user_info['user_email'] . '</span>
            <a onclick="showUserContacts(this, ' . $row->user_id . ', ';
            if ($user_id == 0 && $GLOBALS['tzs_au_contact_view_all'] == false) {
                $output_tbody .= 'true';
            } else {
                $output_tbody .= 'false';
            }
            $output_tbody .= ');">Показать</a>
            </div>';
        }
        if ($show_address && $user_info['skype'] != '') {
            $output_tbody .= '<div class="tbl_products_contact_skype" phone-user="******">
            <b>' . substr($user_info['skype'], 0, 3) . 'XXXX</b>
            <span>' . $user_info['skype'] . '</span>
            <a onclick="showUserContacts(this, ' . $row->user_id . ', ';
            if ($user_id == 0 && $GLOBALS['tzs_au_contact_view_all'] == false) {
                $output_tbody .= 'true';
            } else {
                $output_tbody .= 'false';
            }
            $output_tbody .= ');">Показать</a>
            </div>';
        }
    } else {
        $output_tbody .= 'Контактные данные не указаны';
    }
    $output_tbody .= '</div>';
    return $output_tbody;
}