<?php
defined('ABSPATH') or die('No script kiddies please!!'); 
if (!empty($account_row)) {
    $ciws_main_settings = get_option('ciws_main_settings');
    $account_id = $account_row->account_id;

    $account_details = maybe_unserialize($account_row->ciws_account_details);
    $sc_template = (!empty($account_details['shortcode']['shortcode_template'])) ? $account_details['shortcode']['shortcode_template'] : 'template-1';
    $button_label = (!empty($account_details['shortcode']['button_heading'])) ? $account_details['shortcode']['button_heading'] : 'Need Help? Chat with us';
    $online_option = (!empty($account_details['account']['online'])) ? $account_details['account']['online'] : '1';
    $account_number = (!empty($account_details['account']['account_number'])) ? $account_details['account']['account_number'] : '';
    $account_name = (!empty($account_row->account_name)) ? $account_row->account_name : '';
    $url_open_tab = (!empty($ciws_main_settings['url']['open_in_new_tab'])) ? 1 : 0;
    $url_for_desktop = (!empty($ciws_main_settings['url']['url_for_desktop'])) ? $ciws_main_settings['url']['url_for_desktop'] : 'web';
    $url_for_mobile = (!empty($ciws_main_settings['url']['url_for_mobile'])) ? $ciws_main_settings['url']['url_for_mobile'] : 'web';
    $default_text = (!empty($account_details['account']['default_msg'])) ? $account_details['account']['default_msg'] : '';
    $button_fill_color = (!empty($account_details['shortcode']['button_fill_color'])) ? $account_details['shortcode']['button_fill_color'] : '';
    $button_title_color = (!empty($account_details['shortcode']['button_title_color'])) ? $account_details['shortcode']['button_title_color'] : '';
    include('ciws-url-link.php');


    ?>
    <div class="ciws-button-wrapper <?php echo esc_attr($sc_template); ?>">
        <div class="ciws-button">
            <a href="<?php echo esc_attr($wh_url); ?>"
                target="<?php echo esc_attr(($url_open_tab == 1) ? '_blank' : ''); ?>" class="ciws-btn-content-wrap ciws-computer-url">
                <div class="ciws-icon-wrap">
                    <img src="<?php echo esc_url(CIWS_IMG_DIR . '/ciws-whatsapp.svg'); ?>" alt="">
                </div>
                <div class="ciws-btn-info-wrap">
                    <div class="ciws-btn-info">

                        <div class="ciws-account-name"><?php echo esc_html($account_name); ?></div>
                        <div class="ciws-status"><span><span>
                        </div>
                    </div>
                    <div class="ciws-btn-title"><?php echo esc_html($button_label); ?></div>
                </div>
            </a>
            <a href="<?php echo esc_attr($mob_wh_url); ?>" target="<?php echo esc_attr(($url_open_tab == 1) ? '_blank' : ''); ?>" class="ciws-btn-content-wrap ciws-mobile-url">
                <div class="ciws-icon-wrap">
                    <img src="<?php echo esc_url(CIWS_IMG_DIR . '/ciws-whatsapp.svg'); ?>" alt="">
                </div>
                <div class="ciws-btn-info-wrap">
                    <div class="ciws-btn-info">

                        <div class="ciws-account-name"><?php echo esc_html($account_name); ?></div>
                        <div class="ciws-status"><span><span>
                        </div>
                    </div>
                    <div class="ciws-btn-title"><?php echo esc_html($button_label); ?></div>
                </div>
            </a>
        </div>
    </div>

    <?php
    if (!empty($button_fill_color)) {
        wp_register_style('ciws-frontend-custom',false);
        wp_enqueue_style('ciws-frontend-custom');
    }
    include(CIWS_PATH . '/includes/cores/ciws-customize.php');
}
