<?php
defined('_SITEGUARDING_WAP') or die;

class FUNC_WAP2_antivirus
{
    public static function PageHTML()  
    {
        ini_set('max_execution_time',7200);
        set_time_limit ( 7200 );

        wp_enqueue_style( 'plgwap2_LoadStyle_UI' );
        wp_enqueue_script( 'plgwap2_LoadJS_UI', '', array(), false, true );
        
        $flag_show_message_REVIEW_REPORT = false;
        $flag_show_message_SCAN_RETURNED_ERROR = false;
        $flag_show_message_REPORT_TAKES_LONGTIME = false;
        if (isset($_GET['license_update']))
        {
            if ($_GET['license_update'] == 1)
            {
                FUNC_WAP2_general::UpdateLicenseInfo();
                $flag_show_message_REVIEW_REPORT = true;
            }
            
            if ($_GET['license_update'] == 2)
            {
                FUNC_WAP2_general::UpdateLicenseInfo();
                $flag_show_message_SCAN_RETURNED_ERROR = true;
            }
            
            if ($_GET['license_update'] == 3)
            {
                FUNC_WAP2_general::UpdateLicenseInfo();
                $flag_show_message_REPORT_TAKES_LONGTIME = true;
            }
        }
        
        $license_info = $_SESSION['session_plgwap2_license_info'];
        
        $params = FUNC_WAP2_general::Get_SQL_Params(array('sql_results', 'sql_latest_scan_date'));
        
        if ($license_info['membership'] == 'free') $membership_txt = 'free';
        if ($license_info['membership'] == 'trial') $membership_txt = 'trial';
        if ($license_info['membership'] == 'pro') $membership_txt= 'PRO';
        if (FUNC_WAP2_general::IsPRO_full()) $membership_txt= 'PREMIUM';

        ?>
        
        <?php
            FUNC_WAP2_general::Wait_CSS_Loader();
        ?>

        <div id="main" class="ui main container" style="float: left;margin-top:20px;display:none">
            <h2 class="ui dividing header">Antivirus scanner</h2>
            
            <?php 
            if (ini_get('max_execution_time') < 240)
            {
                $msg_data = array(
                    'type' => 'warning',
                    'content' => 'Your PHP has limits for <b>max_execution_time</b> To give you the best results and stable work of the scanner, please contact with your hosting company support and ask them to set <b>max_execution_time = 600</b>'
                );
                FUNC_WAP2_general::Print_MessageBox($msg_data);
            }
            
            
            if ($flag_show_message_REVIEW_REPORT && isset($_SESSION['session_plgwap2_license_info']['reports']) && count($_SESSION['session_plgwap2_license_info']['reports']) > 0)
            {
                $msg_data = array(
                    'type' => 'warning',
                    'content' => 'Please review your 