function wplc_pro_admin_menu_layout_display()
{
    if (!isset($_GET['action'])) {
        $wplc_current_user_id = get_current_user_id();
        global $wplc_basic_plugin_url;
        ?>

        <style>
            #wplc-support-tabs a.wplc-support-link {
            background: url('<?php 
        echo $wplc_basic_plugin_url;
        ?>
/images/support.png');
            right: 0px;
            top: 250px;
            height: 108px;
            width: 45px;
            margin: 0;
            padding: 0;
            position: fixed;
            z-index: 9999;
            display:block;
        }
        </style>
            <div id="wplc-support-tabs">
                <a class="wplc-support-link wplc-rotate" href="?page=wplivechat-menu-support-page"></a>
            </div>
        <div class='wplc_page_title'>

            <h1><?php 
        _e("Chat sessions", "wplivechat");
        ?>
</h1>

            <p><?php 
        _e("Please note: This window must be open in order to receive new chat notifications.", "wplivechat");
        ?>
</p>
            <?php 
        $is_agent = get_user_meta($wplc_current_user_id, 'wplc_ma_agent', true);
        if (!$is_agent) {
            $warning = "<p style='color: red;'><b>" . __('You are not a chat agent. Please make yourself a chat agent before trying to chat to visitors', 'wplivechat') . "</b></p>";
            echo $warning;
        }
        ?>
        </div>    
        <?php 
        wplc_pro_version_check();
        ?>
        
        <?php 
        //if(function_exists("wplc_ma_register")){
        $agent_id = wplc_ma_check_if_user_is_agent();
        //} else {
        //$agent_id = true;
        //}
        ?>
      

        <div id="wplc_sound"></div> 
        <?php 
        $wplc_pro_settings = get_option("WPLC_PRO_SETTINGS");
        if (isset($wplc_pro_settings['wplc_auto_online']) && $wplc_pro_settings['wplc_auto_online'] == 1) {
            ?>
        <div style="padding: 10px 0; display: block; margin: 0 auto; text-align: center;"><input type="checkbox" class="wplc_switchery" name="wplc_agent_status" id="wplc_agent_status" <?php 
            if (get_user_meta($wplc_current_user_id, "wplc_chat_agent_online", true)) {
                echo 'checked';
            }
            ?>
 /><div id="wplc_agent_status_text" style="display: inline-block; padding-left: 10px;"></div></div>
        <?php 
        }
        ?>
   
        <div id="wplc_admin_chat_holder">
            <div id='wplc_admin_chat_info_new'>
                <div class='wplc_chat_vis_count_box'>
                    <span class='wplc_vis_online'>0</span>
                    <span style='text-transform:uppercase;'>
                        <?php 
        _e("Visitors online", "wplivechat");
        ?>
                    </span>
                    <hr />
                    <p class='wplc-agent-info' id='wplc-agent-info'>
                        <span class='wplc_agents_online'><?php 
        echo wplc_ma_total_agents_online();
        ?>
</span>
                        <a href='?page=wplivechat-menu-settings#tabs-5' target="_BLANK"><?php 
        _e("Agent(s) online", "wplivechat");
        ?>
</a>
                    </p>
                    
                </div>
                
            </div>
            
            <div id="wplc_admin_chat_area_new">
                <div style="display:block;padding:10px;">
                    <ul class='wplc_chat_ul_header'>
                        <li><span class='wplc_header_vh wplc_headerspan_v'><?php 
        _e("Visitor", "wplivechat");
        ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_t'><?php 
        _e("Time", "wplivechat");
        ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_nr'><?php 
        _e("Type", "wplivechat");
        ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_d'><?php 
        _e("Data", "wplivechat");
        ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_s'><?php 
        _e("Status", "wplivechat");
        ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_a'><?php 
        _e("Action", "wplivechat");
        ?>
</span></li>
                    </ul>
                    <ul id='wplc_chat_ul'>


                    </ul>

                </div>

            </div>
            
        </div>

      
        <?php 
    } else {
        if (isset($_GET['aid'])) {
            if (!get_option('wplc_use_external_server')) {
                wplc_ma_update_agent_id(sanitize_text_field($_GET['cid']), sanitize_text_field($_GET['aid']));
            }
            if (function_exists('wplc_ce_activate')) {
                if (function_exists('wplc_ce_record_chat_agent')) {
                    wplc_ce_record_chat_agent(sanitize_text_field($_GET['cid']), sanitize_text_field($_GET['aid']));
                }
            }
            //}
        }
        if ($_GET['action'] == 'ac') {
            if (get_option('wplc_use_external_server')) {
                /* Come here */
                wplc_change_chat_status_ex(sanitize_text_field($_GET['cid']), 3);
                echo wplc_pro_draw_chat_area_ex(sanitize_text_field($_GET['cid']));
                if (isset($_GET['aid']) && get_option('wplc_use_external_server')) {
                    echo wplc_ma_update_agent_id_ex(sanitize_text_field($_GET['cid']), sanitize_text_field($_GET['aid']));
                }
            } else {
                wplc_change_chat_status(sanitize_text_field($_GET['cid']), 3);
                wplc_pro_draw_chat_area(sanitize_text_field($_GET['cid']));
            }
        } else {
            if ($_GET['action'] == 'history' && function_exists("wplc_register_pro_version")) {
                wplc_admin_pro_view_chat_history(sanitize_text_field($_GET['cid']));
            } else {
                if ($_GET['action'] == 'rc' && function_exists("wplc_register_pro_version")) {
                    wplc_admin_pro_request_chat(sanitize_text_field($_GET['cid']));
                } else {
                    if ($_GET['action'] == 'download_history' && function_exists('wplc_admin_pro_download_history')) {
                        wplc_admin_pro_download_history(sanitize_text_field($_GET['type']), sanitize_text_field($_GET['cid']));
                    }
                }
            }
        }
    }
}
function wplc_pro_admin_menu_layout_display()
{
    if (!isset($_GET['action'])) {
        $wplc_current_user_id = get_current_user_id();
        ?>
        <div class='wplc_page_title'>
            <h1><?php 
        _e("Chat sessions", "wplivechat");
        ?>
</h1>

            <p><?php 
        _e("Please note: This window must be open in order to receive new chat notifications.", "wplivechat");
        ?>
</p>
            <?php 
        $is_agent = get_user_meta($wplc_current_user_id, 'wplc_ma_agent', true);
        if (!$is_agent) {
            $warning = "<p style='color: red;'><b>" . __('You are not a chat agent. Please make yourself a chat agent before trying to chat to visitors', 'wplivechat') . "</b></p>";
            echo $warning;
        }
        ?>
        </div>    
        <?php 
        wplc_pro_version_check();
        ?>
        
        <?php 
        //if(function_exists("wplc_ma_register")){
        $agent_id = wplc_ma_check_if_user_is_agent();
        //} else {
        //$agent_id = true;
        //}
        ?>
                
        <div class="wplc_admin_dashboard_container">            
            <?php 
        $wplc_pro_settings = get_option("WPLC_PRO_SETTINGS");
        if (isset($wplc_pro_settings['wplc_auto_online']) && $wplc_pro_settings['wplc_auto_online'] == 1) {
            ?>
            <div style="padding: 10px 0;"><input type="checkbox" class="wplc_switchery" name="wplc_agent_status" id="wplc_agent_status" <?php 
            if (get_user_meta($wplc_current_user_id, "wplc_chat_agent_online", true)) {
                echo 'checked';
            }
            ?>
 /><div id="wplc_agent_status_text" style="display: inline-block; padding-left: 10px;"></div></div>
            <?php 
        }
        ?>
                    
            <div id="wplc_sound"></div>
            <div id="wplc_admin_chat_area">
                <?php 
        echo wplc_list_chats_pro($agent_id);
        ?>
            </div>
            <div id="wplc_admin_visitor_area">
                <?php 
        echo wplc_list_visitors($agent_id);
        ?>
            </div>
        </div>
        <?php 
    } else {
        if (isset($_GET['aid'])) {
            //if(function_exists("wplc_ma_register")){
            wplc_ma_update_agent_id($_GET['cid'], $_GET['aid']);
            //}
        }
        if ($_GET['action'] == 'ac') {
            wplc_change_chat_status($_GET['cid'], 3);
            wplc_pro_draw_chat_area($_GET['cid']);
        } else {
            if ($_GET['action'] == 'history' && function_exists("wplc_register_pro_version")) {
                wplc_admin_pro_view_chat_history($_GET['cid']);
            } else {
                if ($_GET['action'] == 'rc' && function_exists("wplc_register_pro_version")) {
                    wplc_admin_pro_request_chat($_GET['cid']);
                }
            }
        }
    }
}
function wplc_admin_menu_layout_display()
{
    if (current_user_can('wplc_ma_agent') || current_user_can('manage_options')) {
        wplc_stats("chat_dashboard");
        global $wplc_basic_plugin_url;
        if (!isset($_GET['action'])) {
            ?>
        <style>
                #wplc-support-tabs a.wplc-support-link {
            background: url('<?php 
            echo $wplc_basic_plugin_url;
            ?>
/images/support.png');
            right: 0px;
            top: 250px;
            height: 108px;
            width: 45px;
            margin: 0;
            padding: 0;
            position: fixed;
            z-index: 9999;
            display:block;
        }
        </style>

            <div id="wplc-support-tabs">
                <a class="wplc-support-link wplc-rotate" href="?page=wplivechat-menu-support-page"></a>
            </div>
            <div class='wplc_page_title'>
                <h1><?php 
            _e("Chat Dashboard", "wplivechat");
            ?>
</h1>
                <?php 
            wplc_first_time_tutorial();
            ?>

                <p><?php 
            _e("Please note: This window must be open in order to receive new chat notifications.", "wplivechat");
            ?>
</p>
            </div>
            
            <div id="wplc_sound"></div>

            <div id="wplc_admin_chat_holder">
                <div id='wplc_admin_chat_info_new'>
                    <div class='wplc_chat_vis_count_box'>
                        <span class='wplc_vis_online'>0</span>
                        <span style='text-transform:uppercase;'>
                            <?php 
            _e("Visitors online", "wplivechat");
            ?>
                        </span>
                        <hr />
                        <p class='wplc-agent-info' id='wplc-agent-info'>
                            <span class='wplc_agents_online'>1</span>
                            <a href='javascript:void(0);'><?php 
            _e("Agent(s) online", "wplivechat");
            ?>
</a>
                        </p>
                        
                    </div>
                    
                </div>
                
                <div id="wplc_admin_chat_area_new">
                    <div style="display:block;padding:10px;">
                    <ul class='wplc_chat_ul_header'>
                        <li><span class='wplc_header_vh wplc_headerspan_v'><?php 
            _e("Visitor", "wplivechat");
            ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_t'><?php 
            _e("Time", "wplivechat");
            ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_nr'><?php 
            _e("Type", "wplivechat");
            ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_d'><?php 
            _e("Data", "wplivechat");
            ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_s'><?php 
            _e("Status", "wplivechat");
            ?>
</span></li>
                        <li><span class='wplc_header_vh wplc_headerspan_a'><?php 
            _e("Action", "wplivechat");
            ?>
</span></li>
                    </ul>
                    <ul id='wplc_chat_ul'>


                    </ul>
                        <p>
            <?php 
            _e("With the Pro add-on of WP Live Chat Support, you can", "wplivechat");
            ?>
 
            <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php 
            _e("see who's online and initiate chats", "wplivechat");
            ?>
" target=\"_BLANK\">
               <?php 
            _e("initiate chats", "wplivechat");
            ?>
            </a> <?php 
            _e("with your online visitors with the click of a button.", "wplivechat");
            ?>
 
            <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php 
            _e("Buy the Pro add-on now.", "wplivechat");
            ?>
" target=\"_BLANK\">
               <strong>
                   <?php 
            _e("Buy the Pro add-on now.", "wplivechat");
            ?>
               </strong>
            </a>
            </p>
                    </div>

                </div>
                
            </div>
            
            
          

            <?php 
        } else {
            if ($_GET['action'] == 'ac') {
                wplc_change_chat_status(sanitize_text_field($_GET['cid']), 3);
                if (function_exists('wplc_ma_register')) {
                    wplc_ma_update_agent_id(sanitize_text_field($_GET['cid']), sanitize_text_field($_GET['agent_id']));
                }
                if (function_exists("wplc_register_pro_version")) {
                    wplc_pro_draw_chat_area(sanitize_text_field($_GET['cid']));
                } else {
                    wplc_draw_chat_area(sanitize_text_field($_GET['cid']));
                }
            }
        }
    }
}
Пример #4
0
function wplc_admin_menu_layout_display()
{
    if (!isset($_GET['action'])) {
        ?>
        <div style='float:right; display:block; width:450px;  padding:10px; text-align:center; background-color: #EEE; border: 1px solid #E6DB55; margin:10px;'>
            <strong><?php 
        _e("Experiencing problems with the plugin?", "wplivechat");
        ?>
</strong>
            <br />
            <a href='http://wp-livechat.com/documentation/' title='WP Live Chat Support Documentation' target='_BLANK'><?php 
        _e("Review the documentation.", "wplivechat");
        ?>
</a> 
        <?php 
        _e("Or ask a question on our", "wplivechat");
        ?>
  <a href='http://wp-livechat.com/forums/forum/support/' title='WP Live Chat Support Forum' target='_BLANK'><?php 
        _e('Support forum.', 'wplivechat');
        ?>
</a>
        </div>
        <br/>
        <br/>
        <br/>
        <div class='wplc_page_title'>
            <h1><?php 
        _e("Chat sessions", "wplivechat");
        ?>
</h1>

            <p><?php 
        _e("Please note: This window must be open in order to receive new chat notifications.", "wplivechat");
        ?>
</p>
        </div>
        <div id="wplc_sound"></div>

        <!----->

        <div class="wplc_admin_dashboard_container">
            <div id="wplc_sound"></div>
            <div id="wplc_admin_chat_area">
        <?php 
        if (function_exists("wplc_register_pro_version")) {
            echo wplc_list_chats_pro();
        } else {
            echo wplc_list_chats();
        }
        ?>
            </div>
            <div id="wplc_admin_visitor_area">
                <h1><?php 
        _e("Visitors on site", "wplivechat");
        ?>
</h1>    
                <p>
                    <?php 
        _e("With the Pro add-on of WP Live Chat Support, you can", "wplivechat");
        ?>
 
                    <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php 
        _e("see who's online and initiate chats", "wplivechat");
        ?>
" target=\"_BLANK\">
                        <?php 
        _e("see who's online and initiate chats", "wplivechat");
        ?>
                    </a> <?php 
        _e("with your online visitors with the click of a button.", "wplivechat");
        ?>
 
                    <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php 
        _e("Buy the Pro add-on now for only \$19.95 once off. Free Updates FOREVER.", "wplivechat");
        ?>
" target=\"_BLANK\">
                        <strong>
                            <?php 
        _e("Buy the Pro add-on now for only \$19.95 once off. Free Updates Forever.", "wplivechat");
        ?>
                        </strong>
                    </a>
                </p>
            </div>
        </div>

        <?php 
    } else {
        if ($_GET['action'] == 'ac') {
            wplc_change_chat_status($_GET['cid'], 3);
            if (function_exists('wplc_ma_register')) {
                wplc_ma_update_agent_id($_GET['cid'], $_GET['agent_id']);
            }
            if (function_exists("wplc_register_pro_version")) {
                wplc_pro_draw_chat_area($_GET['cid']);
            } else {
                wplc_draw_chat_area($_GET['cid']);
            }
        }
    }
}